AirBorn ELECTRONICS PG2051 User manual

1PG2051
V1.01
ELECTRONICS
Suite 201, 19-21 Berry Street, P O Box 1491,
North Sydney, NSW 2060, Australia
Data/Fax (2) 9925-0297
Tel (2) 9925-0325
DISTINCTIVE CHARACTERISTICS
• Erases, Programs & Verifies 89C2051 & 89C1051
• 89C2051 Devices use FLASH program memory
- Can be reprogrammed 1000 times per chip
- 10ms electronic erasure, vs. 30 minute UV
• Programmer interface is PC serial compatible
- 9600 Baud, 8 data, 2 stop bits, no parity
- Accepts standard Intel Hex files
- Programs on the fly - during serial download
• Stand-alone test switch
-AllowschipoperatingtestwithoutPCdownload
- Tests for blank chip without PC download
-Reads &Verifies chipdata againstlast checksum
PG2051
89C2051/89C1051 Programmer - Fast serial download ELECTRONICS
Reissue: 17 October 2008
Indication
LEDs
DB9 Serial
Connector
Power
Supply
Test Switch
Pin 1 on
Device
Device
Socket
Dip Switch
ON DIP
1 2 3 4
PG2051 LAYOUT
• Green/Red Indicator LEDs
• Programs Security bits, if required
- Dipswitch selectable
• One Step program operation, as set by dipswitch
- Download starts Test/Erase/Program/Verify
• No special PC software required
• Fast operation - programs a chip in 6 seconds (typ)
• Powered by DC plug pack (supplied)
GENERAL DESCRIPTION
ThePG2051isadevelopmentprogrammerfortheATMEL
AT89C2051 (Referred to as the 89C2051) and the
AT89C1051. The PG2051 allows testing, erasure, pro-
gramming,verificationandsecurityprotectionof89C2051
devices. The programmer is fast, small and simple to use.
The Programmer may be connected to a PC or other host
by a serial cable. The data to be downloaded to the
programmer is transmitted in Intel Hex format. The
programmerwill erase& program,verify, writeprotect and
security protect as it receives the file, according to the
settings on its Dip switches.
The PG2051 can be used stand-alone by inserting an
89C2051 and pushing the Manual test switch, in this mode
itindicatesTested,BlankandVerifiedchecksumconditions.
In normal use device programming consists of:
• Insert an 89C2051 (Manual Test if desired)
• Download intel hex file (Causes programming)
• Watch LEDs (Indicatessuccessorfailure)
The speed of programming is limited by the speed of
download, and for a full 2 kilobyte file - the maximum
capacity of the 89C2051 - this will typically be 6 seconds.
Shorterprogramswillcompletemorequickly. ThePCserial
should be run at 9600 Baud, no parity, 8 data bits, 2 stop
bits - do not using other settings when downloading data.
The89C2051 shouldbe insertedinto theprogrammer with
pin 1 at the top left position of the socket.

