FRAM好像可以提供8位16位写入,64位有问题
FRAM
The FRAM can be programmed via the JTAG port, Spy-Bi-Wire (SBW), the BSL, or in-system by the CPU.
Features of the FRAM include:
• Ultra-low-power ultra-fast-write nonvolatile memory
• Byte and word access capability
• Programmable and automated wait-state generation
• Error correction coding (ECC)
你得操作不对,参考官方代码MSP430Ware中例子
//******************************************************************************
// MSP430FR413x Demo - Long word writes to FRAM
//
// Description: Use long word write to write to 512 byte blocks of FRAM.
// Toggle LED after every 100 writes.
// NOTE: Running this example for extended periods will impact the FRAM
// endurance.
// ACLK = REFO, MCLK = SMCLK = default DCODIV = ~1MHz
//
// MSP430FR4133
// ---------------
// /|\| |
// | | |
// --|RST |
// | |
// | P1.0 |---> LED
//
// Cen Fang
// Texas Instruments Inc.
// August 2013
// Built with IAR Embedded Workbench v5.60 & Code Composer Studio v5.5
//******************************************************************************
#include
void FRAMWrite(void);
unsigned char count = 0;
unsigned long *FRAM_write_ptr;
unsigned long data;
P1OUT &= ~BIT0; // Clear P1.0 output latch for a defined power-on state
P1DIR |= BIT0; // Set P1.0 to output directionOUT
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings
data = 0x11111111; // Initialize dummy data
while(1)
{
data += 0x00010001;
FRAM_write_ptr = (unsigned long *)FRAM_TEST_START;
FRAMWrite();
count++;
if (count > 100)
{
P1OUT ^= 0x01; // Toggle LED to show 512K bytes
count = 0; // ..have been written
data = 0x11111111;
}
}
}
void FRAMWrite (void)
{
unsigned int i=0;
SYSCFG0 &= ~DFWP;
for (i = 0; i < 128; i++)
{
*FRAM_write_ptr++ = data;
}
SYSCFG0 |= DFWP;
}
// Fram record address
#define FRAM_RECORD_ADDRESS 0xFF00 // Refresh every 1 second
#define FRAM_RECORD_CHECK 0xFF40 // First record check address
#define FRAM_RECORD_BASE 0xFA00 // Monthly record in stand-alone address