Application Note. Microcontrollers. Using Keil FlashMon Emulator with AT89C51CC01/03 AT89C51CC01/ Summary. 2. Background overview

Similar documents
CAN Microcontrollers. Application Note. Migrating from T89C51CC01 to AT89C51CC03. Feature Comparison

Rad Hard FPGA. AT40KEL-DK Design Kit Content. Description. Kit Content. Reference Material. Support

CAN, 80C51, AVR, Microcontroller. Application Note

AT89ISP Programmer Cable Introduction AT89ISP Programmer Cable Parallel Port Settings Application Note AT89ISP Software AT89ISP Cable polarized

AT17F Series. Application Note. Programming Circuits for AT17F Series Configurators with Xilinx FPGAs. 1. Introduction

AT91 ARM Thumb Microcontrollers. Application Note. AT91 Host Flash Loader. 1. Package Contents. 2. Definition of Terms. 3.

AVR32 UC3 Software Framework... User Manual

8-bit Microcontroller. Application Note. AVR320: Software SPI Master

TSC695. Application Note. Annulled Cycle Management on the TSC695. References

AT17 Series FPGA. Configuration Memory. Application Note. In-System Programming Circuits for AT17 Series Configurators with Atmel and Xilinx FPGAs

Interfacing the internal serial EEPROM

Section 1 ATAVRAUTOEK1 Getting Started

8051 Microcontrollers. Application Note. Migration from AT89C5131 & AT89C5131A-L to AT89C5131A-M

AT89C5131 Starter Kit... Software User Guide

Application Note Microcontrollers. C Flash Drivers for T89C51RC/RB/IC2 and AT89C51RC/RB/IC2 for Keil Compilers

FPGA Configuration EEPROM Memory. Application Note. Programming Atmel s EEPROMs: AT17LV020(A) vs. AT17LV002(A) Introduction.

8-bit RISC Microcontroller. Application Note. AVR 305: Half Duplex Compact Software UART

Trusted Platform Module AT97SC3203S. SMBus Two-Wire Interface. Summary

SAM Boot Assistant (SAM-BA)... User Guide

8-bit Microcontroller. Application Note. AVR030: Getting Started with C for AVR

AT17(A) Series FPGA Configuration Memory. Application Note

AT89STK-10 Starter Kit... Hardware User Guide

MARC4. Application Note. Hints and Tips for Hard- and Software Developments with MARC4 Microcontrollers

8-bit Microcontroller. Application Note. AVR031: Getting Started with ImageCraft C for AVR

Migration From AT89C51SND1C to AT83C51SDN1C. Application Note. MP3 Microcontrollers

MP3 Player Reference Design Based on AT89C51SND1 Microcontroller... User Guide

AT89C51CC03 UART Bootloader

AT89STK-09 Starter Kit for AT83C26... User Guide

ATAVRAUTO User Guide

AT91 ARM Thumb Microcontrollers. Application Note. AT91M55800A Clock Switching Considerations using Advanced Power Management Controller.

T89C5115 UART Bootloader

8-bit RISC Microcontroller. Application Note. AVR151: Setup And Use of The SPI

System Designer. Programmable SLI AT94K/AT94S Series. Features. Description

T89C51AC2 UART Bootloader

System Designer. Programmable SLI AT94K/AT94S Series. Features. Description

80C51 MCUs T89C51AC2. Errata Sheet

AVR501: Replacing ATtiny15 with ATtiny25. 8-bit Microcontrollers. Application Note PRELIMINARY. Features. 1 Introduction

ATAVRAUTO User Guide

AT89C5122. Application Note. Preventing Windows XP from Displaying Unknown device Message at Startup

AT89C51SND1 UART Bootloader

FPGA Configurator Programming Kit (Enhanced) ATDH2200E. Features. Description

AT94K Series Field Programmable System Level Integrated Circuit. Application Note. FPSLIC Baud Rate Generator

32-bit Secure. AT91SC CT-USB Summary. Microcontrollers. Features

AVR1303: Use and configuration of IR communication module. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Programmable SLI AT40K AT40KAL AT94K. Application Note. Implementing a Single-coefficient Multiplier

Two-wire Serial EEPROM Smart Card Modules 128K (16,384 x 8) 256 (32,768 x 8) AT24C128SC AT24C256SC. Features. Description VCC NC

T89C51CC01 CAN Bootloader

a clock signal and a bi-directional data signal (SCL, SDA)

256K (32K x 8) 5-volt Only Flash Memory AT29C256

AT697E. Application Note. Checking AT697E Code for Occurrence of LDF/FPOPd Instructions Sequence with a dependency on an Odd-Numbered Register

