Application of FLASH in MSP430F149 Embedded System

Publisher:工号待定Latest update time:2012-04-18 Source: 微计算机信息 Keywords:K9F1G08U0M  MSP430F149  FLASH Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

NAND Flash is a non-volatile memory using NAND structure technology. It has the characteristics of ROM memory. The data stored in the chip can be maintained for 10 years without loss in the case of power failure, and the chip pins and access have similar characteristics to RAM. NAND FLASH memory multiplexes the data line and address line into 8 lines, and also provides command control signal lines. Therefore, the number of pins of NAND FLASH memory will not increase due to the increase of storage capacity. This greatly facilitates system design and product upgrades.

1 Component Introduction

1.1 MSP430 chip

The MSP430 series of microcontrollers is a 16-bit RISC series of microcontrollers launched by TI. This series is a group of ultra-low power microcontrollers with a power supply voltage range of 1.8V-3.6V. Considering the requirements of micro volume and low power consumption of this system, MSP430F149 is selected here. It has 60KB Flash Memory, 2kb RAM, 8 channels with a 12-bit A/D converter with a sampling rate of 200K, hardware multiplier, 2 16-bit timers with a large number of capture/compare registers, watchdog, etc., which provides a good foundation for the further development and expansion of the system, and is particularly suitable for the development of more complex systems.

1.2 NAND Flash

NAND Flash is a new generation of data storage device launched and developed by Sumsung. Here we use K9F1G08U0M chip, with power supply voltage of 2.7V-3.6V, which is consistent with MSP430F149, low power consumption, capacity up to 128M×8Bit, read and write by page, erase by block, and use I/O port as command pin/address pin/data pin in time-sharing multiplexing. It has high reliability.

2 Hardware Design

In this system, the data input and output port of K9F1G08U0M is connected to the P6 port of the microcontroller. The chip select signal is connected to P2.4 of the microcontroller. CLE (command latch control terminal), ALE (address latch control terminal), WE (write operation control terminal), and RE (read operation control terminal) respectively control the levels of the microcontroller P3.3, P2.3, P2.6, and P2.5 pins to determine the level of the FLASH.

Control word operation, address operation, write operation or read operation. The write protection function is not used here, so WP is connected to a high level. The circuit composed of the partial connection between FLASH and the microcontroller is shown in Figure 1.

Figure 1 Connection between MSP430F149 and K9F1G08U0M

3 Software Design

There are many development software for MSP430. This article uses IAR's integrated development environment - IAR Embedded workbench, and uses C430 (MSP430 series C language) to write and debug. The microcontroller's operations on FLASH mainly include writing, reading, and erasing.

3.1 Write Operation

Writing data to FLASH is page-based. The command word, address and data of K9F1G08U0M are all operated in time-sharing mode through the parallel port lines I/O0-I/O7 under the control signal. Addresses A0-A10, A11-A26 are sent in 4 times through I/O0-I/O7. At the same time, the K9F1G08U0M chip provides a status indication signal line. When the signal is low, it indicates that FLASH may be busy in the erase, program or read operation; when it is high, it indicates that it is ready, and various operations can be performed on the chip. The write operation flow chart of 126M data to be written in this system is shown in Figure 2. [page]

3.2 Read Operation

There are three types of read operations: serial page read, continuous row read, and random read. Serial page read is selected here. First, input the read operation control word 00h, then write the address, write the control word 30h, and after the signal becomes high, read out the data of this page in sequence. Then change the page address to read out the data in other pages. The operation flow chart is shown in Figure 3.

Figure 2 Write operation flow chart

Figure 3 Flowchart of the program to read FLASH data

3.3 Erase Operation

Any write operation of the FLASH device must be performed in an empty or erased cell, so the FLASH must be erased before the next data storage.

The erase operation is based on blocks. There are 1024 blocks in K9F1G08U0M. The input of block address requires two cycles. The address of block operation is only valid from A18 to A27, and A12 to A17 are ignored. The block erase command (D0h) sent after the address starts the block erase operation. After the signal becomes high, the command word 70h is sent, and the value of I/O0 is read to determine whether the data erase is successful. Figure 4 is a block erase flow chart.

Figure 4 Flowchart of erasing FLASH program

4 Programming

Here is a partial program of write operation. Read operation and erase operation can be programmed by referring to the flowchart in the article. It is worth noting that other specific write address operations should be read carefully [page]

K9F1G08U0M chip information.

#include

#define CLE BIT3

#define ALE BIT3

#define WE BIT6

#define CE BIT4

#define RE BIT5

#define RB BIT7

void ReadFlash(); //Read FLASH subroutine

void WriteFlash(); //Write FLASH subroutine

void inituart(void); //Initialize asynchronous serial communication

void Write10h(); //Write control word 10h subroutine

void WriteCommand(); //Write command word write address

void ClrFlash(); //Erase FLASH subroutine

unsigned int k,i,a

void main ()

