Home
AT89OCD-01 User Guide
Contents
1. ccccececcceeeeecceeeeeeeeeeeeseeeeeesaeees 2 5 2 1 PROF O CIS SINC S sereisas nenne EAE aK REEE ETEEN EEEN 2 5 Section 3 Configuring the ATOCD51 emulator ccccccecceecseeceeeseeeeesaeeeessaeeeees 3 8 3 1 Connector definition and target CONNECTION cceeeeeeeeeeeeeeeeeeeeeeeeeees 3 8 3 4 Configuring ATOCD51 emulator under KEIL uvision cccceceeeeeees 3 11 3 5 Launching an AT89OCD 01 debug session under KEIL pvision 3 16 3 6 Working within an AT89OCD 01 debug session under KEIL uvision 3 18 Section 4 PMC FIG sstas axa asisenster cane ssttsnakGaneatnaatsouines cagtasatie naeubaanetatetatsamhaneanteisenionoass 4 23 Section 5 NEW TS OMICS se tec cto cesta ana scene pecs ate EEEE 5 24 Section 6 Features Not Yet Implemented ccccccccsseeceeeceseeceeeeeeeeeneeeenees 6 25 Section 7 Troubleshooting Guide ccccccccceseceeceeeeeceeeeeeceeseesaeeeeesuaeeeeseaeeeseas 7 26 Section 8 Technical Specifications cccccccccsseececseeeeseeeeeeeeeeeeeseeeeeeseeeeeseeeeeeas 8 29 Section 9 Technical o PPO aea E E E 9 30 3 7688C 8051 08 07 2 AMEL AT890CD 01 User Guide 7688C 8051 08 07
2. Check target connections See section 3 1 Connector definition and target connection Target is not powered on Power the target and check again that green LED is blinking and orange LED is ON 7 27 7688C 8051 09 06 Troubleshooting Guide Problem Reason Solution Target is not or incorrectly connected to the ATOCD51 emulator system Check target connections See section 3 1 Connector definition and target connection Target is connected but hot unplugged has been done Close uvision session unplug and plug again the ATOCD51 emulator system cycle power on target No crystal on the target board Add crystal on target board No power on the target board Power on the target board OCD system drives the reset pin of the target to enter into OCD mode In case of secured target locked bit set the OCD system can not connected to the target A full chip erase must be performed to enable any debug session OCD systems then drives PSEN pin to enter into product bootloader AT89C51RE2 to make this full chip erase Make sure the reset circuitry will not disturb the control of target s reset pin Target is not answering when starting a debug session Make sure no specific circuitry on PSEN can disturb the control of target s PSEN pin Target is connected but hot unplugged has been done Close uvision session unplug and plug again the ATOCD51 emulator system cycle power on targ
3. Ta 2 zma PENT2053 Atmel DFU Sg ATSICS1S0 4789C5151 w Batteries 4 Computer a0 Disk drives ie F 11 Then execute the batch file Update_Firmware bat from the KEIL C51 AtmelUsbOcd directory C Weil C51 AtmelUsbOcd File Edit View Favorites Tools Help sack 5 a po Search E Fers i Address O C Keil C51atmellsbOcd vii Folders O Documents and Settings ar ae Log File Type Tm flexlm P P 7 EE 5 Keil E Col Flip log Ick om ASM m OO Atmelsbocd C BIN o Frow_verd Ext a Cys Text Document i Examples 1 KE FlashMon wr e ne mw vere by hip 7 Text Document INC 1 KE C 5051 LIB g license rtf 9 Mons1 Rich Text Format 11 KB Monso E C RtxTiny2 TROUBLE SHOOTING txt Ls Text Document Mentorsraphics 1 KB fm MS0Cache Update Firriware bat 9 MSSQL 45 DOS Batch File C oracle be 1 KB 9 OrCAD iis O OrcAD Data A usbser sys r System file FADS Projects KE It will run batchisp exe command line executable file in a command window to update the firmware of the Atmel OCD system 10 38 Alm L AT890CD 01 User Guide T 7688C 8051 09 06 Appendix A ATMEL FLIP Command Line Interpreter C Keil C51 Atme UshbOcd gt batchisp exe device ATS9C51351 hardware USE operatio n MEMORY FLASH onfail abort loadbuffer atocdS5iv2 dat ERASE F PROGRAM WSBU OH TART RESET Running batchisp 1 1 6 on Mo
4. AT89C51 C AT89C5131 bins ATB9C51CC03 ee ATBICSIED2 C ATBSC51ID2 C ATBSCSIRC I Use Extended Linker LX51 instead of BL51 F Use Extended Assembler AX51 instead of 457 Cancel Defaults If the device is not listed in your KEIL uvision release select another Atmel MCU AT89C51RD2 ED2 for AT89C51RE2 and AT89C51SND1 for AT85C51SND3x ATMEL D AT890CD 01 User Guide ey 2 7688C 8051 09 06 Configuring the ATOCD51 emulator E To download the application code into the target use the Load button ya This loader has to be configured in the KEIL uvision interface For AT89C51xE2 products the loader is based on batchisp exe the command line program delivered with Atmel FLIP software First select the options for target in the KEIL pvision interface On the Utilities tab choose external tool for Flash programming and type pbatchisp exe Depending of FLIP Batchisp release you have either to browse the installation folder of the FLIP Batchisp software or only type batchisp exe if the path is known Add in the parameter field the following configuration Options for Target Target 1 Device Target Output Listing C51 A51 LX51 Locate LX51 Misc Debug Utilities Configure Flash Menu Command f Use Target Driver for Flash Programming Fal et E Init File SS __ a f Use External Tool for Flash Programming Command C Program Files 4 TMELSFLIP 3
5. for this hardware as Select the manufacturer and model of Your hardware device and then click Nest IF you have a disk that contains the diver you want to install click Have Disk Show compatible hardware Model 48789051 30 4 T 895131 iy This driver is not digitally signed Tell me why diver signing is important 10 36 A MEL AT890CD 01 User Guide T 7688C 8051 09 06 Appendix A 9 Click the Browse button to navigate to the Flip usb folder it contains the INF file Click the OK button The pathname displayed here comes from our test machine the actual pathname is the one of the Flip package you have installed Install From Disk Insert the manufacturer s ingtallation disk and then make sure that the corect drive is selected below Copy manufacturer s files from C Program Files v4trelSFlip 3 2 0 usb z l Browse J 10 Click Finish Found New Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software for z AT 895130741895131 Click Finish to close the wizard AT890CD 01 User Guide AIMEL 10 37 7688C 8051 09 06 Appendix A The Device Manager updates and shows the Atmel device in the section Atmel DFU Please note that you may find your device under a section named LibUSB Win32 Devices instead of the Atmel DFU one Device Manager File Action View Help
6. nae and game controllers l A MEL 3 9 7688C 8051 09 06 Configuring the ATOCD51 emulator 3 4 Configuring ATOCD51 emulator under KEIL pvision E When creating or launching a project on KEIL uVision the project environment looks like the following Load code Project Start stop into product settings debug session Hi d x pYisionz SAMQsae oclj en 2nnm m t S ax Target 1 Target 1 1S m a al n A E Source Group 1 THC DETR El main c JC Pdata us compiler h HOV RO A a Back SJIMP Common By BS pene PDa tea MOVE TRI A Common H schedule c H uart drv H led_task c void task_ 2_init woid E e ed drw T l 4 io_task c state_xe X2_IHIT E interrupt c t Startup a51 Init a51 nE oe demo_x2_task R task ou task x2 demo PE et ae a an A ea aN ee ee Tent sataa 3 10 AIMEL AT890CD 01 User Guide 7688C 8051 09 06 Configuring the ATOCD51 emulator m First select the project settings and choose the appropriate ATMEL MCU in the device list Options for Target Target 1 3 2 x Device Target Output Listing c51 A51 BL51 Locate BL51 Misc Debug Utiities Database Generic CPU Data Base Vendor Atmel Device ATS9C51SND1 Family MCS 51 fd 4T89C1051 8051 Microcontroller with MPEG I ll Layer 3 Hardwired Decoder ja AT89C1051U C ATB9C2051 C AT89C4051 2 16 bit Timers WDT UART SPI C
7. software installation folder e g most of the time C Program Files Atmel FLIP x y z and select in usb directory the specific driver usb_dfu inf See Batchisp user s manual in the Help menu of FLIP Software for more details on the Batchisp usage Once this driver is selected the DFU class appears under AtmelIDFU AT89C5130 AT89C5131 E Device Manager File Action View Help er A A PCNT1094 Ge Atmel DFU DFU peripheral SAY Te2CS1a0 ATSSCSI31 a Computer Se Disk drives E Display adapters ha DYDICD ROM drives Floppy disk controllers H Floppy disk drives g Human Interface Devices fe IDE ATA ATAPI controllers gt Keyboards 15 Mice and other pointing devices Monitors Eg Network adapters Hg Broadcom Wetktreme S xx Gigabit Controller B Cisco Systems VPM Adapter aif Ports COM amp LPT NO Communications Port COMI USB virtual Port COM Y ECP Printer Port LPT1 ee eal ee al al ee el ee oe eal ed al oo ead A MEL AT890CD 01 User Guide Configuring the ATOCD51 emulator In case of the update firmware has failed please check the following Is the system green led still blinking or not if blinking the above updating firmware procedure must be performed again system must be first unplugged then plugged again to the PC if led is off this means the OCD system still under update mode In this case run then the Update_Firmware bat file located in the KEIL
8. 0 5 bin batchisp exe ue Arguments device ATOCDOTARGET hardware AS232 port COMS baudrate 19200 ocd C51 operation memor Cancel Defaults device ATOCDTARGET hardware RS232 port COMx baudrate 19200 ocd C51 operation memory memory loadbuffer H PROGRAM COM x will be replaced with the COM number given during OCD USB Virtual COM installation see section 3 3 Install ATOCD51 emulator USB Windows driver memory will be replaced by 14 for AT89C51RE2 targets example for OCD USB Virtual COM port 5 with a AT89C51RE2 target device ATOCDTARGET hardware RS232 port COM5 baudrate 19200 ocd C51 operation memory 14 loadbuffer H PROGRAM Note Choosing to run the loader independently will give you progressing information about the download You should check this option Note The Batchisp command line are not case sensitive Note If path for Batchisp is hard written in the Utilities tab of target settings do not forget to update it when updating Flip Batchisp software 3 12 AMEL AT890CD 01 User Guide 7688C 8051 09 06 AT890CD 01 User Guide Configuring the ATOCD51 emulator For AT89C51SND3x products please refer to firmware packages and their OCD setup These products use a specific loader m To start and stop a debug session you have to use the debug button iq The debugger has to be configured in the KEIL uvision interface First select the options for target in the KEIL
9. 2B DAC SETB PPro Ose Oe I scheduler c 0x432D 0243E8 LIMP scheduler C 43E8 177 U6 mail_send_event U16 evt_id U16 param C 0x4330 ABOS MOY R3 0x05 C 0x4332 AAO4 MOY R2 0x04 178 179 Push an event towards the MMI 180 For that case we need to integrate inside the eventId the 16l id of the MMI task because that our politic to send only 4 gt main c config h virtual_mem EX Disassembly You will then see on this window the history code executed since the last 8 branchs 3 20 A MEL AT890CD 01 User Guide T 7688C 8051 09 06 Intrusive Trace AT890CD 01 User Guide Configuring the ATOCD51 emulator Intrusive trace is based on specific routines in the user code which output strings or data through the debug interface These messages are visualized in the KEIL command window The routines behaves from a user point of view as simple printf routines E You must first add in his KEIL project the debug h debug c and trace c files mE Then C modules where intrusive traces will be done need to include debug h file and add the following define with ENABLE or DISABLE to activate or not intrusive trace define TRACE_ ENABLE m You must then use the following functions void trace const U8 str void trace_hex U8 val void trace_u8 U16 val void trace _u16 U16 val Examples in user code trace value in hex of variable temp r n trace_
10. AT890CD 01 User Guide ATMEL 1 1 Overview AT890CD 01 User Guide Section 1 Introduction Congratulations on your purchase of the Atmel ATOCD51 emulator The purpose is to provide designers with a reliable way to load and debug new Atmel AT8xC51 microcontrollers This document describes the ATOCD51 emulator system along with the associated Windows software This system is designed to allow an easy connection to Atmel AT8xC51 microcontrollers and uses the USB interface connection to PC platforms standard USB B plug to A plug cable The software package is fully integrated into Keil uvision IDE This user guide acts as a general getting started guide as well as a complete technical reference for advanced users Figure 1 1 ATOCD51 emulator system 1 3 7688C 8051 09 06 Introduction 1 2 Glossary System The ATOCD51 emulator system OCD On chip debug ability to access internal ressources of microcontroller to help in firmware development Target The Atmel AT8xC51 device to be debugged 1 3 ATOCD51 emulator Features The ATOCD51 emulator provides the following features E ATOCD51 emulator system USB B plug interface 6 pin ribbon cable with OCD connector System green LED Target orange LED Error red LED indicating incorrect connection between the emulator and the target Hardware rescue jumper inside the case Powered by the USB port m Atmel ATOCD51 Plug in for KEIL for visio
11. F THE USE OR INABILITY TO USE THIS DOCUMENT EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAM AGES Atmel makes norepresentationsor warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specificationsand 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 useas components in applications intended to support or sustainlife 2007 Atmel Corporation All rights reserved Atmel logo and combinations thereof are registered trademarks are the trademarks of Atmel Corporation or its subsidiaries Other terms and product names may be trademarks of others amp Printed on recycled paper 7688C 8051 09 06 xM AMEL AT890CD 01 User Guide Section 1 MVOC UO arose de cette ett E se cece E yonncecgeevdiectitaes seeresacee ae 1 3 bI OY asec creases cce ses gasscenenentotenceneadieosese iaeei iei ea 1 3 L2 61S c 12 6 een ee eee ere ee 1 4 1 3 ATOCD51 emulator Features 2 0 00 ccccccccseeeecceeseeeeeeeeeeeesseeeeeseeeeeeesaees 1 4 1 4 Supported targets cccccscssccccsseecceceeeeeecceeeeceeseeeeeeseeaeeeesegeeeessaeeeeeseeess 1 4 Section 2 Installing the ATOCD51 emulator
12. cable and to PC Green LED must toggle on the ATMEL OCD system Connect ATOCD51 emulator system to target on the 6 pin OCD header Orange LED must light ON on the ATMEL OCD system Launch uvision compile and link the project make sure the previous configuration for OCD loader and debug session has been done properly For AT89C51RE2 targets see ATMEL application note Code banking with KEIL uvision for specific banking configuration For AT8xC51SND3x targets special consideration have to be taken into account depending if code is with banking or not m Load application into target memory ee Note If the target is AT8xC51SND3x with banking system specific Nand Flash ISP is needed See AT8xC51SND8x firmware packages and specific tools delivered with if Batchisp loader is run independently within the KEIL Flash programmer interface you will see the following Command window during the download operation e ATMEL FLIP Command Line Interpreter Prog C i Program Files ATMEL FLIP 3 86 5 bins batchIsp exe device ATOCDTARGET hey ardware RS232 port CONS baudrate 19200 ocd C51 operation memory 14 loadbuf fer TestOCD hex PROGRAM Running batchisp 6 1 6 180 on Mon Nou 26 13 15 59 26 ATOCDTARGET RS232 COMS 19268 Device selection Hardware AT890CD 01 User Guide AMEL Sy 3 15 7688C 8051 09 06 Configuring the ATOCD51 emulator If the Batchisp load er is not run indep
13. cific breakpoint Software breakpoint occurs at 0x100 management only for banking code address on AT8xC51SND3x target mode with AT8xC51SND3x re targets i check that Code banking check box is not selected on the Target tab of target settings check in option h file if the define CODE_BANKING is set to DISABLE Specific breakpoint management only for banking As these breakpoints are managed internaly by the mode with AT8xC51SND3x ATOCD51 emulator firmware number of code Code breakpoints do not work targets breakpoints in all banks are limited to 16 properly in banks on AT8xC51SND8x target Whole project has not been reloaded into Nand Flash and Reload the code in Nand Flash using the uvision code differs from code Music_player_ISP PC software in the target AT890CD 01 User Guide Alm L 7 29 T 7688C 8051 09 06 Troubleshooting Guide Problem Reason Solution Code breakpoints do not work Banking method does not properly in banks on AT89C51RE2 followed Atmel banking Change banking method according to the Atmel targets application note for application note AT89C51RE2 targets Error when setting breakpoint on Static variable i x Can be work around by setting the breakpoint using the AN Breakpoint definition error Keine tae breakpoint configuration in the debug menu and enter the address of the static variable See Section Breakpoint management page 17 Can set or remove c
14. e 9 Check path content in the Control Panel System folder Environment Advanced tab then Environment variables In the User variables check the path variable This must have the FLIP software path included The path for Batchisp program is not know in the environment variables Batchisp command has failed when downloading code application into The command line for Batchisp target in the Utilities tab of the KEIL target settings has been reset to the default KEIL command line This default command line is usually used for using Batchisp program thru bootloader and not thru OCD dongle See Section Configuring ATOCD51 emulator under KEIL vision page 10 to write the proper arguments in the Batchisp argument s line to work with OCD dongle Read bootloader version failed when using command line Batchisp for code download into AT89C51xE2 target Bootloader version information is irrrelevant when using the Do not take care about this reading error OCD dongle check in option h file if the define BANK_DECIPHER is Code inside the product is set to ENABLE secured or incorrect check if code has been properly loaded Cannot debug invalid code or secured code on AT85C51SND3x product Check if the project uses code banking If yes check that Code banking check box is selected on the Target tab of target settings check in option h file if the define CODE_BANKING is set to ENABLE Spe
15. e Update Wizard Windows will search for curent and updated oftware by looking on your computer on the hardware installation CO or on the Windows Update Web site with your permission Read our privacy policy Can Windows connect to Windows Update to search for software O Yes this time only es now and every time connect a device Click Next to continue 6 Select the Install from a list or specific location option Click Next gt Hardware Update Wizard Welcome to the Hardware Update Wizard This wizard helps you mstall software for A T 8905130741 89C5131 fe If your hardware came with an installation CD lt or floppy disk insert it now What do you want the wizard to do Install the software automatically Recommended AMEL oss 7688C 8051 09 06 Appendix A 7 Select the Don t search will choose the driver to install option Click Next gt Hardware Update Wizard Please choose your search and installation options S Search for the best driver in these locations Use the check boses below to limit or expand the default search which includes local paths and removable media The best driver found will be installed Choose this option to select the device driver from alist Windows does not guarantee that the driver you choose will be the best match for your hardware 8 Then select Have a disk Found New Hardware Wizard Select the device driver you want to install
16. ected and since there is target power supply Off in other cases Red Error LED Hardware power consumption detection On when wrong connection e g ground to Vcc etc Unplugged your OCD system from target connector and check the OCD connector pins definition 3 3 Install ATOCD51 emulator USB Windows driver AT890CD 01 User Guide m Plug the ATOCD51 emulator system on a Windows PC In the Driver Installation Wizard dialog select the folder KEIL C51 AtmelUsbOcd where the atusbocd inf file is located m A new serial COM port appears in the ports section of the Device Manager with the following name OCD USB Virtual COM COM lt gt This number is used in the Atmel ATOCD51 Plug in for KEIL configuration s ree H m Computer HE Disk drives a Display adapters B23 DYDICD ROM drives Bla Human Interface Devices H E IDE ATAJATAPT controllers Fp IEEE 1394 Bus host controllers Fae Keyboards na Mice and other pointing devices Modems Monitors H A Network adapters E PCMCIA adapters a el Ports COM amp LPT beeen e Communications Port COM1 UF ECP Printer Port LPT1 W OCD USB Virtual COM COMS lt q New COM port YW Toshiba BT Port COMO oo Jf Toshiba BT Port COM11 YW Toshiba BT Port COM12 oo YF Toshiba BT Port COM13 oo UF Toshiba BT Port COM14 oo UF Toshiba BT Port COM20 YW Toshiba BT Port COM21 YW Toshiba BT Port COME z F Toshiba BT Port COM7 E od Sound
17. endently the result of download will appear in the Build window of KEIL uvision interface CisProgram Files Atmel FLIP 3 0 5 b1 Running batchisp 0 1 0 10 on Fri Mow nbatchisp exe devyice ATOUCDTARGET hi 17 17 10 30 2006 ATOCDTARGET RS234 COMS 19200 LDovico es ee es we oe ow eave eect wi el Bee we PASO Hardware selecti n aaau aaa aaa PASO Opening POPC ee oe isin ee omen ae RE hee se ea PAS Initializing ME te ea ae a ee ew ee ae ee PASO pyne OOM Se Car E Cese minea a Se Oe PADD Reading Bootloader yerslon PADD Lesa electing MEMO nananana wie Wie Aw ae we oer PAS Brebein HEA tileeeetens teat ign teeaene ae PASS testRHe HEX el Programming MEMO PASS Ux0Q0000 Uses summary Total 4 Passed 4 Failed U Note Reading the Bootloader version is irrelevant for the Batchisp loader a fail result of this operation is not critical for the other operations m f the load operation succeeds then press igi to start debug session PC Cursor comes on first instruction in main function as shown below void main void Set SFR page Clock d Mcu_set_sfr_page_clock Set clock mode to He mode Clk sete model PC Cursor shows first instruction in assembly on Disassembly window vold main void 34 Set SFR page Clock 35 Mcu_set_sfr_page_clock 36 aes Set clock mode to X2 mode DC 0x431E D2CO0 SETB PPS0 0zC0 0 36 Clk _set_x2_mode 39 40 f f Set oscillato
18. ert Remove Breakpoint x 000 pmi Enable Disable Breakpoint a Disable All Breakpoints aey ae A kill All Breakpoints erry El ios Sys G gt Show Next Statement i Seen a 000 Pieno O00 ng Enable Disable Trace Recording TETE f View Trace Records ae PL 0x03 Memor Mape 2 Ee paw 0x00 Performance Analyzer El OCD Inline Assembly e 0x01 Function Editor Open Ini File _ 7688C 8051 09 06 The following window appears Breakpoints a Current Break points PJ 00 A read D 0 40 len 1 P2 01 A write 1 004 len 1 uart_tx_flag 02 E C 0x0577 WART_DRY54 03 A readwrite 0x000000 len 1 value 4 Access Expression Bead Count fi Size 1 Command zal Kill Selected Kill 4 Configuring the ATOCD51 emulator White Butes Objects SFR breakpoint read access data breakpoint write access code breakpoint fetch access xdata breakpoint read write access These complex breakpoints are set by writing under Expression field Syntax is the syntax used by KEIL Examples d 0x20 for data breakpoint d 0xA0 for SFR breakpoint P2 1 0xA0 for idata breakpoint x 0x100 for xdata breakpoint c 0x1000 for code breakpoint b02 0x8500 for code breakpoint in bank memory 2 Read or Write access or both can be chosen in the check boxes on the right hand side Notes 1 The above window only shows type of possible complex breakpoints Only 2 hardware breakpo
19. et ATOCD51 emulator system is Connect the ATOCD51 emulator system to the PC not connected to the PC Cannot connect to OCD target On some laptops due to the USB OCD driver same COMx could be present twice 2 COMB for example could be listed in the Device manager Connect the ATOCD51 emulator system to the PC on OcdinitTarget Message Eg another USB port Could not open COMS Batchisp command has failed when upgrading the OCD firmware Port COM amp LPT section Moving from 1 USB slot ona PC to another leads to opening a new OCD virtual port COM The USB DFU driver for OCD dongle has not been installed properly The USB DFU driver for OCD is still the former used by Atmel under Jungo Open the Device manager on the control panel to see the new COM port assign to the Atmel OCD system Then make sure that KEIL OCD settings take into account this new COM port Target settings Debug amp Utilities for loading target from OCD system See FLIP Software installation and user s manual See Section Updating ATOCD51 emulator firmware page 22 See Appendix A in Section 9 for special move from USB DFU Jungo to Atmel 7 28 AIMEL T AT890CD 01 User Guide 7688C 8051 09 06 Troubleshooting Guide Problem Reason Solution The USB OCD Virtual COM port driver for OCD dongle has See Section Install ATOCD51 emulator USB Windows not been installed properly driver pag
20. fic driver to be installed TF the required driver is not present on your system the installation wizard will ask For the USS driver location The USE driver location is the fusb Folder of the Flip package Do you want bo proceed 2 Then Select Yes the batchisp program is launched in a command window and fails the command window exits and the green system LED of OCD system stops blinking AT890CD 01 User Guide 10 33 7688C 8051 09 06 Appendix A 3 The USB DFU driver must be changed from Jungo to the new Atmel one Open the Device Manger in the Windows Control Panel and check that Jungo is listed with ATMEL AT89C5131 80 device Device Manager File Action View Help Hee Amg PLAT 2053 gt a Batteries 4 Computer Se Disk drives a Display adapters 2 DYDICD ROM drives ig Human InterFace Devices IDE ATA ATAFI controllers IEEE 1394 Bus host controllers BB Jungo FF ATS9ICS 1 30 47T89C5131 Keyboards 3 Mice and other pointing devices dee E ee 4 Right click on the AT89C5131 30 device and select Update driver Update Driver Disable Uninstall Scan For hardware changes Properties 10 34 A MEL AT890CD 01 User Guide T 7688C 8051 09 06 AT890CD 01 User Guide Appendix A 5 In the Hardware Update Wizard dialog select the No not this time option Click Next gt Hardware Update Wizard Welcome to the Hardwar
21. hex temp Assert routine Between all available routines in debug h debug c files the assert routine enables to hang the execution code when accessing to a non expected code area This uses the TRAP instruction to halt the target Then C modules where assert feature will be done need to include debug h file and add the following define with ENABLE or DISABLE to activate or not assert define ASSERT _ ENABLE Example in user code assert Expression will lead to the following execution if Expression is false hangs the code execution while 1 outputs in the KEIL command window the source file as well as source line where assert occurs Notes 1 When code is executed without OCD active all assert will behave as a NOP Instruction AMEL i 7688C 8051 09 06 Configuring the ATOCD51 emulator 3 7 Updating ATOCD51 emulator firmware 3 22 7688C 8051 09 06 m A new AT890CD 01 plug in may contain an updated version of the USB dongle firmware Once a debug session is initiated the plug in reads the ATOCD51 emulator system firmware version and prompts you with an update dialog OCD Information xj USB interface Firmware update is necessary Do you want to proceed If this is the first ATOCD51 emulator system firmware update Windows will detect a new USB peripheral The ATOCD51 emulator system enumerates in DFU class Device Firmware Upgrade You must then choose the FLIP
22. ication code before starting a debug session this is not yet done automatically When debugging a AT85C51SND8x product in banking mode the number of software breakpoints is limited to 16 No limitation on software breakpoints when non banking mode for AT85C51SND8x products or on AT89C51xE2 products Usage of TWI peripheral is uncompatible with usage of OCD51 system When accessing SSCON SFR register 93H for TWI configuration OCD51 system halts and can not be reset A popup window may occur with HBSTA register with unknown value Simple initialization instruction SSCON 0x40 generates this issue in OCD mode However the usage of TWI is still possible and it runs properly once in standard running mode e g not using the OCD system 4 24 7688C 8051 09 06 ATMEL Section 5 New features The following features are added since the 1 30 revision of the Atmel ATOCD51 Plug in for KEIL linked to the 2 0 6 revision of OCD dongle firmware E Full chip erase of AT89C51RE2 target when target is locked When accessing to a target which is secured the OCD dongle will perform a full chip erase operation prior to connection AT890CD 01 User Guide 5 25 7688C 8051 09 06 ATMEL AT890CD 01 User Guide Section 6 Features Not Yet Implemented The following features already supported by ATOCD51 emulator firmware still need to be added in the Atmel ATOCD51 Plug in for KEIL m Trace triggers and break on trace buffer full The fol
23. installation folder KEIL C51 AtmelUsbOcd Once the operation is completed the green LED must blink again The system has been updated and ready to use In case of the Update_Firmware bat file leads to an error amp the green system LED is still off this issue could be due to former installations of FLIP software with different USB driver for Firmware Update See Appendix A for details amp procedure E Manual update for ATOCD51 emulator system firmware This must be done only if a new firmware release has been delivered separately from an Atmel ATOCD51 Plug in for KEIL or if the ATOCD51 emulator system does not function unable to connect to the target and the system green led does not blink See troubleshooting section if some issues occur during this operation Section 7 Unplug the ATOCD51 emulator system from the target amp the PC Open the ATOCD51 emulator system box and close the rescue jumper SP1 Plug the ATOCD51 emulator system to the PC the system green led must be off If first time firmware update see above for finding the proper USB driver Run then the Update_Firmware bat file located in the KEIL installation folder KEIL C51 AtmelUSBOCD Once the operation is completed open the rescue jumper close the box unplug and plug again the ATOCD51 emulator system to the PC AT890CD 01 User Guide AIMEL 3 23 7688C 8051 09 06 ATMEL AT890CD 01 User Guide Section 4 Limitations Need to load first the appl
24. ints are available at the same time If no complex breakpoints are defined first two code breakpoints will be hardware all other code breakpoints will be automatically set as software breakpoints To set complex breakpoints it is then recommended to remove all set break points first place the complex breakpoints and then place the code break points AT890CD 01 User Guide A MEL T 3 19 7688C 8051 09 06 Configuring the ATOCD51 emulator 3 6 2 Trace management Trace is made of 2 types Build in Trace non intrusive and powerfull but limited in size and Intrusive Trace which needs to be added in the application code as printf equivalent Build In Trace Build In Trace is based on the record of the last 8 branches which have occured during code execution When execution is halted trace is reconstructed based on these last 8 branches m Trace buttons ae j Enable disable View trace trace recording records m Trace view is done on the Disassembly view in gray color i C 0z431E D2Cc0 SEILE PPoULUZCO 0 36 Clk_set_x2_mode 6 C 0x4320 436F01 ORL LCDSTA Ox6F 0x01 41 Clk_set_oscillator 3 C 0x4323 436F16 ORL LCDSTA Ox6F g_u68_addr_first_block_font 0x18 44 Int_enable 4 C 0x4326 D2AF SETB FA 0xA8 7 gis mail_init_mailhbox 7 Cr0n4328 124415 LCALL mail_init_mailbox C 4413 48 void mail_init_mailbox void C 0x4413 eZ a 54 Mcu_set_sfr_page_default l C 0x43
25. lowing features are neither supported by ATOCD51 emulator firmware nor by the Atmel ATOCD51 Plug in for KEIL m Warning information about crypted code on AT8xC51SND8x target Debug session on crypted code can not be possible and will not 6 26 7688C 8051 09 06 AIMEL T Section 7 Troubleshooting Guide Figure 7 1 Troubleshooting Guide The system green LED is not blinking The target orange LED does not light when connecting to a target AT890CD 01 User Guide ATOCD51 emulator system is not conneted to PC Debug session has not been terminated properly or target connection has been removed during debug session Verify connection to PC close KEIL debug session unplug and plug again the system and see if system green LED is blinking again No crystal on the target board Add crystal on target board ATOCD51 emulator system could be in update firmware mode Target is not or incorrectly connected to the ATOCD51 emulator system the update firmware operation is on going then wait system green led for blinking again unplug and plug again the system and see if system LED is blinking again a manual firmware update has been done and rescue jumper must be removed on the emulator board system must be unplugged and plugged again system has gone into update mode but firmware update fails see in this troubleshooting section Batchisp command has failed when upgrading the OCD firmware
26. n Uses standalone installer Allows code download to target Visualizes memory areas and SFRs Standard debug features step by step hardware breakpoints on all memory areas SFR internal RAM XRAM Code Unlimited number of software breakpoints Freezes or not peripherals when breakpoint occurs Wakes up from sleep modes Trace buffer with record of last 8 non sequential executed addresses with high level source rebuild Trace triggers and break on trace buffer full Halt from user or internal reset sources 1 4 Supported targets The current ATOCD51 emulator supports the following targets mE AT85C51SND8x Multimedia products mM AI89C51RE2 products 7688C 8051 09 06 ATMEL 2 1 Prerequesites AT890CD 01 User Guide Section 2 Installing the ATOCD51 emulator Before installing the ATOCD51 emulator software make sure the following programs are installed KEIL uvision 2 or 3 m Java Run Time environment 1 5 or above right click logo E Atmel FLIP revision 3 0 5 or above See Atmel web site for free download www atmel com Check regulary for new updates as this can add new features or fix some issues 2 5 7688C 8051 09 06 Installing the ATOCD51 emulator Then run the AT890CD 01 installation package for KEIL pvision Atmel Keil OCD_Install EXE and follow the installer Setup Atmel OCD Add On Component V1 24 Welcome to Keil p ision3 Release 6 2006 This SETUP p
27. n Jun 18 17 27 47 2607 ATS 9C5131 USE USBZDFU Device selection Hardware selection Opening port Reading Bootloader version Selecting FLASH Parsing DAT file Erasing Programming memory The OCD system is now updated properly the KEIL uvision session can be launched again and start T AT890CD 01 User Guide A MEL 10 39 7688C 8051 09 06 AMEL T O 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 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 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 ASIC ASSP Smart Cards Zone Industrielle 13106 Rou
28. ode breakpoints KEIL allowed to fix this but this can be used with the while target is running but not taken Breakpoints set or remove ATOCD51 emulator into account See msg below operation is only taken into Do not set or removed breakpoints when target is running account when target is halted this could lead to unconsistent behavior When this occurs exit debug session and restart the session Breakpoint Error X Setting or clearing breakpoints while the application is running is not possible The selected breakpoint remains seticleared until the application is started again When accessing to the OCD system hungs when using TWI SSCON 93h register for TWI peripheral initialization through a debug session OCD system hangs and can not be stopped or reset Silicon limitation when using OCD system TWI works fine without OCD enabled See Section 4 of this document Limitations 7 30 AMEL AT890CD 01 User Guide 7688C 8051 09 06 ATMEL Section 8 Technical Specifications E System Unit E Operating Conditions Voltage Supply cesses trvcvesuescissaaricnsassinneetiaswssacinaiedavinasetilvaadwenses 3 3V from USB bus E Connections USB CONNGCIO seek esa aiteuecosnieniansanetsaguahop ARE RETER RERE B receptacle USB Communications 2 0 ceeccccccseeeeeeeeeeeeeseeeeeeeeeeeeeesseaeeees Full speed speed Target CONNECTION ccccceceeeeseeeeeeeeeeeees Ribbon cable with HE10 6
29. or L451 Exe V4 09 Librarian LIB51 Exe V4 ad Hes Converter OH51 Exe W366 CPU DLL 8051 OLL W306 Dialog DLL DPS1 0LL We 46b Target DLL AtmellsbO cdAtkocdO0 dll Wd Dialog DLL TP5S1 0LL We 46b The PC operating system and the version build m The PC processor type and its speed m A detailed description of the problem AT890CD 01 User Guide 9 32 7688C 8051 09 06 ATMEL Section 10 Appendix A Upgrading the Atmel AT890OCD 01 firmware when some FLIP software versions below 3 0 0 have been installed When starting a debug session using Atmel AT890OCD 01 under KEIL uVision a pop up window appears if firmware upgrade is necessary on the OCD system This firmware upgrade is based on batchisp exe program the command line executable file of Atmel FLIP software It uses the Device Firmware Uprade USB class For customers who have previously used versions of Atmel FLIP software below 3 0 0 USB DFU class was supported by 3rd party vendor called Jungo Since Flip 3 0 0 DFU class is now supported by Atmel and named ATMEL DFU Proceeding to a firmware upgrade of the Atmel OCD system with a FLIP version above 3 0 0 when customers have used former version of FLIP will fail Please follow the procedure to make sure that the upgrade will be done properly 1 Launch the debug session to start the upgrade firmware OCD Firmware Update Information Updating the ATOCDS1 emulator Firmware is necessary and requires a speci
30. pin header Inside Box Jumpet c0008 Rescue jumper for system firmware upgrade E LEDs Red LED sceeaciccnleecndieuerincetinstitiantamensnieaanuet Error LED when wrong target connections Green LED aasssssnsesssnsesenneseeesnnenne System LED blinking when system is running Orange LED Target LED lighting ON when target is connecting to OCD system AT890CD 01 User Guide 8 31 7688C 8051 09 06 AIMEL T Section 9 Technical Support For Technical support please contact 8051 atmel com When requesting technical support please include the following information Which target 8051 device is used complete part number device marking date code and lot number The target voltage and the clock frequency The clock source and the target fuse setting when FLASH device The banking mode the code is with or without banking The hardware revision of the ATOCD51 emulator system see sticker on the bottom side of PCB The ATOCD51 emulator system firmware revision accessible from the Target setup window See section 3 4 Configuring ATOCD51 emulator under KEIL uvision The KEIL suite version numbers as well as Atmel ATOCD51 Plug in for KEIL In the Help menu choose About uvision About pVision3 wv isions Ya da k f Copyright c Keil Elektronik GmbH Keil Software Inc 1995 2006 Toolchain Path C Akel CS1 SBIN C Compiler C51 E se We 05a Assembler 451 Exe wo 00b Linker Locat
31. pvision interface On the Debug tab choose Atmel USB OCD Driver as debugger for the current project Options for Target Target 1 Device Target Output Listing c51 a51 LX51 Locate LX51 Misc Debug Utilities f Use Simulator Limit Speed to Real Time k Load Application at Startup W Aun to maini Initialization File E Restore Debug Session Settings lf Breakpoints i Toolbox lf Watchpoints amp PA W Memory Display CPU OLL Parameter 58051 DLL Dialog DLL Parameter DPS1 DLL pATED 2 Settings e Use Atmel USB OCD Driver Settings Keil Monitor S1 Driver Kel S051 In System Debugger MON 390 Dallas Contiguous Mode Ed ne LPCSO0 EPM Emulator Programmer Initializatiq T uPSD ULINK Driver Infineon C800 ULINE Driver ADI Monitor Driver W Breakpoints W Toolbox Wabtchpoints W Memory Display Driver DILL Parameter 88051 DLL Dialog DILL Parameter TPS1 DLL pATED2 Cancel Defaults Check Load application at start up and Go till main options AIMEL T 3 13 7688C 8051 09 06 Configuring the ATOCD51 emulator Then select the Settings for the Atmel USB OCD Driver Target Setup Comm Port Settings Cache Options Virtual COM Com 5 M Cache Data OCOD Connection W Cache Xdata f C51 Std Col Mix C ASI Ii Cache Code On WatchDog Reset Firmware Version Restart Target Stepping in Interrupt Ro
32. r frequency to optimise powe C 0x4320 438F01 ORL LCDSTA Ox6F 0x01 41 Clk_set_oscillator 42 43 Set interuptions mode C 0x432 436F16 ORL LCDSTA Ox6F g_u6_addr_f 44 Int_enable 45 46 Init our timers 47 warning NO TIMER IN THIS PROJECT 48 A timer_init_timer 49 50 zz Init our differents mailboxs one for th C 0x4326 D2AF SETB EA OxA8 7 main c config h virtual_mem EX Disassembly 3 16 A MEL AT890CD 01 User Guide 7688C 8051 09 06 Configuring the ATOCD51 emulator 3 6 Working within an AT89O0CD 01 debug session under KEIL pvision E On left hand side a register view give low level information about product state Project Workspace i Eins Gress E Standard Debug actions can be performed using the following buttons halt step next execution over statement i resetthe runcode step run target from cursor into to cursor i oe N 3 6 1 Breakpoint management Default breakpoints When you choose Ea button to halt execution When stack overflows When watchdog reset occurs When target external reset button is pressed Notes 1 When watchdog breakpoint occurs user must apply a reset to the target by clicking on the reset button of the KEIL interface If this is not done Watch dog reset is still active and will occur again when running or doing step by step User can also choose to reset automatically the target once watchdog reset occurs by selec
33. rogram installs Atmel OCD Add On Component 1 24 This SETUP program may be used to update a previous product installation However You should make a backup copy before proceeding kis recommended that you est all Windows programs before continuing with SETUP Follow the instructions to complete the product installation Accept software license agreement Setup Atmel OCD Add On Component V1 24 License Agreement Please read the following license agreement carefully To continue with SETUP pou must accept the terns of the License Agreement To accept the agreement click the check box belor SOFTWARE LICENSE AGREEMENT Important Read carefully This 1 is a legally binding agreement between Atmel oon Eee its 1 2 Hin eee A Mie SN Ae LT LO TL LL OTL a Ln W agree to all the terms of the preceding License pce 2 6 AIMEL Sy AT890CD 01 User Guide 7688C 8051 09 06 Installing the ATOCD51 emulator E Choose the KEIL installation directory Setup Atmel OCD Add On Component V1 24 Folder Selection Select the folder where SETUP will install files SETUP will install piisonid in the following folder To ingtall to this folder press Nest To install to a different folder press Browse and select another folder Deshnation Folder C AKeil Browse Back Keil p ision3 Setup completed Wisan Setup has performed all requested operations successtully Ww Show Relea
34. se Notes mea M See troubleshooting section if some issues occur during this operation Section 7 AT890CD 01 User Guide Alm L 2 7 T 7688C 8051 09 06 ATMEL Section 3 Configuring the ATOCD51 emulator This chapter describes how to configure the ATOCD51 emulator in the KEIL vision interface to download and debug application code It also describes system connection with target 3 1 Connector definition and target connection 3 2 LEDs definition AT890CD 01 User Guide Figure 3 1 Recommended AtmelAT8xC51 target OCD connector VCC Target 1 0 o 2 PSEN ISP GND 3 Jo Ol4 OCDT RST 5 O O 6 OCDR Note 1 OCDT and OCDR are the pin names for the serial debug interface on the target These lines on the ATOCD51 emulator system have to be connected point to point to the lines on the target Note 2 For AT8xC51SND3x devices the PSEN ISP pin is not used and will be left non connected ISP entry is done using both OCDT amp OCDR pins Note 3 If a wrong connection is made between VCC Target and GND lines the error red LED turns On Then connection must be removed and ATOCD51 emulator system unplugged from PC Green System LED Always blinking when USB connection with PC is done Can slow blink when programming the target If stop blinking more than 2s systems is hanged and must be unplugged and replugged 3 8 7688C 8051 09 06 Configuring the ATOCD51 emulator Orange Target LED On when target is conn
35. sset Cedex France Tel 33 4 42 53 60 00 Fax 33 4 42 53 60 01 Chinachem Golden Plaza Fax 33 4 76 58 34 80 77 Mody Road Tsimshatsui East Kowloon Hong Kong Tel 852 2721 9778 Fax 852 2722 1369 1150 East Cheyenne Mtn Blvd Japan Colorado Springs CO 80906 USA 9F Tonetsu Shinkawa Bldg Tel 1 719 576 3300 1 24 8 Shinkawa Fax 1 719 540 1759 Chuo ku Tokyo 104 0033 Japan Scottish Enterprise Technology Park Tel 81 3 3523 3551 Maxwell Building Fax 81 3 3523 7581 East Kilbride G75 OQR Scotland Tel 44 1355 803 000 Fax 44 1355 242 743 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 anyintellec tualproperty 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 PARTIC ULARPURPOSE 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 INFORMA TION ARISING OUTO
36. ting the check box restart target on Watchdog reset breakpoint in the OCD target settings AT890CD 01 User Guide AMEL N 3 17 7688C 8051 09 06 Configuring the ATOCD51 emulator HM Setting breakpoints Code breakpoints are set removed by double clicking on the code line or with the following buttons enable disable breakpoint a an de m set remove kill all enable disable code breakpoint breakpoints all breakpoints Code breakpoints can be either hardware breakpoints addresses comparators or software breakpoints 1 byte TRAP instruction executed in place of existing opcode 2 hardware breakpoints are available while an infinity of software breakpoints can be set Setting complex breakpoints on any target memory plans Based on the 2 hardware breakpoints available addresses comparators much more complex breakpoints can be set These breakpoints can be on data xdata sfr memory plans on read or write access by choosing the Breakpoints configuration window from the Debug menu Wd x p ision CA work ocdi fpga d_n2 main c IE File Edit View Project Debug Flash Peripherals Tools S CS Window Help rs Li Gi x E Start Stop Debug Session Chrl F5 slloure BS RST e oRee 4 Step Fil Project Workspace Tp Step over Fin Walle FF Step Gut af current Function Gh Fil Run to Cursor line Chrl F10 eee Q Stop Running Est Let TT ll Ins
37. utine Freeze Timer on Breakpoint Enabled TO Freezer Debug Log File Create C tempsatkocdlog tet OF Cancel Choose the appropriate Virtual COM port in regards of section 3 3 Install ATOCD51 emulator USB Windows driver Choose the OCD Connection C51 Std for AT89C51RE2 targets C51 Mix for AT89C51SND3x targets Check the Cache options for Data Xdata and Code to avoid KEIL interface to read code xdata and data memory at each step only when changes occur When a Watchdog reset occurs the debugger allows to restart or to halt the target this can be chosen on the above check box When the ATOCD51 emulator system is connected to the PC you can read the actual firmware release When doing step by step stepping into interrupt routines can be enabled or disabled on the above check box Each timer amp PCA can be either frozen or kept running when a the target is halted user halt watchdog breakpoints Select the appropriate timer which must be frozen when target is halted and check the box A log file can be generated for support T 3 14 A MEL AT890CD 01 User Guide 7688C 8051 09 06 Configuring the ATOCD51 emulator 3 5 Launching an AT89OCD 01 debug session under KEIL pvision Once the set up is completed make sure to follow these steps before launching the first debug session Power target USB or power supply Connect ATOCD51 emulator system to USB
Download Pdf Manuals
Related Search
Related Contents
Faculty & Advisor Self-Service Manual - Training NICE MOBY_ISTMOR1 AVEA Pulse Oximetry Option Owner`s manual for electric valves manual del propietario para CDA TV6 Bedienungsanleitung Life Fitness R7-0100-02 User's Manual Manual de Instruções Peerless Industries UST-WallArm3 User's Manual Copyright © All rights reserved.
Failed to retrieve file