ELECTRONICS
2PG2051
V1.01
The Pinout of the PG2051 Connector is:
Pin 1,4,6 Looped together DCD,DTR,DSR
Pin 2 TxD (Unused) RxD on PC
Pin 3 RxD on PG2051 TxD on PC
Pin 5 Ground Gnd on PC
Pin 7,8 Looped together RTS,CTSonPC
Pin 9 No connection RI on PC
For hosts other than a PC the only two connections that
mustbemadeareRxD(Pin3)andGround(Pin5). TxD(Pin
2) should be connected if possible for future upgradeability.
Signal level should be compliant with the EIA232 standard.
SERIAL PROTOCOL
Downloaded files should be Intel(tm) Hex format, Serial at
9600 Baud, 8 data bits, 2 stop bits, no parity. Ensure that
the full 8 bits and 2 stop bits is present in your configuration
of the PC serial port.
CARE & ENVIRONMENT
In common with most development programmers, the
PG2051 is supplied as a bare board with rubber feet.
Protect the unit from short circuit, liquid spills, impact,
humidity, and foreign matter.
HARDWARE
DC POWER SOURCE
The PG2051 programmer unit is supplied with a DC plug
pack power supply (Also called an AC adaptor). Use only
this DC plug pack with the unit to avoid damage to the
programmer. Thecurrentconsumptionoftheprogrammer
unit is less than 50ma, and the voltage of the DC power
supply under this small load is a nominal 16VDC, negative
to the centre pin of the 2.5mm DC power socket.
SERIAL CONNECTOR
The connector required for interface to the PG2051 pro-
grammer is a DB9 male. The cable required from a PC to
the PG2051 is DB9 female to DB9 male straight through -
meaning pin 1 of the first connector goes to pin 1 of the
second connector, pin 2 to pin 2 and so forth. If the PC
serial port has a DB25 connector, a DB25 to DB9 adaptor
will also be required. Cable length should not exceed 6m.
The DB9F-DB9M cable and the DB25-DB9 adaptor are
standard accessories available from PC hardware suppliers.
The PG2051 unit requires no handshaking signals, how-
ever many PC programs need correct assertion of hand-
shake signals before they will transmit. The PG2051 loops
back the PC handshake outputs so that the inputs are
correctly asserted.
HOST SOFTWARE
DEVELOPMENT SOFTWARE
The 89C2051 uses the 8051 instruction set and I/O - the
serial port, all timers, interrupts, registers and instructions
(including Long Jumps and Calls) are implemented. The
basic S/W difference is that the device has only 2k of
program memory, whereas a standard 8051 has 4k.
89C2051 software development can use standard 8051
assemblers, C compilers (in Tiny mode), and library code.
DOWNLOAD
On a PC, the data may be downloaded by any program that
can transmit data out through the COM port. From the
DOS prompt this can be performed using the copy com-
mand after the serial port is appropriately configured using
the mode command. The two commands are:
Mode COM1:9600,N,8,2
Copy Myfile.hex COM1
Where the source file name should replace "Myfile.hex",
and COM2 might need to be specified instead of COM1.
During the development process, a batch file is usually
executed to compile and/or assemble then link the code.
These two command lines can be appended to the end of
the batch file to automatically program a new device after
each assembly.
A final batch file might look like:
Tasm -51 example.asm example.hex
@echo Insert an 89C2051 into programmer
@pause
mode COM1:9600,N,8,2
copy example.hex COM1
Downloadcan alsobe achievedusing aterminal emulatorin
ASCII Transfer mode. A number of products will do this
satifactorily, including Telix and Windows Terminal. Using
one of these products to download can be a very useful way
tostart usingthe PG2051,when perhapsthe serialconnec-
tionisnot100%proven,oroneofanumberofdifferentfiles
may need to be downloaded.
DOWNLOAD DATA
More than one Intel Hex file may be transmitted to the
PG2051, as long as they follow in rapid succession - no
morethan asecond betweenfiles. For thisreason, multiple
files should be read from your hard disk, not a floppy drive.
The "Intel Hex terminator" is not required, and is ignored if
sent.
Download data should not have two values for the same
locationinmemory. Thiscausesthelocationtobeoverwrit-
ten - something that is usually not possible with PROM. A
Hexfilethatwritestothesamebytelocationtwicecancause
each programming attempt to fail - which is very confusing
to the operator, as it is normally a chip failure that causes
this. Thiscaution isneeded whenusing thePG2051 andall
other programming equipment using Hex files.
BINARY DATA
Most 8051 development software is capable of producing
Intel Hex files. To program a binary file using the PG2051
itis necessaryto translateit intoIntel Hexformat first,using
a utility such as the program BINTOHEX.

