C8051F020's XRAM and non-volatile storage

Publisher:数字航海家Latest update time:2015-12-21 Source: eefocusKeywords:C8051F020 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
C8051F020 has 4Kbyte XRAM and 128byte non-volatile storage (equivalent to EEPROM). First, check the two options in Keil as shown below.

C8051F020's XRAM and non-volatile storage


Then to use XRAM, just define the variable type as XDATA. It is best not to initialize it in the definition, otherwise there may be problems. If you need to use non-volatile storage, you need to write a driver, which is also very easy. First, turn off the interrupt before the operation; restore the interrupt status after the operation is completed. The related registers are FLSCL and PSCTL. It should be noted that writing FLASH can only change 1 to 0, so the entire sector must be erased before writing bytes. The variable type of the write byte is XDATA, using MOVX, and the read is to point to CODE, using MOVC. For example, the write pointer can be defined as uchar xdata *pwrite; the read can be defined as uchar code *pread; of course, when assigning a value to the pointer, it should be converted into a pointer variable, such as pwrite=(uchar xdata *)=addr; pread=(uchar code *)=addr; then assign a value to the space pointed to by the pointer.

Keywords:C8051F020 Reference address:C8051F020's XRAM and non-volatile storage

Previous article:C8051F020 UART
Next article:8-bit PWM module of C8051F020

Recommended ReadingLatest update time:2024-11-16 14:30

Design of stereo signal phase difference level difference tester by using C8051F020 microcontroller
The LR stereo signal is processed through spectrum analysis, shaping and duty cycle detection circuits, and the zero-crossing phase identification method is used to test the phase difference by measuring the rectangular wave duty cycle. The LR signal is converted to AC/DC using the AD736 special chip, and the LR level
[Microcontroller]
Design of stereo signal phase difference level difference tester by using C8051F020 microcontroller
Design of anti-intrusion equipment at traffic accident scene
0 Introduction In recent years, the number of secondary traffic accidents caused by the lack of technical means and poor system of protection at the scene of traffic accidents in China has exceeded 200 per year, and the number of deaths has exceeded 100 per year. From 2003 to 2007, dozens of police officers died in t
[Microcontroller]
Design of anti-intrusion equipment at traffic accident scene
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号