This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Howdy Everybody,
I have a project that I have been trying to get through. It works great on a launchpad, I have been attempting to have it on its own board. I have the pullup resistor on the reset pin, the cap on it and also the caps between VCC and ground. I do not have the crystal. I have been trying to modify the code to not use the crystal, as when I attempt to use the chip off the board I can not get it to work correctly.
Delete crystal setup line
I thought I would need to enable the DCO, and I was going to use SMCLK and DIV8 I have tried many things with no luck.
If I change it to TASSEL_2 / DIV8 it does nothing at all, it will load but do nothing.
Thanks everybody for the help! I thought there was a document that that had the timers explained in a more basic level, but I have not been able to locate it.
// Set up 32768Hz crystal BCSCTL3 |= XCAP_3; // select 12pF caps <- DELETE LINE // NEED TO INTALIZE THE DCO ?? // initialize Timer0_A TA0CCR0 = ( 32768 / TICKS_PER_SECOND ) - 1; // set up timer for 32Hz <- CHANGE TO (125000 / TICKS_PER_SECOND) - 1 TA0CTL = TASSEL_1 + ID_0 + MC_1; // configure and start timer <- CHANGE TO TASSEL_2 + ID_3 + MC_1 // enable interrupts TA0CCTL0 = CCIE; // enable timer CCR0 interrupts __enable_interrupt(); // set GIE in SR LPM3; // select low power mode 3 while(1); } /** * Timer interrupt called at 32Hz (TICKS_PER_SECOND) */ #pragma vector = TIMER0_A0_VECTOR __interrupt void myTimerISR(void)
IT WORKS IT WORKS IT WORKS!!!!!
Thanks Tony!!!!!!
Without that added code line it would work on my PCB when it was on the debugger. As soon as you terminated the debug session it would not do anything.
With the added line of code it works everywhere now!
// initialize Timer0_A BCSCTL3 |= LFXT1S_2; // aclk = vloclk TA0CCR0 = ( 3276 / TICKS_PER_SECOND ) - 1; // set up timer for 32Hz TA0CTL = TASSEL_1 + ID_0 + MC_1; // configure and start timer
It will not be accurate though.
vloclk is around 12Khz +-3 KHz, so a factory calibrated 1% 1MHz DCO to SMCLK is more accurate (but also uses more power)
**Attention** This is a public forum