Changeset - 047bf62162d3
[Not reviewed]
default
0 3 0
kripperger@CL-SEC241-09.cedarville.edu - 12 years ago 2013-03-14 18:40:55
kripperger@CL-SEC241-09.cedarville.edu
k
3 files changed with 11 insertions and 3 deletions:
0 comments (0 inline, 0 general)
slave/slave/modules.c
Show inline comments
 
@@ -97,14 +97,12 @@
 
	ASSR &= ~(1 << EXCLK);	// Disable external clock input (enabling crystal use)
 
	ASSR |= (1 << AS2);		// Enable timer2 async mode with an external crystal	
 
	_delay_ms(250);			// Let external 32KHz crystal stabilize
 
	TCCR2B = 0x05;			// Set the prescaler to 128: 32.768kHz / 128 = 1Hz overflow
 
	TIFR2 = 0x01;			// Reset timer2 overflow interrupt flag
 
	TIMSK2 = 0x01;			// Enable interrupt on overflow
 
	
 
	sei();					// Enable all interrupts
 
 }
 
  
 
  
 
  
 
 void modules_cameras_setup()
 
 {
slave/slave/slave.c
Show inline comments
 
@@ -29,13 +29,13 @@
 
#include "lib/spi.h"
 
#include "lib/geiger.h"
 
#include "lib/sensors.h"
 
#include "lib/cameras.h"
 
#include "lib/loopTimer.h"
 
#include "lib/masterComm.h"
 

	
 
#include "lib/watchdog.h"
 

	
 

	
 
void micro_setup()
 
{
 
	// Generic microcontroller config options
 
	sei();	// Enable interrupts
 
@@ -46,15 +46,19 @@ void micro_setup()
 
int main(void)
 
{
 
	// Writes ID to EEPROM, change for all modules and delete after programming
 
	// 0 is for generic setup, 1 is for sensors, 2 is for Geiger, 3 is for cameras
 
	//i2c_write(EEPROM_ADDR, 0x05, 0x03);
 
		
 
	// Power debounce
 
	_delay_ms(20);
 
		
 
	// Initialize		
 
	micro_setup();			// Generic microcontroller config options
 
	time_setup();			// Setup loop timer and interrupts (TIMER0)
 
	watchdog_setup();		// Setup watchdog timer
 
	led_configure();		// Configure ports and registers for LED operation
 
	io_configure();			// Configure IO ports and registers
 
	i2c_init();				// Setup I2C
 
	serial0_setup();		// Config serial port
 
	
 
	io_readModuleId();
slave/slave/slave.cproj
Show inline comments
 
@@ -205,12 +205,18 @@
 
    <Compile Include="lib\spi.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\spi.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\watchdog.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="lib\watchdog.h">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="modules.c">
 
      <SubType>compile</SubType>
 
    </Compile>
 
    <Compile Include="modules.h">
 
      <SubType>compile</SubType>
 
    </Compile>
0 comments (0 inline, 0 general)