AT85DVK-07 Demonstration Firmware... User s Manual

Two-Wire Serial EEPROM AT24C164 (1)

AVR32752: Using the AVR32 UC3 Static Memory Controller. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR based 125kHz RFID Evaluation Kit (Re)Programming Guide ATA2270-EK1. Overview. Fuse Settings: ISP Programming

GemCore Serial Lite PRO AT83C21GC. Summary

2-megabit (256K x 8) 5-volt Only Flash Memory AT29C020

AVR1315: Accessing the XMEGA EEPROM. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

256K (32K x 8) 5-volt Only Flash Memory AT29C256

8-bit Microcontroller. Application Note. AVR201: Using the AVR Hardware Multiplier

AT89C51CC03 UART Bootloader

4-megabit (512K x 8) 3-volt Only 256-byte Sector Flash Memory AT29LV040A

hex file. The example described in this application note is written for the AT94K using the FPSLIC Starter Kit. Creating a New Project

1-megabit (128K x 8) 5-volt Only Flash Memory AT29C010A

64K (8K x 8) High Speed Parallel EEPROM with Page Write and Software Data Protection AT28HC64BF

2-Wire Serial EEPROM AT24C01. Features. Description. Pin Configurations. 1K (128 x 8)

AVR1503: Xplain training - XMEGA Programmable Multi Interrupt Controller 8-bit Microcontrollers Application Note Prerequisites

DatasheetDirect.com. Visit to get your free datasheets. This datasheet has been downloaded by

Two-wire Serial EEPROM Smart Card Modules 1K (128 x 8) 2K (256 x 8) 4K (512 x 8) 8K (1024 x 8) 16K (2048 x 8)

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

256 (32K x 8) High-speed Parallel EEPROM AT28HC256N. Features. Description. Pin Configurations

8-megabyte, 4-megabyte, and 2-megabyte 2.7-volt Only DataFlash Cards AT45DCB008D AT45DCB004D AT45DCB002D. Not Recommended for New Design

512K (64K x 8) 5-volt Only Flash Memory AT49F512

T89C51CC02 CAN Bootloader

AVR32401: AVR32 AP7 Linux Interfacing DataFlash. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AT91 ARM Thumb Microcontrollers. Application Note. Using the ECC Controller on AT91SAM9260/9263 and AT91SAM7SE Microcontrollers. 1.

3-Wire Serial EEPROM AT93C46C

AT91SAM-ICE... User Guide

4-megabit (512K x 8) Single 2.7-volt Battery-Voltage Flash Memory AT49BV040A

2-wire Serial EEPROM AT24C21. 2-Wire, 1K Serial EEPROM. Features. Description. Not Recommended for New Designs. Pin Configurations.

AVR1922: Xplain Board Controller Firmware 8-bit Microcontrollers Application Note Features 1 Introduction

Flash Microcontrollers. Application Note. Migrating from AT89C2051/C4051 to AT89LP2052/LP4052

T89C51CC01 T89C51CC01UA T89C51CC01CA. Errata Sheet. CAN Microcontrollers

ARM7TDMI - based Microcontroller AT91RM3400. Errata Sheet

8-bit Microcontroller with 2K/4K/8K Bytes In-System Programmable Flash. Appendix A. Preliminary. ATtiny261 ATtiny461 ATtiny861 Automotive

TMEB8704 RFID Application Kit. Application Note. RFID Application Kit TMEB Introduction. 2. Getting Started. 2.1 Minimum System Requirements

1-megabit (64K x 16) 3-volt Only Flash Memory AT49BV1024A AT49LV1024A

AVR097: Migration between ATmega128 and ATmega1281/ATmega bit Microcontrollers. Application Note. Features. 1 Introduction

64K (8K x 8) Parallel EEPROM with Page Write and Software Data Protection AT28C64B. Features. Description. Pin Configurations

4-megabit (512K x 8) Flash Memory AT49BV040B

CryptoRF EEPROM Memory 8 Kbits

2-wire Serial EEPROM Smart Card Modules AT24C32SC AT24C64SC

2-megabit (256K x 8) 3-volt Only Flash Memory AT29LV020

Bluetooth General Information White Paper

AVR1501: Xplain training XMEGA Timer/Counter 8-bit Microcontrollers Application Note Prerequisites 1 Introduction

8-bit Microcontroller. Application Note. AVR032: Linker Command Files for the IAR ICCA90 Compiler

1-megabit (64K x 16) 3-volt Only Flash Memory AT49LV1024 AT49LV1025

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

