Features
•
Protocol
– UART Used as a Physical Layer
– Based on the Intel Hex-type Records
– Autobaud
•
In-System Programming
– Read/Write Flash and EEPROM Memories
– Read Device ID
– Full-chip Erase
– Read/Write Configuration Bytes
– Security Setting From ISP Command
– Remote Application Start Command
•
In-Application Programming/Self-Programming
– Read/Write Flash and EEPROM Memories
– Read Device ID
– Block Erase
– Read/Write Configuration Bytes
– Bootloader Start
80C51
Microcontrollers
Description
This document describes the UART bootloader functionalities as well as the serial
protocol to efficiently perform operations on the on chip Flash (EEPROM) memories.
Additional information on the A/T89C51AC2 product can be found in the
A/T89C51AC2 datasheet and the A/T89C51AC2 errata sheet available on the Atmel
web site, www.atmel.com.
The bootloader software package (source code and binary) currently used for produc-
tion is also available from the Atmel web site.
AT89C51AC2
T89C51AC2
UART
Bootloader
Bootloader Revision
Revision 1.2.0
Revisions 1.4.0 and higher
Purpose of Modifications
First release
New command supported
- EEPROM access
- Start application
- Extra Byte access
- 128 bytes page Flash programming
- New boot process
Date
23/04/2001
02/11/2001
Rev. 4231C–CAN–03/05
1
Functional
Description
In-System Programming
Capability
The A/T89C51AC2 Bootloader facilitates In-System Programming and In-Application
Programming.
In-System Programming (ISP) allows the user to program or reprogram a microcontrol-
ler’s on-chip Flash memory without removing it from the system and without the need of
a pre-programmed application.
The UART bootloader can manage a communication with a host through the serial net-
work. It can also access and perform requested operations on the on-chip Flash
memory.
In-Application
Programming or Self-
programming Capability
In-Application Programming (IAP) allows the reprogramming of the microcontroller on-
chip Flash memory without removing it from the system and while the embedded appli-
cation is running.
The UART bootloader contains some Application Programming Interface routines
named API routines allowing IAP by using the user’s firmware.
Block Diagram
This section describes the different parts of the bootloader. The figure below shows the
on-chip bootloader and IAP processes.
Figure 1.
Bootloader Process Description
On-chip
User
Application
External Host Via the
UART Protocol
Communication
ISP Communication
Management
IAP
User Call
Management
Flash Memory
Management
Flash
Memory
2
A/T89C51AC2 UART Bootloader
4231C–CAN–03/05
A/T89C51AC2 UART Bootloader
ISP Communication
Management
The purpose of this process is to manage the communication and its protocol between
the on-chip bootloader and an external device (host). The on-chip bootloader imple-
ments a Serial protocol (see Section “Protocol”, page 9). This process translates serial
communication frames (UART) into Flash memory accesses (read, write, erase...).
Several Application Program Interface (API) calls are available to the application pro-
gram to selectively erase and program Flash pages. All calls are made through a
common interface (API calls) included in the bootloader. The purpose of this process is
to translate the application request into internal Flash memory operations.
This process manages low level access to the Flash memory (performs read and write
accesses).
User Call Management
Flash Memory Management
Bootloader Configuration
Configuration and
Manufacturer Information
The following table lists Configuration and Manufacturer byte information used by the
bootloader. This information can be accessed through a set of API or ISP commands.
Mnemonic
BSB
SBV
SSB
EB
Manufacturer
ID1: Family Code
ID2: Product Name
ID3: Product Revision
Description
Boot Status Byte
Software Boot Vector
Software Security Byte
Extra Byte
Default Value
FFh
FCh
FFh
FFh
58h
D7h
BBh
FFh
3
4231C–CAN–03/05
Mapping and Default Value of
Hardware Security Byte
The 4 Most Significant Byte (MSB) of the Hardware Byte can be read/written by soft-
ware (this area is called Fuse bits). The 4 Least Significant Byte (LSB) can only be read
by software and written by hardware in parallel mode (with parallel programmer
devices).
Bit Position
7
6
5
4
3
2
1
0
Mnemonic
X2B
BLJB
Reserved
Reserved
Reserved
LB2
LB1
LB0
Default Value Description
U
P
U
U
U
P
U
U
To lock the chip (see datasheet)
To start in x1 mode
To map the boot area in code area between F800h-FFFFh
Note:
U: Unprogram = 1
P: Program = 0
Security
The bootloader has Software Security Byte (SSB) to protect itself from user access or
ISP access.
The Software Security Byte (SSB) protects from ISP accesses. The command ’Program
Software Security Bit’ can only write a higher priority level. There are three levels of
security:
•
level 0:
NO_SECURITY
(FFh)
This is the default level.
From level 0, one can write level 1 or level 2.
level 1:
WRITE_SECURITY
(FEh)
In this level it is impossible to write in the Flash memory, BSB and SBV.
The Bootloader returns an error message.
From level 1, one can write only level 2.
level 2:
RD_WR_SECURITY
(FCh)
Level 2 forbids all read and write accesses to/from the Flash memory.
The Bootloader returns an error message.
•
•
Only a full chip erase command can reset the software security bits.
Level 0
Flash/EEPROM
Fuse bit
BSB & SBV & EB
SSB
Manufacturer info
Bootloader info
Erase block
Full chip erase
Blank Check
Any access allowed
Any access allowed
Any access allowed
Any access allowed
Read only access allowed
Read only access allowed
Allowed
Allowed
Allowed
Level 1
Read only access allowed
Read only access allowed
Read only access allowed
Write level2 allowed
Read only access allowed
Read only access allowed
Not allowed
Allowed
Allowed
Level 2
All access not allowed
All access not allowed
All access not allowed
Read only access allowed
Read only access allowed
Read only access allowed
Not allowed
Allowed
Allowed
4
A/T89C51AC2 UART Bootloader
4231C–CAN–03/05
A/T89C51AC2 UART Bootloader
Software Boot Vector
The Software Boot Vector (SBV) forces the execution of a user bootloader starting at
address [SBV]00h in the application area (FM0).
The way to start this user bootloader is described in the section “Boot Process”.
Figure 2.
Software Boot Vector
UART Bootloader
User Bootloader
Application
[SBV]00h
FM1
FM0
FLIP Software Program
FLIP is a PC software program running under Windows
®
9x//2000/XP, Windows NT
®
and LINUX
®
that supports all Atmel Flash microcontroller.
This fsoftware program is available free of charge from the Atmel web site.
5
4231C–CAN–03/05