![Sino Wealth SH79F3283 Скачать руководство пользователя страница 30](http://html1.mh-extra.com/html/sino-wealth/sh79f3283/sh79f3283_manual_1283063030.webp)
SH79F3283
30
7.4.3 SSP Programming Notice
To successfully complete SSP programming, the user’s software must be set as the following the steps:
(1) For Code/Data
Programming:
1. Disable interrupt;
2. Fill in the XPAGE, IB_OFFSET for the corresponding address;
3. Fill in IB_DATA if programming is wanted;
4. Fill in IB_CON1-5 sequentially;
5. Add 4 nops for more stable operation;
6. Code/Data programming, CPU will be in IDLE mode;
7. Go to Step 2 if more data are to be programmed;
8. Clear XPAGE; enable interrupt if necessary.
(2) For Sector Erase:
1. Disable interrupt;
2. Fill in the XPAGE for the corresponding sector;
3. Fill in IB_CON1-5 sequentially;
4. Add 4 NOPs for more stable operation;
5. Sector Erase, CPU will be in IDLE mode;
6. Go to step 2 if more sectors are to be erased;
7. Clear XPAGE; enable interrupt if necessary.
(3) For Code Reading:
Just Use “MOVC A, @A+DPTR” or “MOVC A, @A+PC”.
(4) For EEPROM-Like:
Step is same as code programming, the differences are:
1. Set FAC bit in FLASHCON register before programming or erase EEPROM-Like;
2. One sector of EEPROM-Like is 256 bytes, not 1024 bytes.
Note:
(1) The system clock is not less than 200 KHZ to ensure normal FLASH programming
(2) FAC must be cleared when you don't need to do EEPROM-like operation.
FLASHCON Register Description is as follows:
Table 7.13
Flash Access Control Register
A7H, Bank0
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
FLASHCON
-
-
-
-
-
-
-
FAC
R/W
-
-
-
-
-
-
-
R/W
Reset Value
(POR/WDT/LVR/PIN)
-
-
-
-
-
-
-
0
Bit Number
Bit Mnemonic
Description
7-1
-
Reserved
0
FAC
FAC: Flash access control
0: MOVC or SSP access main memory
1: MOVC or SSP access EEPROM-like