Hello everyone,
I started to learn about MSP430F5438A, I have a problem with starting the clock. I have attached the circuit board schematics file I designed.
The schematic of the entire circuit board can be viewed in this link driver:
I downloaded the example code about msp430x54xA_UCS_6.c in this link.
http://dev.ti.com/tirex/explore/node?node=AMtL227pGhUpuFnMS3tjJQ__IOGqZri__LATEST
The compiler I use is IAR for MSP430 version 7.12.
Using the debug feature, I noticed that my program was running forever in the do while loop.
There is an absurdity here I cannot understand.
#define DCOFFG (0x0001u) / * DCO Fault Flag * /
#define XT1LFOFFG (0x0002u) / * XT1 Low Frequency * /
#define XT1HFOFFG (0x0004u) / * XT1 High Frequency * /
#define XT2OFFG (0x0008u) / * High Frequency Oscillator 2 * /
The initial value of UCSCTL7 = 1027 (0b0000 0100 0000 0011) when I open the debug program.
I think, after the command
UCSCTL7 & = ~ (XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG);
The value of UCSCTL7 = 1024 (0b0000 0100 0000 0000), but it gives a value of 1026 (0b0000 0100 0000 0010). This makes the do while loop run forever.
Can someone explain help me with.
Thanks guys so much.