AT89STK 06 Software Demonstration CAN
AT89STK 06 Software Demonstration CAN
AT89STK 06 Software Demonstration CAN
.............................................................................................
Section 2
Getting Started...................................................................................... 2-3
2.1 Hardware Requirements ...........................................................................2-3
2.2 Software Requirements.............................................................................2-3
2.3 FLIP Software ...........................................................................................2-3
Section 3
Software Demonstrations ..................................................................... 3-5
3.1 UART Bootloader Demonstration Setup ...................................................3-5
3.2 Using FLIP ................................................................................................3-6
3.3 CAN Bootloader Demonstration Setup ...................................................3-11
3.4 CAN Bootloader Demonstration Program ...............................................3-13
3.5 ADC Demonstration ................................................................................3-15
Section 4
Conclusion .......................................................................................... 4-17
4.1 Conclusion ..............................................................................................4-17
The purpose of this section is to acquaint the user with the Atmel CAN Demo Board, the
In-System Programming tool (FLIP), the 2 demonstration programs: CAN Generator
and CAN Monitor, and finally with the 2 bootloaders (CAN and UART).
The purpose of this section is to acquaint the user with the Atmel CAN Demo Board, the
In-System Programming tool (FLIP), the 2 demonstration programs: CAN Generator
and CAN Monitor, and finally with the 2 bootloaders (CAN and UART).
2.1 Hardware CAN Demo board plus either a Second AT89STK-06 (1) and/or a CAN Dongle(1)
Requirements (IXXAT, PCAN, CANCARDX, CANPARI, or RMCANVIEW)
RS-232 Serial Cable (DB9/DB9 Male/Female)
Serial Cable DB9/DB9 Female/Female(1)
AT89C51CC03U-SLIM or AT89C51CC03U-SLSIM
AT89C51CC03C-S3SIM
Note: 1. Not included in CAN Demo Board kit.
2.2 Software Several demonstration programs can be found in the accompanying CD-ROM
Requirements CAN generator UART bootloader demonstration program (HEX file)
CAN monitor UART bootloader demonstration program (HEX file)
CAN generator CAN bootloader demonstration program (HEX file)
CAN monitor CAN bootloader demonstration program (HEX file)
CAN Dongle program (HEX file)
A self training package is also available on the CAN CD-ROM. It introduces CAN bit
timing as welll as the CAN Software Library.
2.3 FLIP Software FLIP software runs on Windows 98®, ME®, XP ®, Windows NT® and Windows 2000 ®.
FLIP supports In-system programming of Flash C51 devices through RS-232 and CAN
(with a dongle). The latest version of FLIP software can be found on the Atmel web site.
The CAN CD-ROM includes a copy of FLIP 2.2.4. The following figures were assembled
with Flip 2.2.4.
A Linux version of FLIP is also available.
3.1 UART The first demonstration (UART Bootloader) will use a PC running FLIP software to pro-
Bootloader gram a CAN Demo board through an RS-232 cable as illustrated in Figure 3-1.
Demonstration
Setup
RS-232 6~15V DC
Serial Cable Power Supply
PC running FLIP
3.1.2 Setting the CAN microcontrollers come pre-programmed to start in Bootloader mode at first power-
Hardware Condition up. In the first ISP demonstration, the user will need to program the sample microcon-
troller set to boot in bootloader mode.
To enter in ISP mode with hardware conditions, press both the RESET (SW5) and ISP
(SW4) buttons simultaneously. First release the RESET button and then the ISP button.
3.2 Using FLIP In this section the user will program the AT89C51CC03UA-SLSIM microcontroller
through the UART Bootloader using FLIP software. The following procedure will guide
you through the programming of the demonstration program.
1. Run FLIP software.
2. From the Device Menu, choose Select and select the device (AT89C51CC03)
that is connected on the AT89STK-06.
3. From the “Settings” menu, select “Communication” and “RS232”. The following
pop-up window appears and allows to select the COM port settings and Baud
Rate.
4. Initialize the communication by selecting the ‘Connect’ button in the RS-232 pop-
up window.
If the connection is successful, the FLIP window should look like Figure 3-5.
Detailed explanations of the significance of the fields can be found in the product
datasheet on the Atmel site www.atmel.com
5. In the File menu, select ‘Load HEX’ and choose the demonstration program
‘can_gen.hex’. This is the program that performs the demonstration data
exchange.
The message ‘HEX file can_gen.hex loading done’ is displayed at the bottom of
the FLIP window.
6. Ensure the following check boxes are selected in the Operations Flow section of
FLIP:
- Erase
- Blank Check
- Program
- Verify
These are the operations that will be performed on the microcontroller.
7. Press the ‘Run’ button. Programming is executed.
The “Memory Verify Pass” message confirms programming is successful and
that the microcontroller has been programmed.
8. Unchecked the BLJB box in order to execute the demonstration program after
the next reset.
9. Ensure the ‘Reset’ box is checked, then press the ‘Start Application’ button.
It is possible to connect a CAN monitoring device such as a CANALYZER or equivalent
on the CAN DB9 connector to verify that the messages are transmitted on the CAN Bus.
To view the CAN messages transmission, the AT89STK-06 can also be connected to a
standard RS232 terminal (like Hyperterminal).
The Hyperterminal should be configured as presented in the following figure.
3.2.1 CAN Monitor Using a method similar to that discussed in the demonstration program above, it is pos-
Demonstration sible to program the Monitor Demonstration ‘can_mon.hex’. The Monitor Demonstration
Program displays the content of any incoming messages on a RS232 Terminal (9600 bauds).
For users with two CAN Demo boards, it is possible to program the CAN generator dem-
o nstra tion ‘ca n_ge n.hex’ o n one b oard a nd the CAN Monitor demon stratio n
‘mon_boot_can.hex’ on the other. The connection is made using a CAN DB9/DB9
Male/Male cable.
RS-232
Serial Cable
6~15V DC
PC running FLIP Power Supply
CAN BUS
6~15V DC
Power Supply
3.3.1 Hardware 1. Connect a C51 Demo board and a CAN Demo board.
Connections 2. Connect a 9 volts DC power supply.
3. Ensure a AT89C51CC03CA-SLSIM microcontroller is connected to the CAN
board.
4. Connect the RS-232 cable to your PC and to the DB9 female port on the C51
demo board.
5. Connect the CAN bus to the Atmel Dongle on both CAN boards. See Figure 3-9.
3.3.2 Programming Using This section allows you to program the AT89C51CC03 microcontroller using FLIP
FLIP software.
1. Run FLIP.
2. From the Device Menu, choose ‘Select’ and select the device (AT89C51CC03)
that is connected on your demo board.
3. From the ‘Settings’ menu, select ‘Communications’ then ‘RS-232’. Click
‘Connect’.
4. In the File menu, select ‘Load HEX’ and choose the demonstration program
‘Atmel_dongle.hex’.
The message ‘HEX file Atmel_dongle.hex loading done’ is displayed at the bot-
tom of the FLIP window.
5. Ensure the following check boxes are selected in the Operations Flow section of
FLIP:
- Erase
- Blank Check
- Program
- Verify
These are the operations that will be performed on the microcontroller.
6. Ensure the BLJB box is unchecked, in order to boot the demonstration program
after the next reset.
7. Ensure the ‘Reset’ box is checked, then press the ‘Start Application’ button.
The UART displays the CAN messages that the program generates.
3.4 CAN Bootloader The following procedure will guide you through the execution of the demonstration
Demonstration program.
Program 1. From the FLIP window, click ‘Device’ and select ‘AT89C51CC03’.
2. From the ‘Settings’ menu select ‘Communication’ –> ‘CAN’ and choose the type
of Dongle you are using. (See FLIP user’s manual)
The CAN bootloader starts autobaud, and once it is ready, acknowledges the
message to FLIP to indicate that the communication is established.
The default CRIS is 00. It is possible to set a different area for the 7 consecutive
CAN message identifiers. FLIP and the CAN microcontroller must use the same
CRIS to communicate.
4. From the ‘File’ menu, select ‘Load HEX’ and select the ‘can_gen.hex’ file.
5. Click ‘Run’ on the FLIP window. The CAN Generator program is successfully
programmed. We will now program NNB and CRIS to different values.
6. Click the ‘’Set CAN Node’ tab. The CAN Node Configuration dialog is displayed.
7. Change the Node setting to ‘0F’ and CRIS to ‘08’. The BTC (Bit Timing Regis-
ters) settings remain unchanged. The NNB and CRIS settings are changed in
order to give a unique number to the controller and to adapt it to Message Identi-
fier mapping.
8. Click ‘Set’ to program the settings, then click ‘Read’ to verify that programming
was successful.
9. Ensure the ‘Reset’ check box is selected.
10. Click ’Start Application’.
The microcontroller has been successfully programmed. The generaor program
will run (send CAN messages and display on the UART). The chip will now
accept In-System Programming when ‘NNB = FF’ (default) or ‘0F’, and only with
‘CRIS = 08’.
3.5 ADC The purpose of this section is to demonstrate the basic funtionnality of the ADC module
Demonstration of the CAN microcontrollers.
Using the method similar to that discussed in the section above, it is possible to program
the ADC Demonstration ‘adc.hex’.
The demonstration software acquires an analog input voltage from the potentiometer
and displays the converted value to the The UART displays the content of any incoming
messages on a RS232 Terminal (9600 bauds for XTAL frequency at 12MHz).
4.1 Conclusion We have successfully run 2 demonstration programs on the AT89C51CC03U with
UART bootloader and 2 demonstration programs on the AT89C51CC03C with CAN
bootloader. In the CAN bootloader demonstrations we also modified the NNB and CRIS
in order to assign a unique number to the controller and adapt it to a Message Identifier
mapping.
Using AT89C51CC03U with UART bootloader and AT89C51CC03C with CAN boot-
loader, the same demonstration programs can be run on T89C51CC01. This illustrates
the full compatibility between AT89C51CC03 and T89C51CC01.
e-mail
[email protected]
Web Site
http://www.atmel.com
Disclaimer: Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard
warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any
errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and
does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are
granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use
as critical components in life support devices or systems.
© Atmel Corporation 2004. All rights reserved. ATMEL ®, logo and combinations thereof, are registered trademarks, and Everywhere You
Are sm are the trademarks of Atmel Corporation or it subsidiaries. Other terms and product names may be the trademarks of others.
4356A–CAN–09/04 /xM