3PG2051
V1.01
ELECTRONICS
Suite 201, 19-21 Berry Street, P O Box 1491,
North Sydney, NSW 2060, Australia
Data/Fax (2) 9925-0297
Tel (2) 9925-0325
If LOCK is desired, WRITE PROTECT should be set ON as
well. Attempts to read from a secured device will return
"Blank" data, but the device will still execute. The security
setting may be overridden by erasing the 89C2051 device
and then reprogramming in entirety.
STANDARD SETTINGS: NORMAL OPERATION
The illustrated dipswitch settings are suitable for normal
operation - Download will cause Erase then Programming
of the 89C2051device. The device may be subsequently
verified.
STANDARD SETTINGS: SECURITY OPERATION
The illustrated dipswitch settings are suitable for security
operation - Download will cause Erase, programming, then
security bit locking. The device will be subsequently unread-
able.
WhenSECURITY OPERATION(as distinctfrom NORMAL
OPERATION) is selected for the PG2051, the 89C2051
VERIFICATION operation occurs prior to setting the lock
bits,so theLED STATUSINDICATIONS arecorrect forthe
programmingoperation. Furthermanualtestwillreturnthe
"Blank device" indication.
PG2051 OPERATION
POWER ON
At power on the PG2051 programmer unit indicates
operation by flashing the Red and Green indication LEDs
rapidly. The PG2051 changes to an idle-condition display
after a short period where the both indication LEDs are
illuminated at half brightness. From the idle condition the
PG2051 is ready for Manual test or download.
MANUAL TEST SWITCH
The PG2051 can be used stand-alone by inserting an
89C2051 and operating the Manual test switch, in this
mode the PG2051 Tests, Blank checks, and Verifies the
checksum.
The Test results are listed under LED STATUS INDICA-
TIONS. Themanual testswitch verifiesthe checksumof the
device against the checksum of the last PC download.
Secured devices - devices programmed and then locked by
setting the security bit - will read as blank when manually
tested.
DOWNLOAD AND PROGRAMMING
Downloading an Intel Hex file to the PG2051 triggers
89C2051TESTING andthen programming,as selectedby
the DIPSWITCH SETTINGS, then 89C2051 VERIFICA-
TION. By selecting the correct Dipswitch options, the
programming operation becomes automatic, and it is only
necessary to insert the device, download, and watch the
LEDs for the result.
89C2051 TESTING
The 89C2051 is tested when the manual test switch is
operated or when an Intel Hex download begins. The test
consists of powering up the chip and reading the device
signature. Ifavalidsignaturecannotbereadfromthedevice
then the BAD CHIP indication is shown (see LED STATUS
INDICATIONS). If a valid signature is read, the test is
passed.
89C2051 VERIFICATION
During Manual test and after programming, the 89C2051
data is verified by reading all bytes and comparing the
checksum with that of the last download. The result is
displayed on the LED STATUS INDICATORS.
1 2 3 4
ON DIP
Normal operation
Erase, Program on
(May be verified)
1 2 3 4
ON DIP
Security operation
Erase,Prog,Lock on
(Reads as 'Blank')
DIPSWITCH SETTINGS
There are four Dipswitches, each controlling a program-
ming function. There is a special case when all four
dipswitches are off. When all four dipswitches are off, no
erase program or security setting operation occurs during
the download, so the 89C2051 chip data is verified byte-
for-byte by comparison with the download data instead.
LEDs show the verify result.
Special download software outside the scope of this docu-
ment may temporarily override the dipswitch settings.
1. ERASE DIPSWITCH
When this dipswitch is ON, the 89C2051 will be erased
whenthestartofanIntelHexfileisrecievedbythePG2051.
This readies the 89C2051 for programming. If the ERASE
dipswitchis onand allothers areoff, thedevice iserased but
notprogrammedbythedownload. Whenerased,theentire
89C2051 FLASH program memory is set to hex value
0FFh.
2. PROGRAM DIPSWITCH
When this dipswitch is ON the 89C2051 will be pro-
grammed with the data in the Intel Hex file recieved by the
PG2051. Ifthe ERASEdipswitch isoff andthe PROGRAM
dipswitch is on, the device programming is attempted
without first erasing the device.
3. WRITE PROTECT DIPSWITCH
When this dipswitch is ON further programming of the
89C2051 FLASH memory is disabled, when the current
download to the PG2051 has completed. This setting may
be overridden by erasing the 89C2051 device and then
reprogramming in entirety.
4. LOCK AFTER PROGRAM DIPSWITCH
WhenboththeWRITEPROTECTandtheLOCKdipswitches
are ON, further programming of the 89C2051 FLASH
memory, and further verification of the 89C2051 FLASH
memory, is disabled when the current download to the
PG2051 has completed.

