| Article: |
Black Box with a View, Part 2 | |
| Subject: | Oops | |
| Date: | 2006-02-28 06:37:18 | |
| From: | bartvan deenen | |
|
Me again :-)
|
||
Showing messages 1 through 1 of 1.
-
Oops
2006-02-28 22:44:15 georgebelotsky [View]
|
|
||||||||||||||||||
Women in TechnologyHear us Roar
Showing messages 1 through 1 of 1.
|
||||||||||||||||||
|
||||||||||||||||||
Upon closer scrutiny, however, there is no such crystal on the schematic. In any case, the diagram shows an 8MHz crystal connected to XIN/XOUT instead.
I also asked a really smart person (Chris Paynter, who designs circuits, PCB layouts, etc. professionally) for a second opinion. He confirmed the above.
This probably explains your experiences (strangely, the interrupt code always worked well during the numerous tests that I carried out).
To be safe, try using
SMCLKas the source. By default, it runs from theDCOCLKat about 800 kHz. Although theDCOis not very accurate, it does not matter for the examples here. The approach is quite simple to set up; just modify "LED_timer_driver.c" as follows.#define TIMER_PERIOD 100with#define TIMER_PERIOD (51200-1)TACTL = TASSEL_1 | MC_1;withTACTL = TASSEL_2 | MC_1 | ID_1 | ID_2;The
TASSEL_2bit by itself selectsSMCLKas the input clock. The twoID_Xbits cause the input clock to be divided by 8. So, you get ~800kHz / 8 / 51200 = ~2 (i.e. the LED will be toggled around twice per second). Thus, the LED will flash approximately once per second.