Women in Technology

Hear us Roar

  Black Box with a View, Part 2
Subject:   Oops
Date:   2006-02-28 06:37:18
From:   bartvan deenen
Me again :-)

Now I understand ACLK always exists, even without the watch crystal, The problem was the standard period value, which was much too high to see any blinking. I couldn't even hear it when I flipped the buzzer.

We keep chugging along. Later I'll try the uCos-II port, nice to have are RTOS

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Oops
    2006-02-28 22:44:15  georgebelotsky [View]

    The easyWeb2 specs do claim a 32kHz crystal.

    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 SMCLK as the source. By default, it runs from the DCOCLK at about 800 kHz. Although the DCO is 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.

    1. Replace the line #define TIMER_PERIOD 100 with #define TIMER_PERIOD (51200-1)

    2. Replace the line TACTL = TASSEL_1 | MC_1; with TACTL = TASSEL_2 | MC_1 | ID_1 | ID_2;

    The TASSEL_2 bit by itself selects SMCLK as the input clock. The two ID_X bits 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.