Forums

Flash Block Writing

Started by cmdamour December 5, 2006
I am having some trouble performing a block write to flash, and was
wondering if anyone could give me a hand. I've searched the group's
postings but have not found much that helped. In short, I copy the
flash block write function from the MSP430x1xxx users guide (slau049f)
into RAM, by using one listed in the Flash_ww function in the TI
"Flash Self Programming Technique" application note.

The function works in the IAR simulator, so I am pretty confident in
my ability to copy code. When I run the program on an MSP430F157 on
the TI EVM, the function hangs while writing the block. It writes one
word to flash, than hangs on the next instruction which checks the
WAIT bit in FCTL3.

I haven't been able to check the clock speeds with a scope yet mostly
b/c I am not sure what speed for which speed I should be aiming. I
know I have 4ms to perform a block write, and judging from the
comments in the code example in the users' guide having the flash
timing generator sourced from an SMCLK between 514 kHz and 952 kHz
with a divider of 2 will cause the function to execute in under 4ms?
Would there be a problem if the flash timing generator were running
faster? For instance, if I had it sourced from the 4 mHz MCLK without
a divider?

Thanks for the help, in advance.

-C

Beginning Microcontrollers with the MSP430