{

WDTCTL = WDTPW + WDTHOLD;

BCSCTL1 &= ~XT2OFF;

do

{

IFG1 &= ~OFIFG;

for (iq0=0x05; iq0>0; iq0--);

} // Check whether the crystal oscillator is oscillating

while ((IFG1 & OFIFG)!= 0);

BCSCTL2 = SELM_2 + SELS + DIVS0;

//SMCLK selects 4M after 2 division

While(k<0xFC00) //Execute when the number of pages is <64512

{

WriteCommand(); //Call the subroutine to write the control word and address

While(i<2048) //Execute loop when the number of bytes is <2048

{

WriteFlash(); //Call the data writing subroutine,

32 bytes

i=i+32; //Number of bytes + 32

}

i=0; //After writing a page, the number of bytes is set to 0

Write10h(); //Call the write 10h subroutine

while(!(P2IN & RB)); //Wait for RB signal to become high

k++; //Page number + 1

}

k=0; //Set the page number to 0

LPM4; //After all is written, MSP430 enters low power mode 4

5 Conclusion

The MSP430 series of microcontrollers have the characteristics of strong real-time processing capabilities, fast running speed, and high cost performance. This article introduces the application of FLASH K9F1G08U0M in an embedded system composed of MSP430F149. The experiment shows that the whole system is simple and reliable, with complete functions and stable operation, and has practical value. The author's innovation point: realizes the application of two low-power chips, MSP430 microcontroller and NAND Flash, in embedded systems, completes the write, read and erase operations of FLASH, and achieves the system's micro volume and low power consumption characteristics.

Keywords:K9F1G08U0M  MSP430F149  FLASH Reference address:Application of FLASH in MSP430F149 Embedded System

Previous article:Task switching mechanism and interrupt scheduling optimization of μC/OS-II
Next article:Design of remote meter reading system based on CAN/RS485 double-layer network

Recommended ReadingLatest update time:2024-11-16 22:24

Basic principles of designing an anti-pinch system for electric windows based on an AVR Flash microcontroller
  Automatically closing power windows or doors on cars present a potential risk of jamming, crushing and possible injury. They must be able to reverse movement to prevent the force applied by the motor from exceeding normal limits. This feature means that speed, current and glass position must be constantly monitore
[Microcontroller]
Basic principles of designing an anti-pinch system for electric windows based on an AVR Flash microcontroller
STM8S003F3 internal flash debugging
Make a record here for future use Check the documentation manual, the starting address of data eeprom is 0x004000, which is used to store some information such as version number, ID, or flag bit. Sample code: typedef enum {     FLASH_MEMTYPE_PROG = (u8)0x00, /*! Program memory */     FLASH_MEMTYPE_DATA = (u8)0x0
[Microcontroller]
Microchip PIC24F dsPIC33E flash self-erasing summary
I have been playing with it for a long time recently and found that it is really difficult. The MHCP 16-bit system flash has two modes of erase and write operation: ICSP and RTSP. The former is the common official pickit/ICD programming and burning operation sequence. The latter is for bootload or data storage self-
[Microcontroller]
Phison: NAND Flash has many emerging applications
Last week, Morgan Stanley released a report titled "Memory-Winter is coming", which predicted a pessimistic outlook for the storage industry. In response, Taiwan's NAND Flash controller IC manufacturer Phison responded. According to Taiwan media Economic Daily, Phison pointed out that the part of the storage market
[Mobile phone portable]
NAND Flash driver design
  introduction   In the current development and design of various embedded systems, storage module design is an indispensable and important aspect. NOR and NAND are the two main non-volatile flash memory technologies on the market. NOR Flash memory has a small capacity and a slow write speed, but because of its fast
[Microcontroller]
NAND Flash driver design
Teledyne e2v expands Flash family of CMOS image sensors for 3D laser triangulation applications
New Flash 2K LSA image sensor designed for systems using the large Scheimfleur angle Seville, Spain, March 12, 2024 — Teledyne e2v, a Teledyne Technologies company and global innovator of imaging solutions, announced the expansion of its Flash™ CMOS image sensor family with the launch of Flash 2K LSA, specifically d
[sensor]
Teledyne e2v expands Flash family of CMOS image sensors for 3D laser triangulation applications
STM32 FLASH operation
When it comes to STM32's FLSAH, our first reaction is that it is used to install programs. In fact, the STM32's on-chip FLASH is not only used to install programs, but also to install chip configuration, chip ID, bootloader, etc. Of course, FLASH can also be used to store data.      I have collected some information a
[Microcontroller]
Research on Flash Secondary Loading Technology of C6000 Series DSP
IntroductionTI 's C6000 series DSP has powerful processing capabilities and is widely used in embedded systems. Since the running speed of the program in the DSP's internal memory is much faster than that of the external memory, it is usually necessary to load the program from the outside to the DSP for internal
[Industrial Control]
Research on Flash Secondary Loading Technology of C6000 Series DSP
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号