ELECTRONICS
4PG2051
V1.01
89C2051 TESTING Failed - the device signature inside the
89C2051 chip could not be read - implying that the
89C2051is notoperating, orthe PG2051socket isempty.
The 89C2051 TESTING was okay, but the data in the
device does not match the last download. The 89C2051 is
not programmed correctly.
Duringmanualtest,thisindicationmeansthatthechecksum
of the 89C2051 does not match the checksum of the last
download. Whenaspecialverifyoperationisperformed(All
Dipswitches off during download), this indication means
that the 89C2051 data did not completely match the
download data on a byte for byte compare.
The"failed Prog"indication canbe causedby achip thatwill
notprogramcorrectly,dataerrorsduringthedownload,and
attempting to program over already programmed bytes
without erasing - this can occur when attempting to write
two different values to the same program location, or when
attempting to program without erasing.
ELECTRONICS
Suite 501A, 220 Pacific Hwy, P O Box 1491,
North Sydney, NSW 2060, Australia
Ph (02) 9925 0325 Fax (02) 9922 4483
Original Copyright © 1995 AirBorn Electronics
LED STATUS INDICATION
Atpower-on thePG2051 programmerunit indicatesopera-
tion by flashing the Red and Green indication LEDs rapidly.
During the few seconds of download the Red and Green
indication LEDs will be active in response to the serial data
and programming operation.
Whenthe manualtest switchis operated,or aprogramming
operation has completed, the PG2051 indicates the condi-
tion of the 89C2051 device on the status LEDs.
LED STATUS INDICATION CONDITIONS
A short period after power on, or any operation, the
PG2051 changes back to an idle-condition display where
both indication LEDs are illuminated at half brightness.
The89C2051testscorrectlyandisblank. ABlank89C2051
has all bytes set to 0FFh. Secured devices will test as blank.
89C2051 VERIFICATION - the checksum matches. After
downloadthisindicationmeansthe89C2051datamatches
the data downloaded.
Red/Grn flash - Blank
Grn solid - Program Verified
Red/Grn on - Idle
Red solid - failed Prog,
or data didn't checksum
Red flash - Bad chip
GETTING STARTED
INSTALLATION AND TEST OF THE PG2051
•Connect the plug pack (refer to DC POWER SOURCE)
•Insert a new 89C2051 device (note correct orientation of
the chip - refer to PG2051 LAYOUT)
•Pressthemanualtestswitch(refertoMAN.TESTSWITCH)
•Observe LEDs (refer to LED STATUS INDICATION)
•LEDs should indicate a Blank device
ConnectserialcabletoPC,refertoSERIALCONNECTOR.
Download is normally accomplished as part of a "make"
batch file when assembling (refer to DOWNLOAD). How-
ever for test it is often more convenient to use a terminal
emulator - such as Telix or Windows Terminal.
Using a terminal emulator set to 9600,N,8,2 as specified
underSERIALPROTOCOL,transmitasinglecoloncharac-
ter - ":". If the connections to the PG2051 are correct, and
the character is transmitted by the PC COM port correctly,
the PG2051 will respond to the single colon character by
testing the 89C2051 in its socket.
If a terminal emulator is not available, a colon may be easily
transmittedfrom theDOS promptwith thecommand lines:
Mode com1:9600,N,8,2
Echo :>com1
COM2 may be used if required. This command works
withoutinterrupts,andalsofromaWindows"MSDOSbox".
If the PG2051 does not respond, some detective work will
berequired. Checktheterminalemulatorsettings,thecable
to the PG2051, the COM port itself, and interrupt settings
of both the COM port and other devices in the system (e.g.
network cards). Proprietry programs such as "CheckIt" and
devices such as RS232-LED testers may be helpful in
isolating the problem. An LED tester will show no signal
from the PG2051 - this is normal - COMs to the PG2051
is one way.
When the PG2051 responds to ":" the system is tested and
ready for use - set the Dipswitch to normal STANDARD
SETTINGS, download an Intel Hex file, and program!
Other AirBorn ELECTRONICS Motherboard manuals