DIP Top View VCC A12 A14 A13 A6 A5 A4 A3 A2 A1 A0 A8 A9 A11 A10 I/O7 I/O6 I/O0 I/O1 I/O2 I/O5 I/O4 I/O3 GND. TSOP Top View Type 1 A11 A9 A8 A13 A14

AT91 ARM Thumb-based Microcontroller. Application Note. AT91SAM7X and AT91SAM7XC Microcontroller Series Schematic Check List. 1.

4-megabit (512K x 8) 5-volt Only 256-byte Sector Flash Memory AT29C040A

Transcription:

Using Keil FlashMon Emulator with AT89C51CC01/03 1. Summary Atmel AT89C51CC01/03 are Flash microcontrollers. Keil developed an OnChip Debug for these microntrollers taking advantage of the flash byte programming of these microcontrollers. FlashMon is integrated in Keil µvision IDE. It is using the upper 4Kbytes of the program space, the internal UART as well as one timer (usually timer1) AT89C51CC01/03 Microcontrollers Application Note 2. Background overview Developers using Keil µvision IDE and the AT89C51CC01 or AT89C51CC03 microcontrollers can now do OnChip debug as easily as they are using the µvision IDE simulator. This offers an alternative to the use of full fledge emulators when complex trace capabilities are not required. With a simple evaluation board such as Atmel AT89STK-06 fitted with an T89C51CC01 or AT89C51CC03, CAN software developers using Keil µvision IDE can test their program directly from µvision IDE.

3. µvision IDE FlashMon FlashMon is integrated in the µvision IDE programming suite. It can be found in the folder KEIL\C51\FlashMon. All Atmel C51 microcontrollers using a Flash technology allowing single byte programming are supported with a specific folder for each and every one. This includes AT89C51CC03 and T89C51CC01. This technical note is based on µvision IDE V2.40A. Users with an older version of µvision IDE should verify if FlashMon works as indicated in this technical note, otherwise they should update their µvision IDE. The user shall start the Monitor.UV2 project from the FlashMon selected microcontroller sub folder. Options should be selected as illustrated below, the project re-built then the Monitor.HEX file must be programmed in the microcontroller using Atmel FLIP In System Programming tool. Once done, the user can open his application project and select the Keil Monitor debug option. He can then re-built his project, then start the debug session. At start, the application project will be loaded into the microcontroller directly by µvision (no need to use Atmel FLIP). Then the OnChip debugging can start. 4. T89C51CC01 The T89C51CC01 CAN microcontrollers The T89C51CC01 memory map is illustrated by the following figure. Figure 4-1. T89C51CC01 Memory Map when using FlashMon. FlashMonitor Flash User 7FFFh 7000h UART bootloader FFFFh F800h XRAM 3FFh 0000h 0000h IRAM IRAM is used by the Monitor but has not to be reserved by the user application. 256 bytes of XRAM above 0700h are used by the monitor. The Flash is bytes programmable and page programmable, although as indicated in the T89C51CC01 erratasheet, The maximum number of bytes to be loaded in the Flash in one flash page is 16. This limitation is dealt with by the Monitor and is transparent to the user. The Monitor use the flash library included in the Atmel UART bootloader. Consequently only T89C51CC01UA part number should be used. User willing to use the CAN bootloader should use the UART bootloader samples for development and debug using FlashMon, and migrate to the CAN bootloader (T89C51CC01CA Part Number) afterward. 2

5. Getting Started with FlashMon when using T89C51CC01 This chapter will guide the user in setting-up then starting FlashMon with the T89C51CC01 CAN microcontroller. 5.1 FlashMon program and parameters 5.2 Constraint in the User Program The CONFIG.INC file in the project is used to configure the proper parameters for FlashMon. Only a limited number of parameters are to be configured by the user. SERIAL: This parameter select Onchip UART with Timer1 as Baud rate generator (SERIAL EQU 0) or Timer2 as Baud Rate generator (SERIAL EQU 1). The external UART mode should not be used. CPU_CLOCK: the system CPU clock should be entered (ex CPU_CLOCK EQU 20000000 for 20MHz) CPU_X2: CPU_X2 EQU 0 for 12 clocks per cycle. CPU_X2 EQU 1 for 6 clocks per cycle. Notice the default mode for T89C51CC01 is 12 clocks per cycle. _A0: select _A0 EQU 0 for normal mode and _A0 EQU 1 for ALE disable. All other parameters should be left unchanged. The Monitor program have an Automatic Baud Rate Detection (Autobaud) with the parameter BAUDRATE EQU 0. Select rebuild all target files, then program the Monitor.HEX file generated into the T89C51CC01 using FLIP. The Monitor.HEX file start at address 7000h. The user shall not use the Timer1 if this timer is selected for the Monitor UART Baud Rate Generator. This leaves the more versatile Timer2 for the application. PCA modules can also be used as timers. The UART interrupt should always remain enabled. 5.3 Programming the Monitor Program with FLIP Flip should be used to program the Monitor.HEX file into the T89C51CC01. The SBV (Software Boot Vector) should be programmed at 70. The BLJB bit should be selected (BLJB=0) With the above setting, after each reset the T89C51CC01 will execute the bootloader and with SBV = 70, It will start the execution of the Monitor Program starting at 7000h. See below the FLIP configuration (example using FLIP 2.4.4) 3

