2. In the Target page, Data Model option, select Medium or Large in 4.
3. Explanation:
- Select SMALL to access only the space within 64K, and the space outside can only be accessed by internal functions
- Select Medium to access the space within 1M
- Select Large to access the entire space
1. F5XX 430X
2. Select Large small medium. The effect is to change the number of bytes occupied by the pointer variable. The default pointer variable in IAR is 2 bytes. Select large to occupy 4 bytes, so the pointer can access addresses beyond the 64K range.
3. You can use IAR internal functions, */
void __data20_write_char (unsigned long __addr,
unsigned char __value);
void __data20_write_short(unsigned long __addr,
unsigned short __value);
void __data20_write_long (unsigned long __addr,
unsigned long __value);
unsigned char __data20_read_char (unsigned long __addr);
unsigned long __data20_read_long (unsigned long __addr);
How to operate the flash memory of 5438
I would like to ask about the flash memory operation of MSP430F5438. The code is shown below. Why does the fixed address of the flash memory not change?
Code:
void main(void)
{
unsigned long SEGMENT = 0x20000ul;
WriteFlash(SEGMENT);
FlashErase(SEGMENT);
while(1);
}Code:
//Erase Flash address: adr specifies address Y
void FlashErase(unsigned long pAddr)
{
uchar * Flash_ptr = (uchar *)pAddr;
_DINT();
while(BUSY & FCTL3);
FCTL3 = FWKEY;
FCTL1 = FWKEY+ERASE;
*Flash_ptr = 0;
while(BUSY & FCTL3);
FCTL3 = FWKEY+LOCK;
_EINT();
}Code:
//Write Flash address: adr specifies address,
void WriteFlash(unsigned long pAddr)
{
_DINT();
unsigned int i;
uchar * Flash_ptr = (uchar *)pAddr;
while (FCTL3&BUSY);
FCTL3 = FWKEY;
FCTL1 = FWKEY+WRT;
for(i = 0; i < 128; i++)
{
*(Flash_ptr++) = record1[i];
while(!(WAIT & FCTL3));
}
while (FCTL3&BUSY);
FCTL1 = FWKEY;
FCTL3 = FWKEY+LOCK;
_EINT();
}
Previous article:LCD human-computer interaction data acquisition system
Next article:DS1302 MCU Program
Recommended ReadingLatest update time:2024-11-16 13:04
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Angle estimation problem of micro-core sliding film observer SMO
- BPM shortwave receiver module
- DAC8552 of MSP430F5529 microcontroller
- Several important questions about Zigbee
- Where can I change the component description in the AD printed circuit board BOM?
- CY8CKIT-149 PSoC 4100S PLUS PROTOTYPING KIT Resources
- Have any students participated in previous TI invitational competitions? Is it necessary to use a TI board as the development board?
- Embedded people are blessed, these four lines of code are enough to change your life
- STM32 Tmall flagship store bought several microcontrollers
- How to modify the circuit if the simulation results are not available?