Steve Underwood wrote:

Chris Liechti wrote:

N. Coesel wrote:

You can't program byte by byte. It has to be word by word.



I wasn't shure whether it was word or byte. I took the wrong guess, but it
doesn't really matter in respect to the context.



you can program the flash in byte or word mode. i've used both.

chris


Isn't a byte write to this memory just a word write with one byte set to all ones?

To answer my own question... No. The flash can be written byte by byte or word by word. I was getting confused with something else. Amongst my own library of routines I have the following for 8 bit writes:

void flash_write_int8(int8_t *ptr, int8_t value)
{
     _DINT();
     FCTL3 = FWKEY;                      /* Lock = 0 */
     FCTL1 = LOCK | WRT;
     *((int8_t *) ptr) = value;            /* Program the flash */
     FCTL1 = FWKEY;                      /* Erase, write = 0 */
     FCTL3 = FWKEY | LOCK;
   _EINT();
}

Regards,
Steve


Reply via email to