MicroConverter in Serial Download Mode. Data Packet Command Functions

Страницы работы

Фрагмент текста работы

Flash/EE data memory space is erased prior to the download (the Flash/EE program space is erased prior to the down by default). The program is not run subsequent to the download sequence and therefore a power cycle or a hard reset will be require (without the PSEN pulldown) to initiate program execution.

DOWNLOAD test3.hex /c:1 /r:0F00

Downloads a program called test2.hex via the PC COM1 port to a target system where the MicroConverter is running at an 11.0592MHz clock frequency. The Flash/EE data memory space is erased prior to the download (the Flash/EE program space is erased prior to the down by default). The program is automatically run from address 0F00hex as soon as the download sequence is complete (A user may want to use the ‘run from address’ option in development to avoid repeating some time consuming configuration routines that would delay code debug).

4.2 PROGRAM FLOW SUMMARY :

The download.c program flow can be outlined as follows :

Reset sequence:

Note: The version 1 loader will automatically erase Flash/EE Program and Data spaces prior to transmitting its ID character string. The version 2 loader will wait until it recieves a specific erase Command byte (see section 2.5 before choosing to erase Flash/EE program space alone or the Flash/EE program and Data spaces.)

The version 1 loader uses "!" as the reset sequence and the target responds with:

"ADuC812  krl"

The new loader uses a four byte reset command:

 "!Z"<0x00><checksum byte>

The target responds with a 25 byte part ID string, beginning with "ADI" and ending with a <checksum> byte. (see section 2.3)

In order to handle both loader revisions, this downloader program first sends the "!" and waits for a response. If it does not get one, it sends the "Z"<checksum><0x00> and waits for the new response, thereby allowing it to identify which loader revision is present and which protocol to adopt in the subsequent download sequence.

Download Sequence:

The old loader firmware can decode individual Intel hex records itself. The packets are read from the file, and sent 'as is' to the target. The target responds to each packet with a ACK or NACK to indicate success or failure respectively.

The new loader needs the data to be encoded as "write code memory" commands (see section 2.5.2), which are sent as loader command packets:

Run sequence:

The old loader run command was ";ADDR". ADDR was in HEX text format, e.g. ";0000" to run from zero. The target would respond with an ACK if successful.

The new loader uses a "run user code" command, sent as a loader command packet.

A flowchart illustrating the detailed program flow is shown in figure 4 overleaf.

Figure 4. download.c Code Flowchart

5.0  WINDOWS SERIAL D OWNLOADER (WSD.EXE):

The Windows Serial Downloader (WSD) is a windows software program that allows a user to serially download Intel standard Hex files as created by the ASM51 assembler. The WSD works with a version 1 or a version 2 loader. The Intel standard hex file is downloaded into the on-chip program FLASH memory via any of the serial ports (COM1 COM4) on a standard PC.

The configuration window allows the user to configure the DOWNLOAD and RUN options. The download should be considered as an Erase, a Program and a setting of a security mode (if selected). Once the DOWNLOAD button is pressed on the WSD then the download options as set in the configuration window are sent to the MicroConverter. 

The following Download and RUN options are available to the user in the configuration window (fig 5 below).


Erase:

The user can choose to:

(a)  erase the flash/EE program memory, or, 

(b)  erase both the flash/EE program and data memory.

Program:

The user can choose to:

(a)  program the Flash/EE program memory

(b)  program the Flash/EE data memory or

(c)  program both the Flash/EE program and data memory.

Note: In the case of (a) above the user can choose to pre-erase the flash/EE program memory or both the flash/EE program and data memory. In the case of (b) or (c) the user must choose to pre-erase both the flash/EE program and data memory. Hence if downloading code to the flash/EE data memory only the users program code will be also erased. Hence this option may not be realistic.  

Security:

For the ADuC816/ADuC824 three security modes are available. The user can choose to set any combination of the security modes.

RUN:

The user can choose to:

(a) RUN from start (b) RUN from a particular address (c) RUN automatically

Похожие материалы

Информация о работе