Hi, i want to write my data in 20-bit flash memory address. Here's my code,
unsigned int *Flash_ptr; // Flash pointer
Flash_ptr = (unsigned int *) 0xfb00; // Initialize Flash pointer
FCTL2 = FWKEY + FSSEL1 + FN1; // SMCLK/3 = ~333kHz
FCTL3 = FWKEY; // Unlock Flash memory for write
FCTL1 = FWKEY + WRT; // Set WRT bit for write operation
*Flash_ptr = output; // Write value to flash
FCTL1 = FWKEY; // Disable Flash write
FCTL3 = FWKEY + LOCK; // Lock Flash memory
With this code i can write my output value into 0xfb00 memory address. If i change this address with 0x10000, an error occurs. How can i modify my code for writing data into 20-bit memory address?
Thanks.
Ferhat