Home
Topview Simulator User Manual.
Contents
1. toto Fr un P ii Than dD IEL FG J4 my 7i Too oD Tips i BA aCelE iHE Srl on 1b WH ak tC CIE Ok Oe POON Ob Ds FS 27 EYN rs TOG 10 ry Fl aD jgz 13 El Es a ADD A Ro LEE FA TY Hi roi EG B 25 ith 29 i011 F IET A DPTR gn HG TA lete ory if ob 80 DF Of w Op Uo Oo ia Ob OF an w Ob 0 Mi to Ob 0 OF OD Ob H0 Di to Ob 20 DOF OO Of 20 DMI an Ob 80 OF OD M 0D an Di 2a Ob fo OF OL wW Ob fo Di 10 oo Ao OF g mm ob Ol Size and position of the windows can t be changed Scrolling facility is available wherever it is required This window structure can be activated or all these windows can also be viewed in NormalView by clicking suitable tool buttons This ClearView gives you complete picture on the internal architecture in a single screen when you debug your target program code FRONTLINE ELECTRONICS 14 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment SSS SSS SSeS SSS 3 4 NormalView Window Structure In this arrangement you can activate as many windows as required during debugging process All these windows are tiled in many ways You can activate NormalView window structure at any time at the press of a button 3 5 Register Window Click Register Window in the View menu or click the relevant button of the toolbar to open or activate this window This Register Window indicates all the available internal registers and their contents Yo
2. Device Selection After the device selection enter the operating frequency This frequency value is taken as the master reference for all the operations of the simulator Enter a value that is less than or equal to the maximum operating frequency as specified by the device manufacturers Otherwise you will get an error message The possible microcontroller selections are Generic 8031 microcontrollers 8031 8051 8032 and 8052 Atmel s AT89CXX microcontrollers 89C1051 89C2051 8904051 89C51 89C52 89C55 89853 89S8252 Apart from this there is a facility to simulate 8031 in single chip and expanded configuration Provision is there to set address range of both external Program and Data Memories Now set the amount of program memory you want by clicking over Program Memory button under External Memory Setting When this button is activated a dialog box appears as shown here Program Memory Setting Ea r Selection External Program Memory Size Internal Only 2K C 16K C Extemal Only C AK C 32K Both C 8K C 60K Conve _ Topview Simulator Software User Guide Chapter 2 Starting Topview Simulator Soe eS Ss Device Selection First select any one in the heading Selection Then choose amount of memory and click OK button Similarly to set the amount of external data memory click over Data Memory button This will open another dialog box Data Memory Setting Ed Si
3. Topview Simulator Software User Guide SaaS For Technical or Customer Support You can reach Frontline Electronics Pvt Ltd for the technical support and application assistance in following ways Email questions to feplsim frontlinemail com Send questions by mail to Frontline Electronics Pvt Ltd 1 255C Thathagounder St Kumaran Nagar Alagapuram Salem 636 016 Tamilnadu India Phone 0427 244 9238 243 1312 Fax 0427 2449010 Web site www Frontline Electronics com Copyright 2003 Frontline Electronics Pvt Ltd All Rights Reserved Information in this document is subject to change without notice No part of this document may be reproduced or transmitted in any form or by any means electronic or mechanical for any purpose without the express written permission of Frontline Electronics Pvt Ltd FRONTLINE ELECTRONICS Topview Simulator Software User Guide Contents Chapter 1 Introduction to Topview Simulator Teal CMMPOGUCUION cic eiusat le cttes acts ahcc erie lage cats as inebiaca evened oud ace theater eee 1 2 System Requirement 00 cececceececeeeeeeeeeeeeeeeeeeeaaeeeeeeeeeeseeeeetiaaeetee Chapter 2 Starting Topview Simulator QV Introductio m ia eat tes a cehetan eal aes cel nel na ed eee 2 2 Device Selection iicccecceccceccecesceeececcesaeeeeceeeuueueceseuuauseeseuueuseeseaneuaes 2 3 Simulator Operations cccceeceeceeeeeeneeeeeeaeeeeeeeeeseeeeeessaaeesseeeeeeeaes Cha
4. Activate this command by clicking over the Load Program in the File menu Now you should see a dialog box coming up asking you to select the target file or enter a file name Look in ja Topview Simulator gt fa c 2 Test 2 Timexm01 a Testi a Tt a test2 a Test3 a Test8031 a Testin 1 j Filename f Files of type Intel Hex Files Hex 7 Cancel Select the file and click over Open button Another small window comes up indicating program loading using a progressive display Loading from D Magna31a hex FRONTLINE ELECTRONICS 69 Topview Simulator Software User Guide Chapter 8 Loading a Program from Disk to the Memory Loading a Program from Disk to the Simulator Memory At the end of the command execution a summary of addresses where the program is loaded is displayed as shown here File Loading Details x File Loaded Succesfully Loading Details Now click OK button to finish the load program command For a binary file a small dialog box may appear to get the starting address Address Ea Enter the Starting address Key in the starting address and then click OK button or press Enter key to start loading The status of program loading is displayed in a separate message box If the entered address exceeds the available program memory capacity the error condition is indicated ERROR Address Exceeds the Program Memory Capacity Topview
5. DPH DPL DPTR RO R1 R2 R3 R4 R5 R6 R7 and SP Internal Memory Location External Memory Location Any of these flags Carry C Auxiliary Cary AC Flag 0 Overflow Flag OV and the Parity Flag P Any of the memory bit between addresses 00H and 7FH As you can see this range of options make your BreakPoint selection as very useful one during debugging To activate this command click Setting of BreakPoint menu A dialog box pops up at the center of the screen prompting you to define the BreakPoint FRONTLINE ELECTRONICS 89 Topview Simulator Software User Guide Chapter 14 Program Execution Using BreakPoints a Program Execution Using BreakPoints BreakPoint Setting x Accumulator CC ogress as a Make your selection and initialize the location Register with the BreakPoint data and click over OK button or press Enter key Now the BreakPoint is set for your next operation and the same is indicated in the status bar as shown Now the simulator starts waiting for the BreakPoint execution command PC contents are considered as the program starting address when using the BreakPoint Execution command So before executing the program initialize the PC with the correct starting address You can set the PC BreakPoint in an easy way As you can see the Program Window has a BP indication that points to the PC BreakPoint assignment at that specific address FRONTLINE ELECTRONICS 90
6. 8 5 IC EEPROM WINGOW ennaa aa ra a araa enaena aean aa aeiaai 48 5 8 6 SPIEEPROM Window cccccccccsceeececeeeeeeeeeeeeeeeeeecaaeeeeeeeeeeseeeeessaaeetees 49 5 9 Load and Save Module Setting cccccecececeeeeeeeeeceeeeeeeeeeeeseaeeesecaeeeteneeeeetaaeees 50 Chapter 6 Code Generation Facilities O21 TIMtOAUCTION senei A E copied aed nadabede faatleat ace 51 6 2 Internal Peripheral Functions 0 0 eee ceeeeeee eee eeeeee eee eeeeeeeeeeeeeeeseeeeeeeeeeeeeeneaaees 51 Gr2e UM SOPALPOR E hes hatchet EE EAEE coated teed abel es 52 6 3 External Embedded Building Blocks 0 2 eeeeeeeeeeeeeeeeeeeeeeteeeeeeeeeeeeeeeaaeeeees 53 6 3 1 LED Display FUNCtions ocara iidr neira iaa EES a S 54 6 3 2 LCD Module Selection sssssesssssssesssssssrnssssrsssrssesssnessnnnssnnssstessssnnoesnnnssense 56 6 3 3 Keyboard InteifatinNgs eisene ao EEEE A T 60 FRONTLINE ELECTRONICS Topview Simulator Software User Guide Chapter 7 7 1 7 2 Chapter 8 8 1 8 2 Chapter 9 9 1 9 2 Chapter 10 10 1 10 2 Chapter 11 11 1 11 2 Chapter 12 12 1 12 2 Chapter 13 13 1 13 2 13 3 13 4 13 5 13 6 6 34 MC BUS gnicie iate e a N a a 6 3 0 SPH BUS Arneri aa taes aaa a e a a aaa eiaeaen Developing Target Program Code INtrOdUCTION aaa tie iaasa es aai elaine ea Developing Target Program Code cccscceceeceeeeeeeeeeeeaeeeeeaeeeseeeeeeseaeeeeeeeeetenees Loading a Program from Disk to the Memory IMTFODUCTION IAE RAE e AAE E E sunk
7. EEPROMs You know more of these internal and external modules in the next chapters 3 11 Load and Save Screen Setting You can save status of windows opened or closed and the location of the same for your future reference This information is stored as a file with SST extension To save the current window status click File gt Save Screen Setting If you need to name this file use Save as Screen Setting command When you want to load a previous file click File gt Load Screen Setting and select the file in the dialog window Or press the shortcut key Ctrl L FRONTLINE ELECTRONICS 26 Topview Simulator Software User Guide Chapter 4 Microcontroller Peripheral Simulation es 4 1 Introduction This Chapter gives more information about the simulation facilities available for all the peripherals of the 8031 microcontroller All I O port lines Timers Counters serial communication port of the controller are simulated in all the possible ways Similarly SPI port and the internal EEPROM of the device AT89S8252 and SPI port of AT89S53 are simulated All these simulation facilities are complete in all respects and you can use all the facilities of all the peripherals in your applications without any restriction 4 2 1 0 Window There are two I O windows available for your applications If you select any of the 20 pin controllers you may get a smaller window with less I O lines But you can get all the features i
8. Execute the Program in Full Speed ccccceeeseeeeeeeeeeeeeneeeeesaeeeees 108 17 9 Step 7 Execute the Target Program in SingleStep or StepOver Mode 108 Topview Simulator Software User Guide Chapter 1 Introduction to Topview Simulator a 1 1 Introduction Topview Simulator gives an excellent simulation environment for the Industry s most popular 8 bit microcontroller family MCS 51 It gives all the required facilities to enable the system designers to start projects right from the scratch and finish them with ease and confidence The following figure indicates the facilities available in the simulation environment that give you required development power to handle your next real time embedded system design applications Real Time Applications On Chip Peripherals CPU Architecture External Embedded Building Blocks Real Time Applications Code Generation Topview Simulator is the total solution giving many state of art features meeting the needs of the designers possessing different levels of expertise If you area beginner then you can easily learn about 8031 based embedded solutions without any hardware If you are an experienced designer you may find most of the required facilities built in the simulator that enable you to complete your next project without waiting for the target hardware The simulator is designed by the active feedback from the demanding designers and when you use this
9. Simulator GUI Environment _ _ 3 8 1 Load Data Into Data Memory This command is meant for loading a Hex or Binary file into Data Memory of the simulator from the disk hard disk Click File gt Load Data to activate this command Short cut key is Ctrl D You should see a dialog box coming up asking you to select the target file Look in ja Topview Simulator l c j LCDSBIT_TEST 8 Leddemot a Keyboa 1 a Leddemol a Leddemo2 a Keyboa 2 a Leddemo2 al Leddis 1 a Keyboa 3 a Leddemo3 a Magna3la al Led4bi 1 al Leddemo4 a new a Led8bi 1 a leddemo a program i Fiename Files of type Intel Hex Files Hex 7 Cancel Select the file and click Open button Another small window pops up indicating program loading using a progressive display Loading from D 5 Magna31 a hex At the end of this command execution you can notice the summary of data loaded into the memory FRONTLINE ELECTRONICS 23 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment Load Data Into Data Memory File Loading Details x File Loaded Succesfully Loading Details Pressing OK button completes this command execution When you select a Binary file you need to key in the starting address in a dialog window Address x Enter the Starting address Cancel Press OK button after ent
10. User Guide Chapter 4 Microcontroller Peripheral Simulation N 4 5 On Chip EEPROM Window An internal EEPROM of capacity 2KB is available in the microcontroller AT 8988252 You can simulate this memory space and define the memory contents You can make your target program read from or write into this EEPROM and you can observe those changes in the respective locations in this EEPROM window Activate this window by clicking On Chip EEPROM Window from the View menu You should see this window coming into view indicating contents of the memory space r alt m n Dachi EEP FF PF PF FF FF PE FR FF FF FF osag FF FF FF FF I FF FF EFF FF FF FF FF ono FE FF FEF FF FF FF FF FF FF FF FF FF FF FF Fr FF FF FF FF FF FF FF EF FF FF FE F FE FF FF FF Fr FF FF FF FF FY F FE FF FE FEF EFF FF EF FE F ir iF fr oF FF ETN AF FF FF FE FF EF FE FF FE FF Fr Fr FF FF FF Ff FF FF fF FF FF FF FF EF FE FF FF FF FF FF FF FF PF FF FF FF F The contents of this memory area are displayed along with the address The data are displayed in both Hex and ASCII format Just like other memory you can also edit the contents of this EEPROM space Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks ES 5 1 Introduction Topview Simulator comes with facility to simulate a variety of external embedded building blocks apart from the microcontroller and its on chip peripherals As a result you ca
11. clicking StepOver button till you finish debugging FRONTLINE ELECTRONICS 98 Topview Simulator Software User Guide Chapter 16 Program Execution Using StepOver Command EE 16 3 Finish Subroutine in SingleStep You can use this command to execute a total subroutine in a Single step Click SingleStep gt Finish Subroutine When this command is activated your target program is executed from the current PC value and execution continuous upto RET instruction Because of this you can notice the execution of subroutines in a single shot enabling you to debug bigger programs FRONTLINE ELECTRONICS 99 Topview Simulator Software User Guide Topview Simulator Software User Guide Chapter 17 Tutorial Ma 17 1 Introduction Topview Simulator is an easy and versatile development tool to design and complete 8031 based real time applications in less time This tutorial gives a complete picture of How to Start and Complete My Project using this simulator 17 2 How to start from the scratch You can start and complete your real time applications in few easy steps Now consider a simple application where you are expected to drive a point LED On and Off at a predefined interval The procedure is the same even if you venture into bigger and complex applications Step 1 Open the Text Editor and key in the target code Step 2 Assemble target code using an assembler Step 3 Load the
12. defined keyboard working click View gt External Modules gt Keyboard Now you can get the keyboard in the monitor enabling you to carry out simulation task Also you should see the keys with the names you allotted during initialization Ey Matrix Keyboard and Keys FRONTLINE ELECTRONICS ra Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks Ena 5 8 4 IIC RTC Window Click View gt External Modules gt IIC gt RTC Now the IIC RTC function is ready for the simulation This window displays the Real Time Clock and 256 Data bytes of RAM These data bytes are displayed in both Hex and ASCII format j 2 wine Seia ATE iih E ina MAH tw Oo ff Se 23 L EF 4S Ob 0 OF Oo om Oo PU oo us 0 oo OF 90 P Of W ok WwW r g wW p A pr gQ hi j i ob in oi j Wi in oi g wi d t d 1 Ob w Of dO OD w or aO o oo wW ho WO oF a0 ag no OF J0 wa 00 wW k Jg Oo w le g fo 06 w Of so Of OD 6 O a0 wW 6 0 oF J0 E J w gp 0 w J0 w gp w w J0 w gh A oo 1 ot w OF 00 Of OO w ao Of a0 w o of d w Dp wW p dg w gp wW p W o g wW p M or g bh DO f OF d Aa g lo o oe A le oD M ui 10 ig 010 wW Ob 0 w 00 wW Ob o o ap wW g0 WM or ap H db w Ob a i d b w db d O J i b t oP d o ob wW OF 00 Of op wW ok WW r og wW oE W pr ag Tal of ob oo l j OOD Ii ol go j 5 8 5 IIC EEPROM Window Similarly you can simulate the IIC bus based EEPROM To
13. for future reference This is equivalent to Save Setting of File menu This button saves the current editor contents to disk It is similar to Save Text File command from File menu Enables you to key in your program into the program memory of the simulator using built in single line assembler Itis same as activating Enter Program command of Memory menu By clicking this button you can make the ClearView window structure alive from the NormalView It is same as activating ClearView command from View menu This button switches the simulator window to Normal windows mode from the ClearView Windows arrangement It is equivalent to activating NormalView in View menu This button opens the Register window or sets the Register window as active if it is already opened in the background It is same as activating Register Window in View menu Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment Simulator Toolbar This opens the Program Window or sets the Program Window as active If it is hidden in the background It is equivalent to activating Program Window from the View menu This button opens the SFR Window or makes the window active if it is in the background It is same as clicking over SFR Bit Status Window from View menu This button is responsible for making Memory Bit Status Window active If this window is not available in the background a fresh window will be
14. in Full Speed To execute your target program there are two ways First one is set the PC with the starting address of your program in the Register Window Then select Run gt Go Command to start execution Second way is execute Run gt Goto This will prompt you to enter the starting address in a small window Key in the right address and press OK button to start execution Execute the Target Program in SingleStep or StepOver Mode You can control the program execution in few other ways to get more insight on how program behaves during execution You can command the simulator execute your target program line by line or execute program lines in steps You can define number of lines for one step of execution First set the PC with the correct starting address by modifying the PC in the Register Window Now click SingleStep gt SingleStep command to execute the first line of the program You can even set the number of program lines to be executed for every step when executing StepOver mode Set this here SingleStep gt Setting When you execute this command you can see the changes happened in memory area registers flags in all the respective windows All the windows are refreshed promptly and changed locations are highlighted to grab your attention FRONTLINE ELECTRONICS 108 Topview Simulator Software User Guide FRONTLINE ELECTRONICS PVT LTD 1 255C Thatha Gounder St Kumaran Nagar Alagapuram Salem 636 0
15. is indicated by another window At the end the completion of the operation will be indicated by a message as shown here Save Memory Topview Simulator Software User Guide Chapter 9 Storing the Memory Contents to Disk Storing the Memory Contents to Disk Error Message If you key in a starting address greater than the ending address then Address Error message is displayed Address Error 3 Starting Address is Greater than Ending Address FRONTLINE ELECTRONICS 73 Topview Simulator Software User Guide Topview Simulator Software User Guide Chapter 10 Using Single Line Assembler SS SEE wre eS SS SSS 10 1 Introduction You can start entering your target assembly language programs in two ways Either you can call the external assembler once you entered the raw code in the Text Editor In this case your complete target code is assembled as a whole by the external assembler or you can use single line assembler facility of the Program Window This chapter gives more information on how to use this single line assembler while keying in your application code 10 2 Using Single Line Assembler Activate the command by clicking Enter Program in the Memory menu Then you should see a small dialog box coming up in the screen asking for the starting address Address x Enter the Starting address o Cancel Enter the starting address of the program and press Enter key or click OK butt
16. program code Select and Click Code Generation gt Internal Modules gt Serial Port When this command is activated you can notice the presence of a dialog box enabling you to define your requirements Internal Module Code Generation Serial Port x m Select Routines Serialport Mode Baudrate Generator Using IV Initialization C Mode0 Mode 2 G Timer IV Transmit C Model Mode3 V Receive M SM2 2 Timar SMOD Baud rate Co C 110 C 600 C 2400 F500 S200 4 C 300 1200 4800 4400 Se400 m Mode Description Mode 3 9 Bit UART Baudrate will be variable Set by Timer Cancel Topview Simulator Software User Guide Chapter 6 Code Generation Facilities T_T __ Serial Port This window gives all possible choices available for the serial port communications Just click and select the required options and press Generate Code button to get the required program code As you can observe here the available baud rates are automatically adjusted depending upon the mode selection Timer1 Timer2 selection and the SMOD and SM2 bits You are also presented with mode description facility to aid you in selecting right choice of mode Now click Generate Code button to generate the required routine at the cursor defined location 6 3 External Embedded Building Blocks The simulator generates the required code for a variety of external embedded building blocks cov
17. required device in the drop list Select Device Then allot the port line to chip select line of the EEPROM device There is an option to include write protection for the device simulation Press OK button to complete the device configuration meant for simulating device in your target design FRONTLINE ELECTRONICS Eg Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks Enna 5 5 LED Modules You can get a variety of options covering all the possibilities when using these LED modules You can interface point LEDs Seven segment displays both multiplexed and non multiplexed displays choice of inputs like BCD or seven segment data and even colour of displays You can just embed these display modules within the target design and activate this LED module window to see the working of these modules with few mouse clicks In total you can get a maximum of 32 point LEDs or 16 digits of seven segment displays Just initialize these display modules in the given window to interface them with the selected microcontroller To start initialization select File gt External Module Setting gt LED Now you should see a dialog box comes into action to receive your configuration data z r gt Err faa IEIET Paal ITIITI Chick th check be aiibi hii LED sievai Post D Post 1 Gheck the check bos to Connect an LED Topview Simulator Software User Guide Chapter 5 External Embedded Buildi
18. setting is preferred because contents of many windows are displayed in different colours for your visual convenience Topview Simulator Software User Guide Chapter 2 Starting Topview Simulator 2 1 Introduction This chapter gives information on how to start Topview Simulator for your applications and other relevant operations In case if you need more assitance in using the simulator check online help 2 2 Device Selection Whenever the simulator is activated an opening screen comes alive in the monitor asking you to select the device operating frequency and memory options as shown here Select any one device from the combo box with the name Select Device The accompanied box displays the features of the selected device for your reference You can make sure that you selected a right microcontroller for the target application Topview Simulator Select Device x Select Device Device Features Atmel 89051 Compatible with MCS 51 Products 4K Bytes of In System Reprogrammable Flash Memory Endurance 1 000 Write Erase Cycles Fully Static Operation OHZ to 24MHZ Operating Frequency reaa pogran Mane Lock fizoooooo tt x 8 Bit Internal 12000000 ee 32 Programmable 1 0 Lines Two 16 Bit Timers Counters External Memory Setting Low Power Idle and Power Down Modes Program Memory Data Memory 4 gt pa Topview Simulator Software User Guide Chapter 2 Starting Topview Simulator Soe eS Ss
19. sieeve EEEE EAEE Loading a Program from Disk to the Simulator MEMOTy ccccccesseeeeeeeeenneees Storing the Memory Contents to Disk TATFOGU GION sei 8s E E A A et Storing the Memory Contents to Disk cccceccceceeessseeeeeeeesesseeeeeeesssteeeeeeeeess Using Single Line Assembler IMTFOGU GUO Me 222 000 fod 2a SE cede eae fasdes eee E a nae deca veniah Soca AE Using Single Line Assembler cceeeceeceeeeeeeeeeeceeeeeceeeeeeeeeeeeaaaeeseaeeeseeeeeesenaeeess Filling a Fixed Data in Internal External Memory NaNe Role LUKEA 0 a peteewererrerretrreece ree cnercrerr E EA Filling a Fixed Data in Internal External Program Memory sesser Copying a Block of Data from One Location to Other Place IMtrODUCTIONts 2 ec diev died beet teed ra eden ated reads saad eae aed aa Copying a Block of Data from One Location to Other Place ccceeeseees Program Execution in Full Speed INTOGUCTION oii iiini aieeaii anne Mathie Adena eden eG Program Execution in Full Speed cecccccceceeeeeeeeeeeeeeeeeeecaeeeeeeeeeessaeeeseeaeeetenees GOTO Commande aea a EEATT E ASAE Maatedaven Mane ResetGPu Command niieoe Weien Kaere o e A a Calculate Execution Time cccccccccscscceccesesnneeeeceesesceeeeecescnaeeeeeesscsseeeeesseesaees Initialize Machine Cycle eccceeceecceceseeeececeeeeeeeeeeeeseeeesaaaeesecaeeeeseneeeesiaaeeseeeeeseeaes FRONTLINE ELECTRONICS Topview Simulator Software User Guide Chapte
20. start the operation The completion of the operation is indicated by this message Fill Memory i Fill Operation Completed Succesfully Similarly you can fill a fixed data in data memory areas FRONTLINE ELECTRONICS a Topview Simulator Software User Guide Topview Simulator Software User Guide Chapter 12 Copying a Block of Data from One Location to Other Place i 12 1 Introduction This chapter gives you an idea on how to copy a block of data from one location to other place in both internal and external memory areas Separate commands are available to copy data in internal memory and external memory The details are given here 12 2 Copying a Block of Data from One Location to Other Place You can activate this command by selecting Memory gt External Data Memory gt Copy Now you may see a dialog box pops up at the center of the screen prompting you for the address of the data blocks Starting Address ooon Ending ddress OFF Destination Address jmo Cancel Enter the required information and press Copy command to start the operation The completion of this copy operation is indicated by this window Memory Copy i Memor Copy Completed Successfully Topview Simulator Software User Guide Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed ae 13 1 Introduction This command is one of the most used in the debugging process Topview Simulato
21. the program window You can also activate this command by double clicking left button of your mouse over the address portion displayed in the window A dialog box comes up to get the starting address FRONTLINE ELECTRONICS 19 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment ST ee 3 6 6 Set PC By this command you can set the PC with the address where you click the mouse The initialization of the PC is indicated by the yellow highlight at that instruction 3 6 7 Set BreakPoint You can set any instruction as the PC BreakPoint by this command You can get more information about this BreakPoint operations in the chapter 14 3 6 8 Remove BreakPoint If you activate this command at any specific instruction which is already set for the PC BreakPoint then that PC BreakPoint condition is removed from that instruction 3 6 9 Clear Program Memory This is another simple command to clear Program Memory area and the total space is initialized with the data FFH You can activate this command by Memory gt Program Memory gt Clear Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment SSS SSS SSeS SSS 3 7 Internal Data Memory Window Activate this window by clicking Internal Data Memory Window from the View menu This window displays the memory addresses and the contents The data are displayed in both Hex and ASCII formats When
22. these modules with the microcontroller either in 8 bit or in 4 bit bus To complete the picture you are given the facility to enable the back light LED of the LCD Module So you can completely simulate the required LCD module in your target design FRONTLINE ELECTRONICS 43 Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks aE LCD Module To start click File gt External Module Setting gt LCD You are greeted with a dialog box as shown LCD Module Setting x Select LCD 1Line x 16Characters m Data Bus Width 8 Bits C 4Bits IV Back Light Port Line Selection Cancel First select the LCD type from the drop list Then finalize the bus width you have planned to use for interfacing LCD with the microcontroller If itis required enable the back light LED by checking Back Light box Now you have to define the port lines to connect with the LCD module Press the button Port Line Selection to do this Initialize the port lines in the new dialog box that springs into screen Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks LCD Module Control Line Port Line Summary RS b P1 0 x RS P1 0 peel co sahal E P1 2 DO P0 0 Di PO 1 D2 P0 2 D3 P0 3 D4 PO 4 DS PO 5 D P0 6 Cancel First select the LCD control line from the left side drop list and select the suitab
23. 1 Line X 16 Characters 2 Lines X 16 Characters 4 Lines X 16 Characters 4 Lines X 20 Characters Topview Simulator Software User Guide Chapter 6 Code Generation Facilities LCD Module Selection Available Routines for LCM Now to Initialization Message Display Character Display 2 Digits Display 4 Digits Display Clear Display Locate Cursor Cursor On Off Display On Off Read one Byte form DD RAM start code generation for LCD modules place the cursor in program text editor at the exact location Select Code Generation gt External Modules gt LCD Code Germaen LOO Aoutines k e e e a a y ay 4 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities aT LCD Module Selection A dialog box comes up to get your selection You can also include all these routines by pressing Select All button You can press Setting button to define other display functions You are presented with dialog box in which you can select other secondary display functions LCD Code Generation Initialization You can even set default values by pressing the button Set Default Values The default values are In Options Frame Selects Clear Entire Display Return Cursor to Home Position In Cursor Move Direction Increment Display Shift No Shift FRONTLINE ELECTRONICS 58 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities aT LCD Module S
24. 16 Tamilnadu India Phone 0091 427 244 9238 243 1312 Fax 0091 427 244 9010 Email feplslm frontlinemail com www Frontline Electronics com
25. 9 Load and Save Module Setting You can keep the record of various module setting information like port line allocation peripheral initialization external module configuration in a file The file has MST extension You can save all the module setting information by clicking File gt Save Module Setting You have to select a file name or generate a new file in the dialog box that comes up for this purpose Look in E My Documents l c Visual Studio Projects Files of type Module Setting Files MST 7 Cancel Ze If you already have a reference file in the disk you can load that into simulator by using the File gt Load Module Setting Topview Simulator Software User Guide Chapter 6 Code Generation Facilities SE 6 1 Introduction This is one of the most useful and most desired facility required by all system designers This is a foolproof feature to generate required code snippets in the assembly language of 8031 microcontroller The whole task becomes very easy and simple just using the mouse and even if you are not an experienced designer you can get the required code to embed many building blocks Code generation facility is available for the microcontroller s on chip serial port and a range of external embedded building blocks Apart from easy and effective way of getting the code you are assured of very compact and tight program code meant for these building blocks And you can use this code
26. CPU Command Reset command can be used to initialize the simulated device with pre defined conditions Click Run gt Reset CPU to activate this command during simulation when the Reset command is executed following initialization is activated FRONTLINE ELECTRONICS 85 Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed SFR Name Reset Value PC 0000H ACC 00H B 00H PSW 00H SP 07H DPTR 0000H P0 P3 FFH XXX00000B XX000000B 0XX00000B 0X000000B TMOD 00H T2MOD XXXXXX00B TCON 00H T2CON 00H THO 00H TLO 00H TH1 00H FLI 00H TH2 00H TL2 00H RCAP2H 00H RCAP2L 00H SCON 00H SBUF Indeterminate PCON 0XXX0000B Reset CPU Command 13 5 Calculate Execution Time The simulator has facility to calculate the execution time of the program taking operating clock into account You need to key in both starting and ending address of the program to get the correct execution time This is useful to calculate the exact delay times whenever it is required FRONTLINE ELECTRONICS 86 Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed o aes Calculate Execution Time Click Run gt Calculate Execution Time A dialog box pops up prompting you to ke
27. G ropa co ot aR Fa ik 5i oD CATE Dig pone 74 oD ya FEO fone 30 01 6B now DETER P0186 moat 11 ob ac mi ma a E CCELI 7i 4A BCALE bjii 0017 i OF ac AE i014 Ji i iC IE bi a 11 aE DLEE Addresses Opcodes and Mnemonics are displayed in different colours for your visual convenience Keeping this window active you can enter your program line by line using built in Single line assembler You can know more information on this in the chapter 10 You can use mouse to do many useful tasks when you are in this program window Just right click your mouse anywhere in this window and you will get a pop up window that gives a list of operations you can perform as shown Edit Instruction Enter Program Execute BreakPoint Execute Set Address Set PC Set BreakPoint Remove BreakPoint FRONTLINE ELECTRONICS 17 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment E Program Window You can proceed with any of these commands by left clicking over the name of the commands Edit Instruction Enter Program Execute BreakPoint Execute Set Address Set PC Set BreakPoint Remove BreakPoint 3 6 1 Edit Instruction Using this command you can edit the disassembled program you are viewing at that time of mouse click in the program window As you know already this program window displays the raw program in the assembly language Most of the time you may use this window to read th
28. Hex file into the simulator memory Step 4 Set the LED module active by initializing a point LED at P1 0 line Step 5 Keep all the required windows open Here you need to keep program window and LED module window active Step 6 Execute the program in full speed and check for the desired results Step 7 If required execute the target program code in SingleStep or StepOver mode to observe the changes happening at various program points FRONTLINE ELECTRONICS 101 Topview Simulator Software User Guide Chapter 17 Tutorial boU ULU 17 3 Step 1 Open Text Editor and Key in Target Program Activate the simulator software select the device operating frequency define the amount of program and data memory as per project requirement Click Load Text File from File menu to open the text editor Now a dialog box comes up on the screen prompting you for the file name Enter the file name for the new file or select one from the list shown Key in this program in the editor MOD51 ORG 0000H SJMP START ORG 0050H START CPL P1 0 ACALL DELAY SJMP START DELAY MOV R0 07FH LOOP MOV R1 0FFH DJNZ R1 DJNZ R0 LOOP RET END The above code is written for the ASM51 assembler Save the entered code by selecting Save Text File from File menu Now your program is ready for further action FRONTLINE ELECTRONICS KA Topview Simulator Software User Guide Chapter 17 Tutorial OMNA 17 4 Step 2 Ass
29. LECTRONICS 65 Topview Simulator Software User Guide Chapter 7 Developing Target Program Code T S SS SSS Developing Target Program Code You should start the program entry by opening the Text Editor Click Load Text File in the File menu for this A file open dialog box will appear on the screen to prompt you to select an existing file available in the disk or enter a new file name and then press Open button Look in ja User3 Modules Testing fa gl c adriai 2 Keyboai BCDExtMult2To4 a FlashLED a Keyboar a BCD withinttux0 a i2ceeprom a Keyboar a Bedwithoutmult a i2erte a Keyboar a BCDwithoutmultiplexer a im seg a led4bit a em seg a imbed a LCDSBI El Feame TT Files of type Source Files ASM x Cancel a Now the Text Editor comes alive as shown here Fisslieg the LED comrectad at port line PI 4 umring CFL isstruci icn Dai pat LEi vili get Elesbed vit a m kime of i ome aml aldi tias of 1 see OEG OIN FLISHL L Fla Complement the Lees st port line Pt d LOCALI DELAY Dalar dor ere oomi appro SIHF FLASH Boiss eG Donon CELAT H Bu F05H Li HOF Fi _S0FEH TF BOV F2 A0FFH Hoe ibs cont La WHT fla Tacreeeet ES and check for sero EHZ FL Decrement El srd check for zaro DIE I L Cecragert 90 ard check for zero RET EET Topview Simulator Software User Guide Chapter 7 Developing Target Program Code a a Developing Target Program Cod
30. Microcontroller Peripheral Simulation Al SAPOGUCTION SEE PE EEE ATE bat cuuer tails wattledadbet soe AE cnvd baa eabese thud ae 27 AQ NO NWA OW E E E saan ee A E dee Caesarea 27 4 3 Serial Port Wind OW eerie E E RE A A 29 4 4 Serial Peripheral Interface WiNdOW cccceeceeeeeeeee cesses eeeaeeeeeeeeeeeeeeeeesiaaeetee 31 4 5 On ChipsEEPROM ston ential Gitte tiie ni aaa nat ene a 32 Chapter 5 External Embedded Building Blocks Bet MMLFOCUCUION eneee e ed vebeedi cd hehe veteus ockd a e sopharabele id vetecudetehl ha eabell it bed eelrt shel eg 33 5 2 Activating Building BIOCKS 000 a eta AE E A E ANETTE ATELA EEA 33 BS WIGIDEVIC e Shn sash tele Se aia a aa E a a A A N a 34 5 4 SPLIDOVICES sisien ann enn in aed ae eee tie 36 5 5 CED MOGUIGS 2 6 2 ciceipste cheetahs ee eee teeta este 38 gosi PON CED Shaa a rs Seca Ste Me aee euteenet eee A Reece 39 5 5 2 Seven Segment LED DisplayS eeceeceeceeeeeeeeeeeeeeceeeeecaeeeeeeeeeeeeaaeeee 39 56 Koyboard Modules eessen ee eea e ciel ceneledibd E EEA ENE 41 Bel ECD Mod UE e ea ate eee ae a ee eee ee ee ee ee 43 5 8 Activating External Embedded Modules 0 ccceceeceeeeeeeeeeeceeeeeeeeeeeeeeeeeeeeeaaeees 45 578 1 BED WIN W wesc site ea eel ie Aare al eee ee 46 5 8 2 LOD Window 0 eee ecceceeececeeeeeeeeeeeeeeeeeeeaaaeeeeceeeeeeaeeessaaaeeseceeesseaeeeesiaaeetee 46 5 8 3 Keyboard Window serii s E E AN N e 47 D84 MGCRTCWINJOW ficiis aiii iia a eee a EA 48 5
31. O P3 4 T1 P3 5 T2 P1 0 few selected I O functions like Timer Clock Inputs interrupt lines INTO P3 2 INT1 P3 3 at their respective I O pins The drop list at these pins give these special functions So you can manipulate different I O conditions Timers Clocks Interrupt options in this I O window 4 3 Serial Port Window You can enable this serial port window by clicking Serial Port Window from the View menu The serial port window gets opened or becomes active if it is hidden in the background B Serial Port Topview Simulator Software User Guide Chapter 4 Microcontroller Peripheral Simulation SSS aaa Serial Port Window You can also notice the presence of a simulated host in the serial port window This one is an useful facility to check proper working of your serial port in the external environment This simulated host may function as external computer s serial port or act as a serial port of another 8031 microcontroller in a multiprocessor communication mode Serialport Transfer Mode Setting Ea Transfer C Manual Byte From File File Transfer Filename D Atmel T opview Simulators SerialPortT estFile dat Browse Cancel There is a provision to send and receive test data between the microcontroller and this simulated host Either you can manually key in test data byte by byte or send the same from a file kept in your hard disk For your convenience separate buff
32. OH i Wg oT dG Se OOOO 100 iF D Fa i FF ay Eid 1T FT my mi TE FF wy pi 1a 1 oy mi 0s FE nw Eri ioe F ti p i m FF m pi iiit FE i E Zu FF aaa 9 ie F Ea lan H A i zs a ip z ghiar Eh Ac a0 Than dD TEO Srl ob POON THONI TIED EFCH SPER SFSR Tiii SLEPT 0000 BPTRO bidt CFTR DRDD 3444 H A amp ki For the example you can notice the ACC contents as the BreakPoint value 80H FRONTLINE ELECTRONICS A Topview Simulator Software User Guide Chapter 15 Program Execution Using SingleStep Command E 15 1 Introduction You can use this SingleStep command to analyze the target program line by line in complicated situations It enables you to get the total picture of changes happened in Registers Internal External memory for every program line execution The GUI of ClearView promptly indicates these changes in highlights to draw your attention 15 2 Program Execution Using SingleStep Command This facility makes you understand the behavior of the target code when you develop complex applications Activate this command by this sequence SingleStep gt SingleStep The current PC contents are taken as the starting address of the program So keep the program address in PC before activating SingleStep command When you activate this command first instruction gets executed and the simulator refreshes all the windows with the current informat
33. Setting gt IIC Bus Now you should see the following dialog box IIC Bus Setting Ed V Enable Bus Control Line Port Line Summary SCL P3 0 RTC Setting EEPROM Setting Cancel First check the Enable Bus to activate IIC bus Then select the port lines for the IIC bus signals SCL and SDA You can notice other two buttons RTC Setting and EEPROM Setting to start configuring both RTC and EEPROM devices When you click RTC Setting you get a dialog box in the screen prompting you to configure the RTC device Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks aT IIC Devices IIC RTC Setting EI AO MV Use System RTC Time Cancel Now click the box Connect Device to Bus to include this device in the IIC bus Then set the address line AO to either as 0 or 1 level You can even select the PC system clock as RTC reference It may help you in getting the RTC with current time indicating facility Press OK button to include the selected IIC device into the design When you need to have IIC based EEPROM click EEPROM Setting in the first dialog box IIC Bus Setting You should be greeted with another dialog box as shown here IC EEPROM Setting Saed Device araon Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks a IIC Devices You need to include this IIC EEPROM device into the bus by enabling
34. Simulator Software User Guide Chapter 9 Storing the Memory Contents to Disk SEE SSeS 9 1 Introduction Here you will know about the way to store the memory contents of the simulator in the disk You can save this memory block in both Hex and Binary formats 9 2 Storing the Memory Contents to Disk Activate this save command by clicking Save Memory in File menu You can see a dialog box coming up in the screen asking the following information Starting Address Ending Address File Format Either Intel Hex or Binary Memory Either Program or External Data Memory Starting Address poon Ending ddress 0o00 m File Format Memory Intel Hex Program Memory C Binary C Data Memory Key in and select suitable format and press Save button to proceed further Now another window pops up to get your file name Either create a new file or select an existing file and then press Save button FRONTLINE ELECTRONICS 71 Topview Simulator Software User Guide Chapter 9 Storing the Memory Contents to Disk Storing the Memory Contents to Disk Save Memory 24x ea Teoven senior eB fe a eeprom a Keyboa 1 Extern 1 a Keyboa 2 ExtermalCodeKeyboard Keyboa 3 Z Testingmodules l2erte 1 Led4bi 1 2 User3 Modules Testing a l2crtc 2 a Led8bi 1 Hex Files Hex Then a small window comes alive giving a progressive display of save operation and the completion of the operation
35. Topview Simulator Software User Guide Chapter 14 Program Execution Using BreakPoints aaa Program Execution Using BreakPoints Just double click at the required address under BP indication to define that particular address as PC BreakPoint Simulator accepts this assignment by displaying the indication B at that address location You can also set this PC BreakPoint by right clicking any instruction or its address in the Program window Select the Set BreakPoint from the pop up window You can remove any BreakPoint that has been already defined by the same way Just right click at that BreakPoint and select Remove BreakPoint from the pop up window To give you more clear picture of this BreakPoint execution an example program is given here 0000 MOV A 00 0002 INC A 0003 SJMP 0002 This small program increments the Acc from 00H to FFH continuously Set a BreakPoint to break the program flow when ACC gets the value 80H Activate BreakPoint Execution by clicking Execution in BreakPoint menu The program execution is stopped when the BreakPoint condition is met and all the windows are refreshed and you can see the changed Registers Memory locations with highlights FRONTLINE ELECTRONICS ot Topview Simulator Software User Guide Chapter 14 Program Execution Using BreakPoints a pee BSS Program Execution Using BreakPoints Ee Ussy Wes fun Beard Gages Dems iede He stelle le a a OP ioe ined 4 d my a fid
36. UN Er p05 OOR JEFF OF LIEZ ID FE EON ki FF tO Gs i FE DIEZ Fa aoii eg E FA IWE Pe Hons w FI DIEZ R7 aoi Of i RET 10 5 iT sor ET i HEE FF mw Fri foie FF soe kii mg FF ny Fr idii FE L Fe od fe i 13 3 Goto Command CFTR DEOD TEE TETEE FE EF a This is almost similar to Go command But you can use this as a short cut during program executions Whenever you activate this command it may ask for a starting address of your program Execute Program x Enter the Program Starting Address You can use this command as a short cut in following conditions FRONTLINE ELECTRONICS 84 Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed E Goto Command Suppose you are debugging a lengthy program and you keep the ClearView configuration as active You have to either scroll up or down to define the PC with the starting address Here just click Goto command in the toolbar and enter your target address to execute the code Also assume you have different program modules at different places of your memory and PC has to be loaded with right address every time Here also you can initialize the PC with the correct address in just one step Other operations of this Goto command are similar to Go command Now you can appreciate various full speed execution possibilities when using Topview Simulator that save your valuable development time 13 4 Reset
37. activate this press View gt External Modules gt IIC gt EEPROM This window can simulate any of the following AT24C01 AT24C02 AT24C04 AT24C08 AT24C16 If the write protection is enabled the contents are displayed in green colour otherwise they are in black colour GO 2 sin Smia EOOH ATIATI Lii Oo w OF aU OF uo OD EU OF u M uo a OF JU 1 on bo Ob 9 OU gg wW op A r le op WwW E ag i j ob oo wa J w Ol lO J k W i 10 1 oo bo Ob 8 w 6 wW lh le COs a0 an no w Ob Jg wa oo oo o J w Ok J fo OO fo OF A0 w o0 wM OC 20 oE 6 M OG W OF a0 El OF wW OF ap pa 00 w op o or 0 w oo wm or ag m Oo fo OF 80 OF ODO wM O 0 oA a0 M o0 W oF d0 FRONTLINE ELECTRONICS KJ Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks i 5 8 6 SPI EEPROM Window Windows meant for SPI bus based EEPROM devices AT25C010 AT25C020 and AT25C040 can be simulated by activating the command View gt External Modules gt SPI gt EEPROM Now the SPI EEPROM window gets opened or becomes active if it is already in opened state D Sr EERO AT 20m0 You can notice the display of contents the EEPROM devices in both Hex and ASCII formats If the write protection is enabled the contents will be displayed in green colour otherwise they are displayed in black colour FRONTLINE ELECTRONICS 49 Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks i 5
38. d display operation Now another dialog box opens up to enable you to complete this configuration This window also provides a summary box to give you the complete initialization information LED Module Port Line Sehection F Segment b a PUL x Cegerant ad CR ae a Once you complete this task press OK button to proceed further After selecting all the required display functions press Setting button to start setting task Now you should get a window giving you all the options that you need to consider for the display functions FRONTLINE ELECTRONICS 55 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities a S aa LED Display Functions Code Generation Internal Multiplexed 7 Segment Input Eg m Select Timer for Periodic Interrupt Generation Timer 0 Timer 1 Timer 2 Memory Usage Internal Starting Memory Address for Routine Use jad Internal Memory Area used 40H to 43H Cancel In this window you can select any of the three available timers and also the memory location where temporary data will be kept Press OK to finish this setting When you return to the parent window press Generate Code button to generate the program code at the defined place 6 3 2 LCD Module Selection Topview supports all possible LCD interfacing options and you can exactly define your requirements Following choices are available Display Module Types
39. d in SingleStep menu Activate the SingleStep setting command SET It is same as Setting command of SingleStep menu QO f S Topview Simulator Software User Guide ELECTRON Q ja JEB S B Y T m m Ti j Chapter 3 Topview Simulator GUI Environment Simulator Toolbar This is About command Same as Help menu s About command Cuts the selected text in the Editor Copies the selected text into the Clipboard Same as activating Copy command in Edit menu Pastes the text kept in the Clipboard into the Editor Equivalent to Paste in Edit menu Find command meant for the Text Editor Runs the external Assembler It is equivalent to activating Run Assembler from the Command menu Closes all the opened windows in a single command Same as Close All of Window menu Stops the program execution Same as Stop Execution command from the Run menu Gives a Reset signal to simulator Same as Reset CPU command from Run menu m m O be O Z O 7 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment SSS SSeS SSeS SSS 3 3 ClearView Window Structure This is an optimized arrangement where windows are strategically placed in the display Total display area of the monitor is divided into 5 windows Windows meant for Program Register Internal Data Memory External Data Memory and SFR Bit Status are placed in the ClearView
40. e You can store the contents of the current editor into the disk using Save Text File command of File menu From keyboard use Ctrl S to activate this command Suppose if you want to store these contents in a new name select Save Text File as command from File menu Then another window pops up to get your file name Either create a new file or select an existing file and then press Save button You can enter the program code line by line The editor supports colour syntax facility Because of this you can visualize different parts of the program address mnemonic data and comments in different colours At this stage you have to configure the activation of many tasks associated with the external assembler Now you select Run Assembler from Command menu and a dialog box comes up inviting you to select different options Run Assembler Ed Enter Path and File name of Assembler D Atmel T opview Simulatori T estingmodules 4sm51 exe MV Capture Assembler Output IV Pass Current File name to Assembler V Run Assembler Directly from Toolbar IM Open List File after Assembling Cancel V Load Hex File after Assembling IV Save Current Editor File before Assembling Topview Simulator Software User Guide Chapter 7 Developing Target Program Code a a Developing Target Program Code If you want to capture the assembler output check the Capture Assembler Output box To pass the current text editor file name to as
41. e by line and call routines by ACALL and LCALL are treated as single line During the program flow this command executes these routines in a single shot As usual all the windows are promptly refreshed after every program line routine execution Key in and execute the following program using this command 0000 MOV A 00 0002 ACALL 0006 0004 SJMP 0002 0006 INC A 0007 RET This program increments ACC from 00H to FFH It calls a subroutine to increment ACC contents Initialize the PC with the address OOOOH Activate the StepOver command from either menu bar or toolbar The first instruction moves data 00H to ACC and the program flow gets stopped Now PC becomes 0002H Press StepOver button again to execute current FRONTLINE ELECTRONICS ma Topview Simulator Software User Guide Chapter 16 Program Execution Using StepOver Command nS Program Execution Using StepOver Command instruction ACALL is executed in one step and PC points to the next instruction at 0004H idia 400 n L rad mm HI g KCAL DIDE TECI He ME Ee SOM di 10s 1 THC i Poon loi iz FET Tac tora TT oY FT TIHU Lilie FE mF F i SPCR TODA TF soy ET Sroe 1E FF n EE GPSA inig FE i kii THS Tes FI my Fr EDIFF 0ND Tite FE ay Fi DETRD bi my i OPTRI DEDO 374441 FE EF Trigger StepOver command again The ACC content is incremented by calling the routine at 0006H in one step Now PC becomes 0004 instead of 0006 Keep
42. e target program from the memory of the microcontroller But if you need to develop or key in your target program right from the scratch you have to use the single line assembler or the external assembler You can know more of this in the coming chapters So this Edit Instruction is suitable for making small changes or editing only few instructions in the program window You can change a 3 byte instruction into a 2 byte or 1 byte instructions You can t change a 1 byte to 2 3 byte instructions for obvious reasons When you change a 3 byte instruction into 1 2 byte instructions the remaining locations are filled with NOP 00H instruction FRONTLINE ELECTRONICS 18 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment SS FFF ee MMM Edit Instruction You can also activate this Edit Instruction command by double clicking left mouse button over the exact instruction in the window 3 6 2 Enter Program Activating this command enables you to enter your target program using built in single line assembler Detailed information is available in the chapter 10 3 6 3 Execute BreakPoint This command takes you to the BreakPoint execution Details are available in chapter 13 3 6 4 Execute This command is for executing your target program in the microcontroller and you can get the complete picture in chapter 13 3 6 5 Set Address You can set the starting address of the program list in
43. election Display On Off On Cursor On Off On and Cursor Type Blinking Then you can click OK button to return to main code generation window In this main window you have the option to use simulator settings as your initialization For this click Use Same Setting as in Simulation Now you need to select the display type from the drop list and also the nature of data bus width You can also select port lines to interface with the selected display type Press Port Line Selection button in the main window LCD Module Port Line Selection x Control Line Port Line Summary RS P1 0 x RS P1 0 ea co enh al E P1 2 DO P0 0 Di PO 1 D2 P0 2 D3 P0 3 D4 P0 4 DS PO 5 D P0 6 Cancel In this window select the required port lines from the drop list and you can verify your selection in the accompanied summary space Click OK to return to the main window Now press Generate Code to get the new assembly code meant for the required LCD functions FRONTLINE ELECTRONICS EJ Topview Simulator Software User Guide Chapter 6 Code Generation Facilities eS 6 3 3 Keyboard Interfacing You can generate the required assembly code to read the pressed key of matrix key pad You can define following key matrices 12 keys arranged in 4 X 3 matrix 16 keys arranged in 4 X 4 matrix 32 keys arranged in 4 X 8 matrix You can also define the port lines that can be used to interface this matri
44. emble the Program Using an Assembler Now you know that Topview Simulator uses an external assembler to assemble raw keyed in program code If the program length is small you can even use simulator s built in single line assembler Here it is assumed that we use the external assembler to assemble the program lines So to assemble the contents of current editor file click Run Assembler from Command menu A dialog box pops up to prompt you to decide on few operations Run Assembler x Enter Path and File name of Assembler D AtmelT opview Simulators T estingmodules 4sm51 exe lV Capture Assembler Output lV Pass Current File name to Assembler V Run Assembler Directly from Toolbar IV Open List File after Assembling Cancel MV Load Hex File after Assembling MV Save Current Editor File before Assembling Set the path meant for the external assembler using Browse button To capture the assembler output check the Capture Assembler Output box To pass the current editor file name to assembler as command line parameter check the Pass Current File name to Assembler box FRONTLINE ELECTRONICS 103 Topview Simulator Software User Guide Chapter 17 Tutorial pe SSeS Assemble the Program Using an Assembler Check the Run Assembler Directly from Toolbar to run this command from the toolbar without opening this dialog box next time To open the list file after assembling check Open List File after Assemb
45. ering a wide range of applications LED Display functions LCD Module Selection Keyboard Interfacing IIC Bus SPI Bus All these external modules can be interfaced with any I O line of the microcontroller as you do in real design There is absolutely no restriction in using these modules with any I O line of the controller FRONTLINE ELECTRONICS 53 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities eS 6 3 1 LED Display Functions For interfacing external LED displays many functions are available Initialization Message Display 1 Digit Display 2 Digits Display 4 Digits Display As usual activate program text editor and place the mouse cursor at the exact location where LED display function is required Select Code Generation gt External Module gt LED gt 7 Segment Display When you execute this command a dialog box appears on the screen to prompt you to define your selection Code iencaation Seven Segment Display Aeulines Topview Simulator Software User Guide Chapter 6 Code Generation Facilities a EET LED Display Functions Carefully select the required display function by checking various options There is another provision made available in the dialog box to use the same setting as you have already defined in the simulator Then click the button Selection of Port Lines and Number of Digits to configure the controller s I O lines for the selecte
46. ering the starting address The status of this binary file loading is indicated by another window Load Data G File Loaded Successfully If the entered address exceeds the available data memory capacity the error condition is indicated FRONTLINE ELECTRONICS 24 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment 3 9 SFR Bit Status Window Activate this command by clicking SFR Bit Status Window in View menu You can see this window comes into action indicating SFR contents in bit wise along with their names You can also edit the contents in the window E Regletertar oe Gbara i Word Feu 1 3 10 Memory Bit Status Window In this window the bit addressable Internal Data Memory 20H 2FH contents are displayed in bit wise along with their bit addresses You can also change the content of any bit when this window is in active condition NTLIN ELECTRONICS 25 Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment Memory Bit Status Window a irk uat Een Bir3E Witte So far you have been informed about the basic GUI environment of the Topview Simulator Apart from these there is a facility to visualize all the internal peripherals of the selected microcontroller in the suitable windows You can also simulate external embedded building blocks meant for LEDs LCD serial buses like IIC SPI keyboard RTC and
47. ers of 255 bytes are maintained for both transmitter and the receiver These buffers keep 255 bytes last transmitted and received Also keep in mind that this external host serial port also operates at the same baud rate of controller s serial port So it saves you from worrying about defining characteristics of the external serial port Topview Simulator Software User Guide Chapter 4 Microcontroller Peripheral Simulation a 4 4 Serial Peripheral Interface Window This window is meant for studying or interfacing SPI port facility available in the devices AT89S8252 and AT89S53 Just like serial port here also you can use an external SPI port as a master to initialize communication with the target controller s SPI port You can start this facility by clicking Serial Peripheral Interface Window from the View menu Now you should see this window coming into action j Serial Peripheral Interface OF x Slave SPDR Tr SPDR Rr A A zi zi Master External SEDRCTE I SPDR Rr You can observe the external SPI configured as a master You can key in the test data in the SPI s transmitter and observe the same coming into controller s receive buffer Just enter your data in the blank space and press the send button Last 255 bytes transmitted or received at the controller s SPI port are available for your verification FRONTLINE ELECTRONICS Eg Topview Simulator Software
48. even Segment LED Displays You can also use an external multiplexer for this purpose Now let us start configuring these seven segment displays First select the display interface type Multiplexed or Non Multiplexed one You check the correct box in the interface selection area When the multiplexed display is required you can select the multiplexer in drop list of Select Multiplexer Available options are 2 to 4 3 to 8 and 4 to 16 Then select the colour of the display red or green and the display type common anode or common cathode Also decide upon type of data input meant for the displays 7 Segment or BCD You need to configure port lines in correct way to get these multiplexed display pattern To proceed with this setting click the button Selection of Port Lines and Number of Digits Now another window pops up to enable you to complete this initialization task LED Module Port Line Sriectinm Ho of Digis Contec Line Prot Lire Summan iG Dig A roo Digiti amp P0 0 i Digiti B P0 1 Digitl C FO Z2 Digiti D FO0 3 Digiti dp PO 4 Digit P0 5 Digit BH FD amp Digit C PO Digitz D P1 3 Digit dp Fl d ELECTRONICS Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks a Seven Segment LED Displays Select the number of digits and then go ahead with defining the port lines meant for this display configuration You can verif
49. gram execution Using this setting the screen update timing can also be set Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed E Program Execution in Full Speed To get an idea on this Go command enter the following program 0000 CPL P1 4 0002 ACALL 0050 0004 SJMP 0000 0050 MOV R7 05 0052 MOV R6 7F 0054 MOV R5 FF 0056 DJNZ R5 0056 0058 DJNZ R6 0054 005A DJNZ R7 0052 005C RET This program will flash the LED connected at port line P1 4 Now initialize the PC with the starting address of the program Then click Go form Run menu or click over Go button in the toolbar You can notice the LED connected with the port line starts flashing at an approximate interval of one second The program execution can be stopped by clicking over Stop Execution button or pressing Esc key When you stop any execution all the windows are refreshed and the PC at that moment of execution of stop command is highlighted as shown here FRONTLINE ELECTRONICS 83 Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed Program Execution in Full Speed Seeded re OSES Bs brag Yea Gee Ineo ieoetee Das wide Hath Fi THE Srl ob a BG FF GPD BteeT NEHOD TECH ZFF Til Or Poon OD 3 FF THi Ob TOON Oo TIKO EPCR On Eiga d SPER THOM 7 g j p 2 DPTRO ORD Bol EA agja olah dar BP a A fog e 0S E
50. in highlights using different colours to grab your attention FRONTLINE ELECTRONICS 94 Topview Simulator Software User Guide Chapter 15 Program Execution Using SingleStep Command 15 3 SingleStep Setting The number of steps i e number of instructions to be executed for the SingleStep and StepOver commands can be set using this command To activate the command select Setting from SingleStep menu SingleStep Setting Ea Number of Steps i Cancel When the command is activated a dialog box will appear on screen prompting the number of steps program lines Enter the number of steps and press Enter key or click OK button to set the value FRONTLINE ELECTRONICS 95 Topview Simulator Software User Guide Topview Simulator Software User Guide Chapter 16 Program Execution Using StepOver Command U OM ee ee ee 16 1 Introduction This is another useful command meant for debugging your complicated target code This is similar to the SingleStep command in operation but it takes routine calls as a single instruction You need not execute all the instructions of the routine line by line The complete routine is executed in a single shot Other instruction lines are executed line by line like SingleStep execution 16 2 Program Execution Using StepOver Command To activate this command select StepOver from the SingleStep menu This command executes your program lin
51. in any place of your program flow without any additional effort 6 2 Internal Peripheral Functions Topview Simulator sports the required code generating facility to use the on chip serial communication port in all possible modes When generating code for the external embedded building blocks other on chip peripherals like I O ports Timers Counters are automatically considered in implementing these building blocks Getting the required target code is very simple Just keep the program editor in open and keep the cursor at the right place in your program flow Then activate the relevant code generation dialog box and define your exact requirements Press Generate Code button to get the target application assembly code at the cursor defined place FRONTLINE ELECTRONICS 51 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities ES 6 2 1 Serial Port You can get the required routines meant for serial port communication Initializing serial port Transmitting data using serial port Receiving data at the serial port You can use this serial port in all possible modes Also you can employ either Timer 1 or Timer 2 for generating different baud rates To start code generation facility first either open an existing program file or create a new program text file by clicking File gt Load Text File Place your mouse cursor in the program text editor where you want to insert the generated assembly
52. in your next 8031 project you are assured of definite savings in time and increase in productivity FRONTLINE ELECTRONICS Ea Topview Simulator Software User Guide Chapter 1 Introduction to Topview Simulator i alU alU Introduction The features of the simulator are briefly tabulated here Device Selection A wide range of device selection including generic 8031 devices and Atmel s AT89CXxX series 8031 microcontrollers Program Editing Powerful editing feature for generating your programs and the facility to call an external assembler to process input programs ClearView GUI Environment ClearView GUI facility gives all the internal architectural details in the strategically placed windows Information about the Program Data Memory Registers Peripherals SFR Bits Memory Bits are clearly presented in many windows to make you understand the program flow very easily Program Execution A variety of program execution options include Single Stroke full speed execution SingleStep StepOver and BreakPoint execution modes give you total control over the target program ClearView updates all the windows with the correct and latest data and itis a convenient help during your debugging operations You may find how this Topview Simulator simplifies the most difficult operation of the program development debugging into a most simple task Topview Simulator Software User Guide Chapter 1 Introduction to Topvie
53. ion and stops the execution and starts waiting for the next command For this command the shortcut key is F7 So press this to execute the next instruction or click over SingleStep in SingleStep menu The following example helps you to understand fully this SingleStep command 0000 MOV A 00 0002 ACALL 0006 0004 SJMP 0002 0006 INC A 0007 RET FRONTLINE ELECTRONICS 93 Topview Simulator Software User Guide Chapter 15 Program Execution Using SingleStep Command e Program Execution Using SingleStep Command This simple program will increment the ACC from OOH to FFH It calls one subroutine to increment ACC contents After entering the program in memory initialize the PC with the address 0000H Activate the SingleStep command either from menu bar or tool bar The first instruction MOV A 00 moves the data 00H to ACC and the program is made to stop PC value becomes 0002H as shown in the fig TOON on ihe i F SJ ia Std 10 bs 1 INC i POON Tite tz HET TOO 20 10ra TT my oe TIHO nia FF Eir Fr EPCR 100A TF ir ET SPuer ME FE ry Rr SFR On init FE rii kri Tiai Tes Fl ny RTs SEF 0000 titi FF Biy Eri BPTAO biii T i CFTR DEOD Ce i i 3444 3444 EEEE E a g F Fr F i mo H amp 7 hy ij 4 ay fy H fj on To execute the next instruction you can activate SingleStep command again You can notice that all the windows are refreshed with the current information
54. le port line at the right side The Summary box indicates the summary of your port line initialization at the right side Press OK button to complete the port initialization Also press OK button in the LCD module setting window to complete LCD interfacing task 5 8 Activating External Embedded Modules After initializing external modules you need to keep required modules active to visualize the working in your target design You can notice all the changes happening in these modules FRONTLINE ELECTRONICS 45 Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks 5 8 1 LED Window In this window you can see the point LEDs and the seven segment displays in action LED and 7 Segment Displays ioj Xx e O 080 8 O P2 0 P2 1 P2 2 P2 3 P2 4 P2 5 P2 6 P2 7 Digit Digit Digit3 Digit4 To activate this window click View gt External Modules gt LED When you click on this command the LED window gets activated and starts showing working of LEDs and Seven segment displays in your target application 5 8 2 LCD Window Click View gt External Modules gt LCD Now you should see the LCD window coming to the front and starts showing the working of the defined LCD module in your application j LCD 4 Lines X 20 Characters Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks i 5 8 3 Keyboard Window To get your
55. ling box To load the assembled program into the simulator check Load Hex File after Assembling box To save the current editor file before passing to assembler check the Save Current Editor File before Assembling box Click Run button to start assembling If the capture assembler output option is enabled then the assembler output is captured and displayed as shown here D Oupa PISI Croza 4zssablar Tarazian 1 fo Copright 1334 1765 1986 1987 137E 1769 1990 by Bstalink Corporst icm First pess Second pi AEN ASSEHELY COHFLETE 0 ERRORS POOMD If there are any error you can view the list file and correct the same When the Load Hex File after Assembling option is enabled then the target program is automatically loaded into simulator s memory and is indicated by this summary window FRONTLINE ELECTRONICS 104 Topview Simulator Software User Guide Chapter 17 Tutorial S EEE Se SSS Assemble the Program Using an Assembler File Loading Details x File Loaded Succesfully Loading Details 17 5 Step 3 Load the Hex File Into Simulator Memory Now you need to load the assembled Hex file into simulator memory for execution In the previous step if you have already enabled Load Hex File after Assembling option the target program file will be automatically loaded into simulator memory Otherwise suppose if you have a fully assembled Hex file ready for the simulation then you need
56. n Full Speed If you enable the Execute from Current PC choice the current PC value will be considered as the starting address for the program execution Otherwise the program starting address will always be taken from the user defined PC value in the Setting option If the first option Execute from Current PC has been enabled then each time you have to set the PC value Program execution from the current PC option is helpful when using BreakPoints in your development When the debugger stops the program flow at the BreakPoint value you can continue program execution without redefining PC contents again There are two ways to set the PC value When right clicking your mouse over the correct address in the Program Window you get a pop up window giving few options You select Set PC to initialize PC with that particular address Now that instruction is highlighted with yellow colour to indicate this step The second way is to enter the right address into PC in the Register Window If the second option of the Run menu setting Execute from Given Address is enabled the starting address for the PC when using the Go command will always be taken from the user provided information of the setting This second method is very helpful in the occasions when you are debugging a program module from the fixed address in which case you need not define PC for every execution During repeated program debugging just press Go button to start the pro
57. n less time The details are given in the subsequent chapters and now this chapter introduces this GUI environment to you 3 2 Simulator Toolbar Topview Simulator uses many user friendly windows to implement an effective GUI interface When you activate this simulator an opening screen prompts you to select the target microcontroller Once you select the microcontroller the dialog box disappears leaving behind a blank screen with the Tool Bar and a Menu Bar For your convenience the tool bar is given below and a short description on each command buttons The simulator gives you same explanation about each of these buttons whenever you keep mouse cursor over that button melee hes A waaa a a e E e a This command loads the program from the disk into the program memory of the simulator The file may be either in Hex or Binary PROG format It is same as activating Load Program from the File menu C This button loads a text file into the Built in Editor This is same TEST as Load Text File from File menu FRONTLINE ELECTRONICS 9 Topview Simulator Software User Guide m n m be il m s E r m VE ci f 2 O Z n Chapter 3 Topview Simulator GUI Environment Simulator Toolbar This button saves the memory contents of the simulator in the disk It is similar to Save Memory command of File menu Makes the computer remember the current windows position and size
58. n start and complete your total applications in the software So simulating these external embedded building blocks will save good amount of your project development time You have facility to simulate IIC standard EEPROM SPI bus EEPROM IIC bus RTC Point LEDs Seven Segment LED Displays or a range of keypads upto 4 X 8 matrix and LCD modules So without waiting for the target hardware you can finish your project using Topview Simulator 5 2 Activating Building Blocks Embedding these building blocks in your target design is very simple and you need not do anything specific for this Just complete your design as if you are using external building blocks like switches LEDs LCD modules etc Also complete the initialization for all the selected blocks This initialization can be done in a graphical environment And keep all the windows of the predefined modules open Then execute your target program in the simulator Now you can see all the selected embedded building blocks spring into action and you can see the working of your target application in the simulator itself FRONTLINE ELECTRONICS 33 Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks ea 5 3 IIC Devices Topview simulates most common IIC devices RTC from Philips PCF8583 and the Atmel s EEPROM devices AT24C01 AT24C02 AT24C04 AT24C08 AT24C16 To start initialization select File gt External Module
59. ncluding the Analog Comparator available in AT89C1051 You can also watch the analog comparator output at the corresponding output pin A much bigger I O window is available for the 40 pin devices This window comes with all the 4 ports of I O lines with facility to simulate timers counters at the respective I O pins Interrupt conditions can be simulated at your will at any time During program execution you can make this I O window active and using your mouse you can simulate any I O condition and watch for the expected results at the relevant I O pins Activate this I O window by clicking I O Window from the View menu Depends upon the device selection right I O window comes up in the monitor for your usage FRONTLINE ELECTRONICS na Topview Simulator Software User Guide Chapter 4 Microcontroller Peripheral Simulation ee MM VO Window Seer Ps Fas All I O pins have three options Level 0 Level 1 and NO CONNECTION You can leave any I O pin open as you do in real time Depending upon your output selection all output conditions are promptly indicated in the window If you leave any I O pin in NC then corresponding input represents the output latch level poii ja aaraa Seah zine ial oe i caka Faaa f w oe Fa Topview Simulator Software User Guide Chapter 4 Microcontroller Peripheral Simulation ee VO Window You can notice the availability of special functions at T2EX P1 1 T
60. ng Blocks a 5 5 1 Point LEDs A maximum of 32 green or red coloured round shape point LEDs are simulated assuming all the port lines are available for these point LEDs Now you can set the port lines meant for the LEDs activation level and the colour of the LEDs Just click in the respective check boxes to connect the point LEDs at the selected port lines Then select the required activation level either 1 or 0 level for those LEDs Last choice is the colour of these point LEDs Note that only a single colour either red or green is available for all the defined LEDs So in three simple steps you can configure your target point LEDs at the respective port lines at right signal levels 5 5 2 Seven Segment LED Displays In the seven segment LED displays following options are available Non multiplexed displays with BCD input Non multiplexed displays with 7 segment input Multiplexed BCD input displays with internal multiplexer Multiplexed Seven Segment input displays with internal multiplexer Multiplexed BCD input displays with external multiplexer Multiplexed Seven Segment input displays with external multiplexer In this it is assumed that you simulate the internal multiplexer using program and the port lines When you simulate the multiplexer in software you can get more number of displays FRONTLINE ELECTRONICS 39 Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks E S
61. on Now the blank Program window gets opened Another dialog box will appear at the centre of the screen for keying in program instructions as shown FRONTLINE ELECTRONICS 75 Topview Simulator Software User Guide Chapter 10 Using Single Line Assembler e SSS SSS Using Single Line Assembler Start entering your target program line by line and keep on pressing Enter key or click over Store button to store program in the memory At the end of the program entry press Esc key or click Cancel to complete this operation Note This single line assembler doesn t support any label assignment Topview Simulator Software User Guide Chapter 11 Filling a Fixed Data in Internal External Memory ae En 11 1 Introduction This chapter gives more information on filling a fixed data in a block of memory spaces in both internal external data program memory areas Separate commands are available to fill both internal and external memories Filling operation is same for both memory areas 11 2 Filling a Fixed Data in Internal External Program Memory Activate this command by selecting Memory gt Program Memory gt Fill When this command is activated a dialog box will appear to get the starting address ending address and the data meant for the fill operation Program Memory Fill x Starting Address ooon Ending ddress ooFF Fill Data fod Cancel Key in the required information and press fill button to
62. opened E It is same as activating the Memory Bit Status Window from View menu This button opens the External Data Memory If the window is hidden at the background it is brought to front again It is equivalent to activating External Memory Window from View menu This button is responsible to make the Internal Data Memory as active E You can use Internal Data Memory command from View menu for doing this FRONTLIN ELECTRONICS n Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment Simulator Toolbar This button executes your program in full soeed taking PC contents or user defined address already set as the starting address El You can activate this command by Go from Run menu Executes your program in full speed after getting the starting address using a dialog box oTO It is same as activating Goto from Run menu It enables you to define the BreakPoint EF SET It is equivalent to Setting from BreakPoint menu Executes your program in BreakPoint mode taking the PC contents as starting address El It is equivalent to Execution command of BreakPoint menu Executes your program in SingleStep mode taking PC contents as starting address TEF Itis same as activating SingleStep command from the SingleStep menu Executes the program in StepOver mode taking PC contents as starting address ac It is also available by clicking StepOver comman
63. pter 3 Topview Simulator GUI Environment SEW MMTPOGUCTION aade e aian aai anaa aaa eaa aaa aa e eaa aaa E a aas 3 2 Sim lat r Toolpar heersen EE E EE ENE EANA 3 3 ClearView Window Structure ecceeeeeeeeeeeeeeeeeeceeeeeeeeeeseaeeesetaeeeteaes 3 4 NormalView Window Structure cecccccececeeececeeeeeeeeeeeeeeaeeesseaeeeteaes 3 5 Register Window aeara a E S 26 Program WiInNdOW erie beg as e E ETES EAE ENNEA 3 6 1 Edit INStructiOn c a 00 nae iini aair a L6 Enter Program oar oA ANE AAE NSA E 3 6 3 Execute BreakPoint sssssssssrrrseesrsrrreserrrnnnessrnnnnnnnerrnnnneeenna 3 6 4 Execute ima ie aa aai a aaae a 3 0 0 St Addr ESS a aeae tai a a a ieee hee 3 676 SPO paan a a a 3 6 7 Set BreakPoint eseria ea E E E EEE 3 6 8 Remove BreakPoint sersrsresirceririn nesei eneen RaR eken E 3 6 9 Clear Program Memory sssssssssssssisssrsssrrrsssrrrsrrrssrrsssrrnsssrnnns 3 7 Internal Data Memory WINndOW ssssssssssssssrisssssrrrrsssrrrrnsssrinnrnsssrrnnnnnno 3 8 External Data Memory WiNdOW sssssssssssssisssssssrrrsssrrirnrsssrinnrnnssrrnnnnns 3 8 1 Load Data Into Data Memory sssssssssssssssrrissseesrrrsssrsrrnsssne 3 9 SFR Bit Status WINdoOW 00 0 cece ee ceneee eect eceeeeeeeeeeeeeesaaeeseeeeeeenaes 3 10 Memory Bit Status WiINGOW cccceeeeee cece eeeeeeeeeeeeeeeeeaaeesenaeeeeeenes 3 11 Load and Save Screen Setting cecceecceeceeeeeceeeeeeeeeeeseeeeesenaeeeteaes Topview Simulator Software User Guide Chapter 4
64. r using right GUI features gives more information during the execution of this command enabling you to get the complete picture This chapter gives more details about this most important and used command 13 2 Program Execution in Full Speed Topview Simulator gives you total control on the program execution You can execute your target program in many ways You can execute the program ina single shot indicating the starting address of the program You can make the simulator to execute the program upto a BreakPoint and then analyze the contents of various registers or the desired memory locations May be you can execute the program line by line using SingleStep command or execute subroutines in a single step by the StepOver command Simulator gives you the required flexibility in controlling the application code execution and now we are going to see how to execute the program in single shot in full soeed Run menu gives commands meant for full speed program execution Go and Goto Run menu also carries setting option to define address selection required by the Go command Before using Go command click Setting and define your choice in the address of Program Counter Sekect Opliana l Esse fom Cured PE m Esse hom Given Address Pigon Sharing Adama Somn Upisa E Enbe Tiere Bete ic Updates in Secor CEJ m Topview Simulator Software User Guide Chapter 13 Program Execution in Full Speed E Program Execution i
65. r 14 Program Execution Using BreakPoints MAAS UMEPOGUCTION ENTE PEE hecchabeeces Ped eabeedeiehl subse it TEE E 89 14 2 Program Execution Using BreakPoint ee eectneeeeeeeennneeeeeeeeeaaeeeeeeeeeaaees 89 Chapter 15 Program Execution Using SingleStep Command TaT INtroductOnawsiaa nadia eatin nll ad ina aide 93 15 2 Program Execution Using SingleStep Command cccceeeceeeetteeteeteeeeeeneees 93 15 3 SingleStep Setting c ccceccai itis nad lee ae ee ed 95 Chapter 16 Program Execution Using StepOver Command WIGHT UMtrOGUCTIO Me Sa ei Asche EAEE ele aa ia EEA AE te ann an ea 97 16 2 Program Execution Using StepOver Command 0 0 2 ceeceeeeeeeeeeeeeteeteeteeeeeeneees 97 16 3 Finish Subroutine in SingleStep ccececcceeceeceneeeeeceeeeeeeeeeeseaeeeeecaeeeseneeeeenaeees 99 Chapter 17 Tutorial AZ SD MNOHO anessen an a a dels cues Gia etetee EE ct eerie 101 17 2 How to start from the scratch 0 eeeecceceeceeeeeeeeeneeeeeaaeeeeeeeeeseeeeeesaaeeseeneeteeees 101 17 3 Step 1 Open Text Editor and Key in Target Program ccccceeeeeeeeeeeeees 102 17 4 Step 2 Assemble the Program Using an Assembler cccseeeeesteeeeeees 103 17 5 Step 3 Load the Hex File Into Simulator Memory eee cent ereeee 105 17 6 Step 4 Set the LED Module Active by Initializing a Point LED at P1 0 106 17 7 Step 5 Keep Required Windows Active cccceseceeeeeeeeeeeseneeeeeeaeeseeeeeeeeees 107 17 8 Step 6
66. sembler as command line parameter check the Pass Current File name to Assembler box Check the Run Assembler Directly from Toolbar box to run this command from the toolbar without opening this dialog box every time To open the program list file coming out of the assembler check the Open List File after Assembling box To load the assembled program into the simulator memory check the box Load Hex File after Assembling To save the current editor file before passing it to the assembler check the Save Current Editor File before Assembling box Apart from selecting all the above mentioned you have to define the path of the external assembler using the Browse button Now click Run button to run the assembler When this command is activated if the capture assembler output is already selected then the assembler output file is captured and displayed as shown below in a separate window 051 Cromm dAmeenhbles nom 1 sth to Copyriakt 1304 1785 1906 1397 1 FRE 17097 14 by HeteLiak Carparation Firat para Sand prs LSSEHELY OORPLETE 0 ERRORS FOLD ELECTRONICS Topview Simulator Software User Guide Chapter 8 Loading a Program from Disk to the Memory 8 1 Introduction This chapter gives you an idea about loading a file from the disk into the program memory of the simulator You can import both Hex and Binary files into the simulator 8 2 Loading a Program from Disk to the Simulator Memory
67. target code line by line You can also download any input program from the disk Then you can make use of any external assembler software to assemble the keyed in program code lines 7 2 Developing Target Program Code You can call a third party external assembler package to assemble your input program lines The simulator captures the output file coming out of the assembler and displays the same in a separate window for your convenience You can activate this only when using NormalView When you get assembly errors you can keep both Text Editor Window and the Assembler output window side by side to analyze the output file It is a convenient feature helping you in debugging process We have tested the simulator with freeware cross assembler supplied by the Atmel ASM51 The assembler is made available in the accompanied CD ROM Actually this ASM51 is a DOS program But when you call this assembler through simulator you need not open DOS window separately Assembling and data capturing tasks are handled by the simulator itself You really don t know that everything is happening in the DOS environment Then you can even load the assembled program straight into the simulator memory You can configure the whole process of developing the program and then loading the same into simulator memory in a single step This is an important and time saving feature that helps you save time during repeated debugging operations FRONTLINE E
68. the Connect Device to Bus check box Then select any one of the five possible EEPROM devices from the right side drop list box Also select the addressing for the lines AO A1 and A2 Press OK button to complete initialization of the selected EEPROM devices If you want to protect the memory device against unwanted writing activate the Write Protection option in the window 5 4 SPI Devices Topview also simulates SPI bus based EEPROM memory devices from the Atmel range AT25C010 AT25C020 and AT25C040 These devices can also be configured for either 3 wire or 4 wire interfacing Activate this command by this sequence File gt External Modules gt SPI Bus As usual you get a dialog box at the center of the screen to start initialization SPI Rut Seling Bus Selection I Enable SPI E Jwe dine Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks a SPI Devices First enable SPI bus by clicking Enable SPI Bus check box Then decide whether you need 3 wire or 4 wire interfacing option Allot port lines for the SPI control lines SCK SO and SI Press EEPROM Setting button to proceed with device configuration SPI EEPROM Setting x V Connect Device to Bus IV Write Protection Select Device Select Chip Enable Line aT25C010 a Po 2 x Cancel In this new dialog box you need to check Connect Device to Bus box to include the EEPROM memory device into the bus Select the
69. to use Load Program command from File menu A dialog box may appear to get the file name Enter or select the file name and click Open button The progress of the file loading is indicated in a window along with a summary FRONTLINE ELECTRONICS KA Topview Simulator Software User Guide Chapter 17 Tutorial _ lt _ lt ie 17 6 Step 4 Set the LED Module Active by Initializing a Point LED at P1 0 line To activate LED module click File gt External Modules gt LED A dialog box comes up to enable you to initialize different LED display options LED Mandak Sethrmg Here check the box corresponding LED box at P1 0 port line and also select the activating level Click OK button to complete the task Topview Simulator Software User Guide Chapter 17 Tutorial lt es 17 7 Step 5 Keep Required Windows Active You need to keep all relevant windows active to visualize the working of these embedded building blocks For this tutorial you have to keep Program Window and the LED Window in active condition Click View gt Program Window to get program window in open E Pinpam Select LED Window by clicking View gt External Modules gt LED BLED ard 7 Segrem Deplage Another active window comes up to indicate the selected LED FRONTLINE ELECTRONICS 107 Topview Simulator Software User Guide Chapter 17 Tutorial 17 8 Step 6 17 9 Step 7 Execute the Program
70. u can generate assembly code meant for reading from IIC device and writing to IIC device The IIC may be a RTC or an EEPROM Keep the mouse cursor in the program text editor at the correct place and select Code Generation gt External Modules gt IIC Bus E You can generate relevant code meant for following devices IIC RTC PCF 8583 IIC EEPROM AT24C01 AT24C02 AT24C04 AT24C08 AT24C16 Check suitable boxes and press Generate Code button to get the assembly code at the required place FRONTLINE ELECTRONICS 62 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities a 6 3 5 SP Bus Here you can generate assembly routines to read SPI bus EEPROM device and also to write into same device Keeping the cursor at the exact place select Code Generation gt External Modules gt SPI EEPROM You can define your selection in the dialog window that appears in the front Cade G tie SPA EEPAROH Hauliets A press of Generate Code button at the end of your selection pastes the required code at the place where you kept the mouse cursor Topview Simulator Software User Guide Topview Simulator Software User Guide Chapter 7 Developing Target Program Code a RE 7 1 Introduction Topview Simulator gives you facility to develop your programs right from the scratch Simulator s built in text editor takes care of program entry operations You can simply key in your
71. u can see the complete name of the register and you can edit the contents by clicking over the register contents The cursor starts blinking wherever you click You can modify the register contents at that place When you enter any data the same will be automatically transferred to that particular location Spasial Fubotion Regiebers GFRS acces how OC w Prosraa Comer PCI wi B Ragistar P w Prosten Status Wari PSN OL Steck Poa SP oF Dats Printeri DETE fant Port OiP FF Bowe 105 FF Port FPZ FF Port 30P 25 FF Taibsrrapt Priority Comte Reyieterd IF w leterrapt Baeble Reyistami IEI w Tiber Commer Bode Regier i THON 2 Tike Coan ey otro Register TOON Ti a P a a Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment T EE SSS SSS SSS SSS Register Window If you reduce the size of this Register Window the window will reconfigure itself as shown here Speclal Fubotion Regia bera act ih z mj Ly H E7 3 6 Program Window You can open this window by clicking Program Window in the View menu If the window is in the background it now becomes active and comes to the front This window disassembles the program memory contents as shown in the figure Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment T E SSS SSS Program Window m i paw ro 9l oo EY a0 nnd 7G AG OE EOF 160 auta 41 ce ACAL W
72. w Simulator E Introduction Simulation Facilities Powerful simulation facilities are incorporated for I O lines interrupt lines and the clock sources meant for Timers Counters Many external embedded building blocks can be simulated Range of Plain Point LED s and Seven Segment LED Display options LCD modules in many configurations Momentary ON keys Toggle Switches A variety of keypads upto 4 X 8 key matrix All modes of on chip serial port communication facility IIC components including RTC EEPROMs SPI Bus based EEPROM devices Code Generation Facilities Powerful and versatile code generating facility enables you to generate the exact and compact assembly code for many possible application oriented interfacing options You can simply define your exact needs and get the target assembly code ata press of button at anywhere in your program flow The code gets embedded into your application program automatically You are assured trouble free working of final code in the real time All modes of the serial port Interfacing IIC SPI Bus devices Range of keypads Many LED LCD interfacing possibilities FRONTLINE ELECTRONICS 3 Topview Simulator Software User Guide Chapter 1 Introduction to Topview Simulator ES a 1 2 System Requirements The Topview Simulator operates in windows 95 98 environments The required hard disk space is about 5MB Computer with colour monitor 800 X 600 pixel resolution
73. with any specific port lines check the corresponding boxes Also define the activation level at the right side Similarly you can initialize the required toggle switches at the required port lines When the keypad is required select the right key matrix and then press button Port line Selection This leads to another configuration window in which you need to set the port lines to the key matrix FRONTLINE ELECTRONICS 42 Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks ee Keyboard Modules Select the proper key matrix control lines and set them to the port lines as per your design requirement Once it is done press the OK button to complete the keypad initialization Another interesting and useful feature is the availability of naming facility for the individual keys of the keypad To get into this facility press Key Name Setting button in the main window Here also you are presented with another dialog window In the window select the key and define the required name in the opposite side Once the naming ceremony is over then press OK button to complete the task 5 7 LCD Module Topview Simulator supports popular Dot matrix LCD modules and by few mouse clicks you can embed them into your target design The following LCD modules are supported 1 Line X 16 Characters 2 Lines X 16 Characters 4 Lines X 16 Characters 4 Lines X 20 Characters You can interface any of
74. x keypad You can even define the memory location where you want to get the value of the pressed key As usual keep your mouse cursor at the required place in the program editor where you want to get the target assembly code Select Code Generation gt External Modules gt Matrix Keyboard Now you should see a dialog window comes up to get your inputs Code Generation Keyboard Routines Topview Simulator Software User Guide Chapter 6 Code Generation Facilities Keyboard Interfacing When you check the box Use Same Setting as in Simulation key matrix defined already during simulation will be retained as such If you want to redefine a new key matrix leave this box unchecked Select the required key matrix and press Port line Selection to define the port I O lines for that keyboard You can see another dialog box pops up to get your port configuration meant for that key matrix Matix Keypad Port Line Selection x Control Line Port Line Summary Column3 Po 6 Rowl P0 0 Row2 P0 1 Row3 P0 2 Row4 P0 3 Column P0 4 Column2 P0 5 Column P0 6 Cancel Select the port lines and click OK button Now you return to the main window and you need to press Generate Code button to get the required and optimized assembly code to read the pressed key of that key matrix NTLI ELECTRONICS 6 Topview Simulator Software User Guide Chapter 6 Code Generation Facilities 6 3 4 IIC Bus Yo
75. y in both Starting and Ending address of the program Execution Time Calculation x Program Starting Address 0o00 Program Ending Address OOFF Cancel Click Calculate button to start the process Now another small window indicates the execution time and also the number of machine cycles Press OK to quit this command 13 6 Initialize Machine Cycle This command can be used to initialize the counter that indicates total machine cycles to zero Click Run gt Initialize Machine Cycle You should see the total machine cycle counter initialized to 0 at the right corner of status bar FRONTLINE ELECTRONICS 87 Topview Simulator Software User Guide Topview Simulator Software User Guide 88 Chapter 14 Program Execution Using BreakPoints i 14 1 Introduction This type of program control is another way to keep track of your programs behavior during execution You can make the simulator watch for a specific data in any memory location register when the target program is executed When the desired value is reached in the target location register simulator stops the program flow and refreshes all the windows with the current information to enable you to check for the desired results 14 2 Program Execution Using BreakPoints You can set a BreakPoint in many places thanks to the Simulator s flexible defining facility Program Counter Any of these registers ACC B
76. y this configuration data in the summary box at the right side After completing all the initialization press the OK button to embed this Seven Segment LED module into your design When you keep the LED module window in active state you should see the displays working as per your design requirements during simulation 5 6 Keyboard Modules Keyboard modules can be used to define simulate interface Momentary keys Toggle switches and Matrix keyboards Following are possible in the keyboard module A maximum of 32 momentary keys can be connected to the ports You can even select the activation state for the key closure either as an 1 or 0 level A maximum of 32 Toggle switches Three types of keypads are possible 3 X 4 matrix keypad 12 keys 4 X 4 matrix keypad 16 keys 8 X 4 matrix keypad 32 keys As you can understand embedding these keys switches keypads depends upon the available port lines in your target design To start this configuration select File gt External Module Setting gt Keyboard FRONTLINE ELECTRONICS at Topview Simulator Software User Guide Chapter 5 External Embedded Building Blocks a Keyboard Modules You can see a dialog window comes up at the screen to enable you to proceed further Keyboard Module Setting Pyyry yyy pees Bi m mj mj m mj m m Bi m mi m m mj mj m PeEerrerery T ITITITI Mi m mi m mi mj m m Mi m mi m mj mj mi m To get the momentary keys interfaced
77. you are using the ClearView you can see the contents of this window in either one of these formats To change the contents from one format to another right click your mouse anywhere in the window and select the suitable option from the pop up window You can also edit the contents in this window Frost lirs N at Q A on Z wn i Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment SSS SSS SSeS SSS 3 8 External Data Memory Window To open the external data memory window or set external data memory window as current active window this command can be used To activate this command click External Data Memory Window from View menu When you click this command the external data memory window gets opened or becomes active if it is in the background This window displays the contents of the external memory along with the address The data are displayed in both Hex and ASCII formats EE FF 4 65 aD foo A FF FF OFF A Fe FF FP FF FF F FF FF FF FF FF FF FF FF FF OFF FE FE FE FF FF FE PF FE FF FE FF Fr Fr FF Fr FF ir FF FF FF Fr FF FE FF FF FF FF EF FE FF FE FF FF FF rr FF FF m FF FF FF FE FF FF FE FE FF FE FE FF FF F FE FF ir IE mm FF rr ir OFF E F mm mF FF FF FE FF FF FF EF FE FF FE FF Fr FF rr oF FF Fr FF ff FF fF FF FF FF FF FF FF F EF FE FF FF FF FF FF FE FF FF FF PF FE FF FF FF FRONTLINE ELECTRONICS 22 Topview Simulator Software User Guide Chapter 3 Topview
78. ze No Extemal Data Memory C 16K C 4k C 64K 8K Cancel You can choose any option out of possible seven and click OK button Press OK button to close the Select Device dialog box and the simulator will be set according to the selected device All the generic features like internal program memory size clock speed will be assigned with the selected values Also all the peripheral functions of the device are enabled by default Now the simulator is ready to get into action Some settings and status are displayed in the status bar Current Register Bank Current BreakPoint Status and the Total Machine cycles count FRONTLINE ELECTRONICS 7 Topview Simulator Software User Guide Chapter 2 Starting Topview Simulator i 2 3 Simulator Operations Apart from above mentioned simulator has plenty of operations File operations Memory operations Window operations Program Execution operations BreakPoint SingleStep operations Activating Internal External interfacing options You can know more information on these in the next chapters Topview Simulator Software User Guide Chapter 3 Topview Simulator GUI Environment SEE M 3 1 Introduction Topview Simulator sports an extensive and user friendly GUI environment using many windows to present the information in a more productive way There are shortcut ways to combine many operations in single steps to enable you implement repeated tasks i
Download Pdf Manuals
Related Search
Related Contents
BenQ MX701 User Manual Turntable - Advance Lifts, Inc. USER MANUAL - MPP Solar Inc Samsung SGH-E790 Manual de Usuario Fig. 6 - RED technology programming - LiftMaster Btec100 - Blista 1124-600-P Bria Android Edition User Guide Copyright © All rights reserved.
Failed to retrieve file