Invoking DS89C430/450 ROM Loader Using Arduino

 

http://www.kerrywong.com/2010/06/13/invoking-ds89c430-45-rom-loader-using-arduino/


Abstract

DS89C430 and DS89C450 are two ultra-high-speed 8051-compatible microcontrollers from Maxim Integrated Products
One unique feature of DS89C430/450 microcontroller is that it has a ROM loader mode which can be used to program the microcontroller itself.

STEP1: Enable the Mode

According to the user’s guide, UART0 (pin 10 and pin 11) is invoked in ROM loader mode when RST is set to High and both EA and PSEN are set to LOW simultaneously. 

RST=H
EA/PSEN=LOW


Make RS-232/UART to USB COM port 


After the ROM loader mode is enabled, serial communication with PC can be handled by 2 methods:

A) A PC’s RS-232 port +  RS-232 transmitter/receiver such as DS232A.

B) PC’s USB port + USB-UART converter IC such as FTDI’s FT232R

If you have an Arduino, then you can just use the on-board FT232RL for this purpose. 

Technically speaking, this has little to do with Arduino as you could just use an FT232R adapter board, but with Arduino the RX/TX pins are readily accessible (pin 0 and pin 1) and thus using Arduino as a USB to UART converter couldn’t have been any easier. 

The basic schematic for using Arduino to invoke the DS89C430/450’s ROM loader mode is shown below:
DS89C430/450


Please note that DS89C430/450’s RX pin is connected to the socket on the Arduino board marked with RX and the TX pin is connected to the socket marked with TX. 

This is because Arduino’s RX socket is actually connected to the TX pin (pin 1) of FT232RL and TX socket is connected to the RX (pin 5) of FT232RL

The picture below shows how this is setup between an DS89C430 and Arduino (I used an external 5V supply here for the DS89C430 board, but you can use the 5V pin directly from the Arduino board if you want to).


Connecting DS89C430 to Arduino


According to the user guide, DS89C430/450’s ROM loader automatically tries baud rates generated by this equation:
ROMLoaderBaudRateCrystalFrequency192*(256TimerReload)
Or:
RomLoader Baud Rate   =  CrystalFrequency/{192*(256-TimerReload)}
And the timer reload values attempted by the loader are: FF, FE, FD, FC, FB, FA, F8, F6, F5, F4, F3, F0, EC, EA, E8, E6, E0, DD, D8, D4, D0, CC, C0, BA, B0, A8, A0, 98, 80, 60, 40. In order for a given generated baud rate to work, the error between the generated baud rate and the UART’s baud rate must be less than 3%.

To make the selection of crystal frequency easier, I developed a spreadsheet that can be used to determine which standard baud rate a particular crystal can operate under. You can simply plugin the crystal frequency you intend to use and the supported baud rates are automatically highlighted in green (see screenshot below).
ROM_LoaderBaudRate=  CrystalFrequency192*(256TimerReload)

Baud Rate, Crystal Frequency Calculation



This spreadsheet can be downloaded here:
baudratecalc.ods (OpenOffice)
baudratecalc.xls (Excel)

The crystal frequency I used is 21.7 Mhz which as you can see in the screenshot above supports most of the standard baud rates.


Start Serial Communication

I use PuTTY for the serial communication with the following parameters (note the speed must be one of the supported baud rate calculated above, it depends on the crystal you use). 

You can use gtkterm as well.

Serial line to connect to: /dev/ttyUSB0
Speed: 115200
Data bits: 8
Stop bits: 1
Parity: None
Flow control: None

And here’s a screen shot of DS89C430 in ROM loader mode:


DS89C430 ROM loader


Finally: Dumping ROM!

When the microcontroller is in ROM loader mode, programs can be uploaded using the ROM loader command interface mentioned in the user guide.

Be Sociable, Share!

No comments:

Post a Comment

Improved vacuum tube models for SPICE simulations

  Improved vacuum tube models for SPICE simulations from: https://www.i-t.com/blog/updating-norman-korens-tube-amplifier-design/improved-vac...