3116 views|0 replies

1379

Posts

0

Resources
The OP
 

Application skills/IAP application technology of SST89C54/58 series microcontrollers [Copy link]

Abstract : SST89C54/58j is a microcontroller with 20KB/36KB Flash launched by Silicon Storage Technology. The chip integrates a functional module that can operate Flash. The programmable functions in the application are realized by partitioning Flash. This article introduces their IAP function and gives some subroutines of the IAP function.
Keywords : SST89C54/58 IAP Flash memory
SST89C54/58 microcontrollers are derivative products of MCS-51 series microcontrollers. They are fully compatible with standard 8052 microcontrollers in terms of instruction system, hardware structure and on-chip resources, except that the capacity of the internal program memory Flash is increased.
Features of SST89C54/58:
*256×8-bit internal RAM;
*3 16-bit timer/counters (T0, T1, T2);
*1 full-duplex, programmable serial communication port (UART);
*6 interrupt sources, 2 priority levels;
*4 8-bit I/O ports (32-bit I/O pins);
*Fully compatible with TTL and CMOS levels;
*Operating frequency is 0~33MHz when powered by 5 (1±0.1)V;
*Operating frequency is 0~12MHz when powered by 3 (1±0.1)V;
*Internal watchdog timer (WDT);
*Supports 3 power saving modes: idle, power-off and wait, and supports external low-level interrupt to exit power-off mode.
1 Memory structure of SST89C54/58
1.1 Program Memory
The only difference between 89C54 and 89C58 is the memory size; the former is 20KB, the latter is 36KB. The program memory is divided into two blocks: block0 and block1: block0 is 16KB for the former and 32KB for the latter, both divided into 128-byte segments; block1 is 4KB, divided into 64-byte segments. Their program memory structures are shown in Figure 1.
The addresses of block0 and block1 are not continuous. Block1 starts from F000H. SST89C54/58 allows block0 to be mapped to block1. After power-on, the program can be executed from either block0 (0000H) or block1 (F000H). The block from which the program starts is determined by the Re-Map[1:0] bit of the microcontroller. When both bits are 1, the program starts from 0000, otherwise, it starts from F000H. The Re-Map[1:0] bit is non-volatile and can be programmed with a programmer.
1.2 Data Storage
The SST89C54/58 has 256 bytes of internal data memory, of which the lower 128 bytes of RAM (00H to FFH) are exactly the same as those of the 8052; some special function registers (SFRs) for IAP functions are added to the upper 128 bytes. The definition and settings of the newly added SFRs are listed in Table 1.
2 SST89C54/58 In-Application Programmable (IAP)
IAP refers to the operation of erasing and programming Flash blocks, Flash registers, encryption bits, etc. in the user's application. SST89C54/58 starts and introduces the IAP function by setting and clearing SFCF.6. The program can start IAP to program block1 when it is in block0, and it can also program block0 in block1, but each cannot program itself. The SST89C54/58r IAP function mainly has the following commands (taking block0 to program block1 as an example):
(1) Chip erase
The command format is as follows:
MOV SFCF, #0C0H; start IAP
MOV SFDT, #55H
MOV SFCM, #01H; write command word
; query SFST.2, wait for the chip to be erased,
; use MOVC to verify whether each unit is FFH.
(2) The block erase
command format is as follows:
MOV SFCF, #0C0H; start IAP
MOV SFAH, #0F0H/#00H; erase block1/block0
MOV SFDT, #55H
MOV SFCM, #0DH; write command word
; query SFST.2, wait for the chip to be erased,
; use MOVC to verify whether each unit is FFH.
(3)
The format of the segment erase command is as follows:
MOV SFCF, #0C0H; Start IAP
MOV SFAH, segment address high byte
MOV SFAL, segment address low byte
MOV SFCM, #0BH; Write command word
; Query SFST.2, wait for the chip erase to end,
; Use MOVC to verify whether each unit is FFH.
(4) Byte programming
MOV SFCF, #0C0H; Start IAP
MOV SFAH, address high byte to be programmed
MOV SFAL, address low byte to be programmed
MOV SFDT, data to be programmed
MOV SFCM, #0EH; Write command word
; Query SFST.2, wait for the chip erase to end,
; Verify whether the data written into the unit is correct.
(5) Byte check
MOV SFCF, #0C0H
MOV SFAH, the address of the data to be checked is the high byte
MOV SFAH, the address of the data to be checked is the low byte
MOV SFCM, #06H
NOP
MOV A, SFDT; A stores the contents read from the specified unit address
In addition, the Re-Map[1:0] bits can be programmed to 3 confidential bits through byte programming, and only the specified content is written at a specific address.
3 Purpose of SST89C54/58 IAP function
The IAP function allows you to do MCU experiments without a programmer. This is a great convenience for people who are learning MCU for the first time, especially for the teaching of MCU in schools, and is a low-cost MCU development method.
The software of the product can be upgraded. No external monitoring chip is needed. The product upgrade software in the PC can be downloaded to the product through the serial port to achieve product software upgrade. In your own laboratory, you can upgrade the software of the remote product through the modem. This will be the inevitable trend of electronic products in the future.
The product parameters can also be modified online. It can realize online storage of on-site historical data, curve parameter correction and other functions. It is suitable for some application products that need to change data frequently (such as interest meters, bill meters, password locks and products that need to be upgraded, such as micro printers, etc.) and products that need to change equipment parameters remotely (remote control alarms, remote control household appliances and other remote control devices).
This post is from MCU
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list