Figure 5-1. FLIP programming 5.4 Selecting the right target debug option in the Application Project In the Target Debug option, the Keil Monitor-51 should be used as illustrated below. 4

Figure 5-2. Project target Debug Options 5.5 Starting a Debug Session with FlashMon The following screens illustrate the debug using FlashMon For the example, we have selected the CAN generator program available from the Atmel web site. Please notice we have added the instruction enable UART Interrupt as illustrated below. It is recommended to do a Power off / Power on sequence on the target board before starting a debug section. Note: FlashMon is not subject to the DELL Laptop RS232 initialization problem provided the above Power Off / Power On sequence ran before starting a debug section. Note: Flashmon has been successfully tested on a Laptop with RS232interface and on a Laptop with no RS232 interface. A Prolific USB to RS232 interface was used for this test. After selecting the debug tab, end clicking on start debug, FlashMon will download the user program. A progress bar on the bottom of the screen will be available. 5

Figure 5-3. Loading the User program The debug session is now ready. 5.6 Trouble-shouting if FlashMon fails to connect the target with the PC If the PC cannot connect the target the following message will appear. 6

Figure 5-4. FlashMon connection error message It is recommended to click on Settings Figure 5-5. FlashMon Serial Port setting The Comm Port should correspond to the Serial Port Comm port. If an USB to RS232 adapter is used, the user shall verify in the Windows Control Panel which Comm Port has been assigned to the adapter. This is the port number that should be entered in the Target Setup. µvision IDE Comm Port drop down menu offers COM1 to COM8 options. If the USB to RS232 adapter has been assigned a Comm Port number higher that COM8, it is necessary to go to the Windows Control Panel and manually assign a Comm Port acceptable for µvision. (go to Comm 7

Port Properties then Port Parameters then click on Advance Tab and select a free Comm Port Number between 1 and 8) 5.7 Debugging a program with FlashMon Now that the debug session is ready, let s insert a breakpoint at the scheduler initialization program line and click on RUN The figure below shows the result after the execution Figure 5-6. Program stopped at the scheduler initialization break point We can continue step by step. The following screen show the execution of the task6 initialization after a couple of steps have been executed. 8

Figure 5-7. Step by Step execution 6. Conclusion 6.1 AT89C51CC03 We have demonstrated the use of the FlashMon Keil Monitor on the T89C51CC01. We have shown how to configure FlashMon, How to program it at the right place and the right options in the T89C51CC01 using Atmel FLIP. Then we have shown how to configure a Keil Project to use FlashMon as the debug mode. Finally we have shown how to insert break points, run to the break point and run step by step using FlashMon. FlashMon can also be used with AT89C51CC03 provided AT89C51CC03 with UART bootloader are used. The monitor program starts at E000h. With FLIP, the SBV (Software Boot Vector) should be programmed at E0h. 9

Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimshatsui East Kowloon Hong Kong Tel: (852) 2721-9778 Fax: (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan Tel: (81) 3-3523-3551 Fax: (81) 3-3523-7581 Atmel Operations Memory 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 Microcontrollers 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 La Chantrerie BP 70602 44306 Nantes Cedex 3, France Tel: (33) 2-40-18-18-18 Fax: (33) 2-40-18-19-60 ASIC/ASSP/Smart Cards Zone Industrielle 13106 Rousset Cedex, France Tel: (33) 4-42-53-60-00 Fax: (33) 4-42-53-60-01 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535 74025 Heilbronn, Germany Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France Tel: (33) 4-76-58-30-00 Fax: (33) 4-76-58-34-80 Literature Requests www.atmel.com/literature Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Atmel Corporation 2006. All rights reserved. Atmel, logo and combinations thereof, Everywhere You Are and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Windows is a registered trademark of Microsoft Corporation. Other terms and product names may be trademarks of others. Printed on recycled paper.