AN1154 STMicroelectronics, AN1154 Datasheet - Page 81

no-image

AN1154

Manufacturer Part Number
AN1154
Description
8031-PSD DESIGN TUTORIAL
Manufacturer
STMicroelectronics
Datasheet
containing the power-up boot code and programming algorithms for Flash memory, would be programmed
into EES0/EES1.
START-UP SEQUENCES, UART DOWNLOADS
Let us assume that a PC or lap-top is to be used as a host to download firmware to this embedded system
over an RS-232 UART channel (instead of JTAG). These download actions can program the main Flash
memory for the very first time; can update the main Flash after it has been programmed once; or can
update the boot code after being programmed for the first time by a device programmer or JTAG link.
There are six valid boot-up arrangements (labelled respectively: a, b, c, d, e and f) that must be handled
by the system at power-up (reset). The default setting of the VM register at power-up places the main
Flash memory in the data space and the EEPROM in the program space. Please refer to the memory
maps in Figure 62, Figure 63, Figure 64, and Figure 65.
a. RS-232 cable not attached, main Flash valid
8031 action:
Now, the system is in normal operating mode. More 8031 action:
Normal application code can now be executed from main Flash memory.
b. RS-232 cable attached, main Flash valid, no download demands from host
Action: same as step "a.", above.
c. RS-232 cable attached, main Flash valid, download of main Flash is demanded by host
8031 action:
Now, the system is in normal operating mode. More 8031 action:
Normal application code can now be executed from main Flash memory.
Boot from EES0/EES1
Run a checksum on the Flash memory
Check the UART for a pending host download request of main Flash (Figure 62)
Set a bit in the PSD VM register to put main Flash into program space (Figure 63)
Set the SWAP bit in PSD, which swaps EES0/EES1 with FS0 (Figure 64)
Set a bit in the PSD VM register to put the EEPROM into data space (Figure 65)
Check the UART for a host download request of boot memory
Set the ENABLE_DATA_HALF bit in the PSD if no boot download request exists
Boots from EES0/EES1
Run a checksum on the Flash memory
Check the UART for a pending host download request of main Flash (Figure 62)
Program the main Flash memory with data from the UART
Set a bit in the PSD VM register to put main Flash into program space (Figure 63)
Set the SWAP bit in PSD, which swaps EES0/EES1 with FS0 (Figure 64)
Set a bit in the PSD VM register to put the EEPROM into data space (Figure 65)
Check the UART for a host download request of boot memory
Set the ENABLE_DATA_HALF bit in the PSD if no boot download request exists
AN1154 - APPLICATION NOTE
81/83

Related parts for AN1154