Other Parts Discussed in Thread: MSP-EXP430FR5994
Tool/software: Code Composer Studio
I'm in the process of migrating our firmware code to a MSP430FR5994 micro controller, everything was going rather fine until I activated the main clock with an external 16MHz quartz.
After searching for a day or two, the issue boils down to this problem : when I activate an SMCLK divider, writing to FRAM doesn't happen any more.
I've written a small piece of code (attached below) to illustrate the problem:
- initialize whatever is absolutely necessary, set the master clock at 16Mhz, without an SMCLK divider,
- write to FRAM,
- clear the FRAM.
The result can easily be checked by displaying the (info) memory area at 0x1800, and so far this works as a charm. However, if I step further:
- set a SMCLK divider,
- write to FRAM,
- clear the FRAM.
Nothing is written to FRAM.
I have tried this on two MSP-EXP430FR5994 boards with consistent results.
If I replace the DIVS__2 with DIVM__2, everything is OK.
I have found no indication on such a (known) bug...
So, what's happening here ?
#include <msp430.h> #include <stdint.h> /** * main.c */ void test() { uint8_t i; for (i=0; i < 255; i++) *((uint8_t *)0x1800 + i) = i; } void clear() { uint8_t j; for (j=0; j < 255; j++) *((uint8_t *)0x1800 + j) = 0xff; } int main(void) { CSCTL0 = CSKEY; CSCTL1 = DCORSEL | DCOFSEL_4; test(); clear(); CSCTL3 = DIVM__2; test(); clear(); return 0; }