Hi there,
I would like to make sure that this code is enabling the external 32.768kHz watch crystal and also I would like to know how to enable the internal 6pF load capacitors for the crystal. I'm a hardware engineer so I will pass on the info to my software engineer. Thanks!
Andy.
void main(void)
{
BCSCTL1 |= XCAP_1; // ACLK/2
WDTCTL = WDT_ADLY_16; //250 // WDT 1s/4 interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR = 0xF8; // All P1.x outputs
P1OUT = 0; // All P1.x reset
P2DIR = 0xFF; // All P2.x outputs
P2OUT = 0; // All P2.x reset
P1OUT |= 0x08;
// initilize variables
#if MY_DEBUG
i_error = 0;
led_on_mask = 0x08;
mode = TEST_MODE;
#else
i_error = 0;
led_on_mask = 0;
mode = 0;
#endif
cnt_watering_hour = 0;
cnt_watering = 0;
upper_limit_hour[0] = 4;
upper_limit_hour[1] = 6;
upper_limit_hour[2] = 12;
while(1)