Home
COP8™ Development Tools
Contents
1. 4 1 Figure 9 The EPU also retains a trace of most recent 100 frames that occurred in the execution cycle In addition to the trace content of the internal registers and stack condition of the input output ports and memory content RAM and ROM are also available A breakpoint is added by clicking on the code line and then clicking on Toggle Breakpoint A breakpoint is enabled when a small sguare appears to the right of the instruction address Fig 10 Using the EPU you can enable up to 32k breakpoints A breakpoint can be cleared by selecting the set breakpoint and clicking on Toggle Breakpoint a second time Here we will add a breakpoint at line 21 and line 24 Line 21 and Line 24 are where the subroutines are called 15 COP8 QUICKSTART COP8 EPU Development Tools COP8 QUIC KSIART Step 7 Running the Code Note that the EPU is an in circuit simulator as opposed to the more common in circuit emulator While the in circuit emulator runs in real time the in circuit simulator is controlled by software executes instructions one at a time and runs much slower approximately 10 KHz Instruction fetch and trace are performed within the PC with the microcontroller code memory loaded cycle by cycle over the serial port Execution speed is primarily a function of baud rate Itis good practice to reset the microprocessor before starting the simulation This is done by selecting RunlResetlProcessor Selecting RunlGo
2. Toggle bit 0 1 5ms X A PORTD Output changed port bit JP Restore These interrupts are not used in the program NotUsed They do nothing JP Restore endsect Vector Table This is the table which corresponds to the ISR s above There is a typical ISR table in page 3 4 Interrupts of the feature family user s manual Make the edit to the table as required sect Interrupt TABLE ROM 5 0 1 Vector Table Now Define where the interrupt are going be at We start at location 0x1E0 Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw TimerlA Service Addrw NotUsed Addrw NotUsed Addrw NotUsed Addrw NotUsed COP8 QUIC KSIART 23 COP8 EPU Development Tools Assembly Code Continued endsect HE GN WC A GI DO This section of code is given the name delay Register COUNT1 is is initialized to a count of OxFF The DRSZ instruction decrements COUNT1 and compares the result to zero If zero the jump instruction back to LABEL is skipped and the delay routine is exited sect delay rom DELAY LD COUNT1 0FF LABELl DRSZ COUNT1 Decrement COUNT1 skip if zero JP LABEL1 RET endsect NW Y SR This section of code is given the name toggle and is placed in ROM The exclusive OR instruction is used to toggle bit 1 of output
3. choose Disable or Enable t eck Halt Mode For testin urposes C Crystal internal bias resistor disabled Enabled E purp C Crystal internal bias resistor enabled C Disabled _ Cancel choose Disable The clock Crystal option is chosen by Extemal Enabled B 5 RC Oscillator selecting Clock Option Disabled For testing purposes Power Reset Size Security Watchdog choose RC Oscillator The Enabled S54 Bytes OEnabled Enabled 0 128 Bytes Disabled C Disabled clock configuration on the target hardware will determine Figure 13 the selection of External Oscillator RC Oscillator or Crystal Oscillator Enable the POR Power On Reset circuit by clicking on the Power On ResetlEnabled The RAM size selection is not available for the SGR EPU If the program has not been loaded then select Load to load the program into the EPU so that the COP microprocessor can be programmed This is not necessary if the program has been loaded as part of the debugging process the otp will program from the same memory that was used by the debugger for simulation Programming the COP microcontroller is accomplished by selecting FilelProgramminglAutomatic and clicking on the Start Operation This first checks that the COP device is blank programs the code and Configuration ECON and Signature registers and verifies the programming by reading the just programm
4. there are no assembly errors link the program If there are assembly errors an error map is displayed If no error s occurred then a display such as the one in Fig 8 will be given Large embedded microprocessor projects freguently contain more than one file module each of which is assembled separately The Assembler outputs are then linked together and tested as a whole WCOPS IDE has a make function that assembles only the files that have changed and then links the files to produce the symbolic output ready for loading into the EPU or other MetaLink emulation tool For this feature select ExecutelMake or click on the make icon WCOPS IDE provides for consolidation of all of these modules as a project and includes several features for the orderly processing of these multiple modules This example set up as a project even though the source is a single file module nevertheless illustrate the principles of project management Chapter 8 in the WCOPS IDE User s Manual Using the WCOPS IDE in Project Mode covers these additional features in detail Step 2 Debugging and Testing Software on the EPU Module We will now setup WCOPS IDE so that it will recognize the MetaLink iceMaster Debugger Click on ProjectlProject Settings Double Click MetaLink tools Click on Window COPS Emulator Click on Browse button and locate where MetaLink s debug program is located A path program name similar to e metalink whp2380 whp2380 exe should be found A
5. Begin by identifying all the parts of the system Locate the serial connection cable base unit a power supply there should be two for the EPU and a 40 pin ribbon cable with a header The setup should look like Fig 2 110V Power Supply Serial Cable Install Disks Wi EPU Base Unit EPROM Samples Header Cable 220 Power Supply Figure 2 2 Connect the power supply module 110V or 220V to the EPU Plug in the power supply but do not turn on the power yet 3 Connect the serial cable to the PC and then connect the other end to the EPU module This is shown in the Fig 3 COP8 QUIC KSIART COP8 EPU Development Tools Serial Port Keyboard Port Power Supply 110 220 Volts Video Port Network Port EPU Module Serial Cable Figure 3 4 Install the ribbon cable with the 40 pin header onto the connector J1 on the EPU 5 Click on the Start menu select Programs select WCOPS IDE and the program will start COP8 QUIC KSIART COP8 EPU Development Tools COP8 QUIC KSIART The Quick Start Exercise The sections which follow demonstrate the typical steps and procedures for entering and modifying a program written for the COP8 Assembler running the Assembler and Linker downloading the program into the Evaluation and Programming Unit EPU for purposes of debugging and eliminating errors and finally programming a COP microcontroller EPROM or OTP part We m
6. Bm Computer o 8 9 3 Floppy A H E 55 Floppy 8 H E Wallace C 5 08 Audio CD 02 E a Zip 100 E 3 backup CJ Cops i Eg Weops fg Example ir Plugins i Template L 2 Metalink E whp2380 fg Examples gt S Control Panel si Printers gg Dial Up Networking i 7 Recycle Bin Asmcop exe smcop hlp femread me iae smrel let a Cop8 inc Cop820 asm Cop820 inc Cop8201 h a Cop820a asm Cop820b asm Cop820cj inc Cop840 inc Cop840cj inc Cop8620 asm Cop8620 h 1 Cop8620 inc 0008620 lib Cop8520 m 008640 inc 8780 a Cop88D inc Cop888bc inc ia Cop888cf inc Cop888cg asm 0088808 inc Cop888cl inc Cop888cs inc Cop888eb inc 0088888 inc Cop888ek inc 0088886 inc Cop888fh inc Cop888gd inc Cop888gg inc Cop888gu inc Cop888hg inc Cop888kg inc 008300 inc Cop8saa inc Cop8sab inc 008530 inc Cop912c inc ae Copxxx fil Copxxx h Copxxx1 h Copxxx2 h Hexdiff exe Hexlm exe Install exe E Dumpcoff exe r Libcop exe Libcop hlp 3 Lmhex exe E Lncop cfg 3 Lncop exe Lncop hlp 3 Promcop exe 1 Runsamp bat 5 Sample bat Xerc out 61 object 881KB Disk free space 10 4MB Figure 1 COP8 EPU Development Tools Installing the EPU 1
7. function key F4 causes the processor to run to the next breakpoint and stop Select RunlGo Source lt 1 gt Eile Options View Assemble Toggle Breakpoint Run Until 0003 BCEAE8 LD TMR1LO X E8 0006 3 LD TMR1HIEX 03 0009 BCECF4 LD TIRALO XF 4 000C 1 LD T1RAHI X01 DOOF LD TIRBLO X ES 0012 BCET703 LD T1RBHI 8x03 0015 BDD46B RBIT 3 PORTGD 003 0018 BDD57B SBIT 3 PORTGC 0003 0018 1 LD PSW X 11 001 BDEE 7C SBIT 4 CNTRL amp oT1C0 0024 D ADO200 JSRL X 0200 0027 F8 JP X 0021 0028 DOFF LD FO X FF DD2A CO DRSZ FO 0028 FE JP X 002A 002C 8E RET INTR WBTrace 1 i ol xi File Options View Search 36 0000 3 LD 0 E 33 0003 3 LD TMR1LO 8 30 0006 3 LD TMR1HI 3 27 0009 3 LD TIRALO X F4 24 000C 3 LD T1RAHI XOT 21 0D0F 3 LD T1RBLO 8 18 0012 3 LD TIRBHI X 03 15 0015 4 RBIT 3 PORTGD GD3_T1A 11 0018 4 SBIT 3 PORTGC 003 7 0016 3 LD 4 001E 4 SBIT 4 CNTRL amp T1CO mmm Instruction About to be Executed 0021 JSRL X 0028 CEI ap Figure 10 Select WindowlTrace to use the EPU trace facility This allows the user to view the instructions that have been executed prior to the breakpoint After arriving at the breakpoint and enabling the Trace function you should have a window similar to that of Fig 11 This is important when verifying instruction execution based on branches within the program A
8. window similar to Fig 9 will now be displayed Project Settings quick prj Lx T nee H NSC assembler NES COPS Emulatoi T Byte Craft C compiler MetaLink Windows COPB Emulator MetaLink tools DOS EPU Eweteiniwhp2380wnp2380exe___ DOS Debug Module DOS iceMASTER DOS iceDEMO iceSIM Windows 8 Emulator Use command line parameters National COFF file cof Intel HEX file Vv ok Cancel PX Jnheiit Project Settings Figure 9 12 COP8 EPU Development Tools COP8 OUIC KSIART Click on the box next to the sentence Use command line parameters Click on the selection National COFF file cof parameters Click Ok when done Connect the ribbon cable with the header pins to the target hardware in this case the LED and resistor to J1 In a typical application the supplied cable will be used to connect between EPU J1 and the microprocessor socket on the target hardware Power up the EPU and click on DebuglWindows COP8 Emulator to activate EPU and the PC A window will pop up asking you to select a project directory Select a directory and click OK A Select Chip window will pop up Select the 8SGR 40 pin configuration as the Emulation Device and Click OK Another window will pop up asking for a communications port COM1 COM4 in which the EPU is connected to Click the appropriate COM port and click OK The specific d
9. C 00 0036 00 PORTFP FF 0037 00 tw WDSVR 1 0038 00 WKEDG 00 0038 00 INTR WKEN 00 003A 00 INTR WKPND FD 003B 00 INTR PORTLD 00 0030 00 INTR PORTLC 00 E PORTLP 5 MIRAM Memory 1 l Status lt 1 gt xg PORTGD 00 WET Els onion PORTGC 00 BC EC 7B BE 58 F6 23 7B BO 5D DE 83 4A 62 X 0x0000 PORTE 5 02 000 9F 60 4E CEAE 4F 6 71 1 mN d 0x0000 01 26 0056 19 31 010 BT 9C 38 77 42 ET 14 CT 10 30 11 16 48 23 2B D aus 42 32 020 13 77 SF 2E BF 48 52 33 B4 BO B9 0C 97 w_ Count resels el RIO EL 030 EA 9F DDF3 06 53 TF 77 75 42 75 40 CB 6A 7B S wuBu Repetition Count Eod 43 040 7D B1 25 43 30 76 B5 EA 0 C Ov Emulation Status Weed 96 50 73 48 40 050 ET 84 BC 47 55 DBDF 33 C2 18 11 10 D3A1 GU 3 Trace Status 080 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF Trace Read 070 SIOR 00 TMRILO FF 080 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF Figure 12 Clicking on the Configuration button will bring up another window Fig 13 which will allow a detailed configuration of the microcontroller For the 40 pin devices the configuration of the COP device must be finalized 18 COP8 EPU Development Tools COP8 OUIC KSIART Select Security and then PROM Programmer Configuration Options x
10. COP8 Development Tools QUICKSTART FOR THE EPU March 1998 COP8 EPU Development Tools REVISION RECORD REVISION RELEASE DATE SUMMARY OF CHANGES A 03 98 First Release The information contained in this guide is for reference only and is subject to change without notice No part of this document may be reproduced in any form or by any means without the prior written consent of National Semiconductor Corporation Copyright National Semiconductor Corporation 1998 COPS is a trademark of National Semiconductor Corporation PC is a trademark of International Business Machine Corporation iceMaster is a trademark of MetaLink Corporation Windows and Windows NT are trademarks of Microsoft Corporation InstallShield is a registered trademark of InstallShield Corporation COP8 EPU Development Tools COP8 QUIC KSIART 4 5 2 What you need Computer and monitor 486 or higher PC with at least 8 MB RAM 16 MB recommended a hard disk with at least 20MB of free disk space and a mouse Windows TM 95 Windows NT or Windows 3 11 running in enhanced mode The descriptions in the document will assume a Windows 95 environment Optional Printer A LED Light Emitting Diode and a resistor at least 330 Ohms Installing ASMCOP Linker Lib MetaLink iceMaster Debugger and WCOP8 IDE Begin by clearing the memory by exiting all tasks Identify any resident programs by lowering the mouse cursor to the tas
11. ake the assumption that you are somewhat familiar with embedded microcontrollers software text editors and assemblers and some form of debugging tool By following this document closely you will be able to create one example of a working set of firmware even if you ve never developed software for a microcontroller No previous experience with COP8 microcontrollers is required to understand and use the example program The first step in developing T imer application software is to carefully counter 0 specify the operational requirements Flow charts or some other technique Delay Subroutine A Note on Developing Software can be used to document the program sequences in the software such as the one shown in Fig 4 Fig 4is a high level idea chart that we will use for our exercise program In many cases new application software is written by modifying existing software A sample program main asm supplied with WCOP8 IDE is used for our example Using Windows utilities click and drag are easiest copy the example to your quick project directory WCOP8 IDE allows you to organize software development into projects The following briefly delineates the steps to set up a project Yes Switch LED D 0 Is counter 0 counter timer 0 Switch LED D 1 3 sec have elapased Figure 4 COP8 EPU Development Tools WCOPS IDE x File Edit View Search Options Debug Exe
12. cute Window Help ee 259 Open Project Close Project Save Project As Add File s Remove File 3 Project Settings Rescan For Tools CERNI Se Figure 5 Launch the WCOPS IDE by clicking on the Start MenulPrograms WCOP8 IDE WCOPS IDE will scan the hard drive for ASMCOP LNCOP PROMCOP and ByteCraft s COP8C compiler when it is ran for the first time It will then create the appropriate settings for your machine Select ProjectlNew Project and on the New Project window Fig 5 locate the directory c cop8 project quick At the File Name prompt type in main prj This will be the project name of our lesson Click OK and the Project Files window appears Fig 6 COPS QUIC KSIART COP8 OUIC KSIART COP8 EPU Development Tools WCOPS IDE Iof x File Edit View Search Options 2722 Debug Execute Window Help T um Project 4 7 E 2 5 te a wm 3g EX aS Close Project Save Project As Add File s Remove File Project Settings Rescan For Tools A D Project e cop8 wcop8 example main prj Project E e cop8 weop8 example main prj Files Figure 6 Select ProjectlAdd Files Select main asm as the only file for this project Click OK and the The project main prj has been created and consists only of the one file main asm Click on the main asm icon and edit
13. dler s the timer interrupt handler software is given the and is located at address 0xFF All interrupt the COP8 family must start at location oxFF The instruction is used to toggle bit 0 of output port D The timer pending flag PSW bit 5 is set whenever a timer interrupt occurs and must be cleared by the interrupt handler Interrupts are disabled whenever an interrupt is detected RETI is a special return instruction which re enables the interrupts This section name intr software for exclusive OR Save the state of the registers before jumping to the Interrupt Service Routine Note The COP uses a Vectored Interrupt Structure versus E a polled interrupt structure sect intr rom abs 0xff 00FF Start at interrupt address This is needed to store the state of the CPU before the jump to the ISR Save PUSH A Push Accumulator contents onto Stack LD A B PUSH A Push B pointer onto stack LD A X 22 COP8 EPU Development Tools Assembly Code Continued PUSH A Push X pointer onto stack VIS Vector to the appropriate interrupt routine Restore This is needed to re store the state of the CPU before the jump to the ISR POP A Pop X pointer from stack X A X Restore X pointer POP A Pop B pointer from the stack X A B Restore B pointer POP A Restore Accumulator contents RETI TimerlA Service RBIT 5 PSW Reset Timer T1A pending flag LD A PORTD input Port D XOR A 001
14. ed as part of the demo Subroutine from ext module extrn Subr This section of code is given the name codel The first line of code a call to a subroutine name Subroutine has been commented out since it is not used as part of the demonstration The second instruction sets up Timer 1 to produce a rectangular pulse train on pin 3 of Port G Instructions 3 and 4 initialize 16 bit Timer Tl The next 4 instructions initialize two 16 bit registers whose contents are alternately loaded into Timer each time it counts down to 0 and generates an interrupt If both register were reloaded with the same value a square wave output would be produced Indicated times are for real timer operation sect codel rom riti JSR Subroutine Call subr from ext module LD CNTRL B 10100000 PWM Mode T1A Toggle 21 COP8 EPU Development Tools COP8 OUIC KSIART Assembly Code Continued LD TMR1LO 1 1000 1 ms tc 1 us LD TMR1HI H 1000 LD TIRALO 1 500 70 5 ms LD 1 H 500 LD 1 1000 71 0 ms LD TIRBHI H 1000 RBIT 3 PORTGD set up Port G bit 3 SBIT 3 PORTGC as an output LD PSW 00010001 Enable global and timer q interrupts SBIT 4 CNTRL Start Timer T1 Once started the software will loop through this section until halted Operation of the DELAY and TOGGLE subroutines is described below WAIT JSR DELAY JSR TOGGLE JP WAIT endsect Interrupt han
15. ed device and comparing the data to the file Selecting FilelProgramminglManuallEprom Program will program only the code space Click on the button Start Operation to begin programming our microcontroller Follow the directions on the pop up window After programming Click on the Exit button to get back to the main client window The software will ask you to remove the chip from the programming socket Make sure the chip is not in the socket Leaving the chip in may cause damage to both the simulator board and or the surrounding circuit 19 COP8 EPU Development Tools COP8 QUIC KSIART After burning the microcontroller you can test the behavior of the code at full speed Replace the ribbon cable header with the newly burnt chip and apply a clean 5 volts preferably from a power supply Detach the clip from TP6 and attach it to a supply VCC 45V and the microcontroller ground to that of supply GND Make sure that the RESET line is tied high as to enable the POR Power On Reset circuit The setup should look similar to that of Fig 14 5V or Vcc 330 Ohm Figure 14 Step 9 Conclusion And Final Thoughts The WCOPS IDE is a powerful software tool for organizing the development of single and multiple module programs for the COP8 family of microprocessors The EPU in circuit simulator similarly is an inexpensive tool for debugging and testing COPS software and verifying operation of the target hardware The EPU can
16. evice and com port information will be preserved and the user will not have to re enter information the next time he she load up the same project directory Step 3 Configuring the EPU Module The EPU software generally locates the serial port through the configuration file used by the EPU and establishes the connection between the PC and the EPU If there is a problem use ConfigurelEmulator to select the serial port and baud rate While the serial port is usually set to the highest baud rate it is sometimes necessary to set the baud rate to a lower value to ensure reliable operation Refer to the troubleshooting section pg 5 6 of the EPU manual if you encounter any configuration problems Step 4 File Select FilelLoad so that the executable in this case main cof can be entered into the File Name box At the prompt Merge into current application environment select no merge allows multiple files to be loaded into memory without pre initialization to all 0x00 content 13 COP8 EPU Development Tools Note displaying main asm in the edit window when selecting DebuglWindows Emulator the default directory used by the EPU will be c cop8 The full path for the executable main cof need not be entered into the File Name entry box Once loaded the EPU is ready to execute and following your directions to test the example If you are optimistic you can simply click RUN and see the result By following the technig
17. ive B Click Next when you are done reading the information window A screen will appear asking for your name company and the serial number on the label of the WCOPS IDE disk Type in all the necessary information and when done click Next 5 A window will pop up asking for which type of installation to do A Click on the space next to Make new installation and overwrite all old settings if this is a new installation of WCOPS IDE B Click Next when done A window will ask for Destination Location which WCOP8 IDE will be installed at A Click on Next for the default path or click on Browse for a to enter another destination path B Click on Next when done A window will ask for the type of Operation System in which WCOPS IDE will be installed into A Select the type of Operation System B Click on Next when done 8 A window pane will pop up asking which Program groups should the WCOPS icons be installed A Select a program group B Click Next when done C Click on Next to decompress the files and finalize the install process D Click on Finish when done to exit the install program COP8 EPU Development Tools At the end of the installation s you can verify that the correct files have been installed by using Windows Explorer and comparing your installation to that shown in Fig 1 Exploring EXCOP File Edit View Tools Help COP8 QUIC KSIART cop als sae 20 Desktop 4
18. kbar clear any program by clicking on them and exiting them This is usually accomplished by clicking on FilelExit Install ASMCOP Linker Lib 1 2 3 Insert the disk labeled ASM Linker Lib into the floppy drive Click the start button and select Run At the windows prompt Open A Type in a install where a is your floppy drive B At the dos prompt Source drive of installation disk A Select a where a is the drive in which the floppy is in C At the dos prompt for Directory for COP8 C cop Select c cop where c is the hard drive D Depress the return key The install program will now decompress the necessary files When done type in exit and hit the RETURN key Install iceMASTER EPU COP8 1 Insert the disk labeled ice MASTER EPU COPS Diskl into your floppy drive Click the start button and select Run o 6 7 COPS QUIC KSIART 3 1 COP8 EPU Development Tools At the windows prompt Open A Type in a setup where a is your floppy drive B Click Yes to the prompt Install COP8 Emulator C Change disk s as requested by InstallShield D Select a destination path and Click on Next E Click Next to add files to the Program Folder F Click Ok to the next three menus Install WCOP8 IDE Insert the disk labeled KKD WCOPS IDE Disk into your floppy drive Click the start button and select Run Atthe windows prompt Open A Type in a setup where a is your floppy dr
19. n alternative method of simulation is to step through the program one instruction at a time While this approach can be time consuming it is possible to determine the step by step status of the microcontroller This is accomplished by selecting RunlStep function key F7 COP8 EPU Development Tools COP8 QUIC KSIART E A Note On Window Displays Simulation results are shown in the EPU window which is divided into five window panes Source Core Registers Registers Status and RAM Memory Each window pane can be expanded so that all information can be viewed The user can also adjust the size of the window panes to suit the data viewing requirements The Source window pane shows the hexadecimal machine code and the source assembly code and indicates the active breakpoints The RAM window pane shows data in the RAM memory The Status window pane presents the simulation data including breakpoint address and other related data The Registers window pane shows the data in the registers the timers and input output ports The Core Register window pane shows the accumulator stack pointer B and X registers as well as the flags in the Program Status Word PSW Since the first few instructions in the example program set up timer registers results of these instructions can be verified in the Registers pane 17 COP8 EPU Development Tools COPS QUIC KSIART Step 8 Misc Section Programming the E PROM This section co
20. ntains the procedures for programming the COP One Time Programmable OTP and erasable microprocessors supported by the EPU Select FilelPROM ProgrammerlDevice to display the set of COP devices that can be programmed by the EPU Select the appropriate device from the list A window similar to that of Fig 12 should pop up to allow programming of the COP microcontroller Wl 0008 MetaLink ICE COPBSAC DM Configure Run Display Alter Break Trace Window Help Core Registers lt 1 gt E3 LD TMR1LO 8 LD TMR1HI X 03 LD T1RALO X F 4 LD TIRAHL X 01 BDD46B LoadFile Source CodeMemor Configuration Checksum 0018 BDD57B 0018 BCEF11 Device E Range 0 0000 pxzFFF pu Fa ECON Configuration Device 0x00 Unread 0024 00200 Security bit Configuration Device Disabled Unread 0027 User Data Configuration 0x8001 0x8008 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0028 DOFF User Data Device Unread 002C 0020 00 oe o Install COPBSxx COP87Lx JB35 shunt DM4 before programming p 002F 00 0030 00 i 0031 00 Warning Do not put a chip in programming socket until told to do so 0032 00 p Programming Wi Registers lt 1 gt 15 2355 00 Automatic Ele Options Lawr on Start Operation PORTFD 00 E 0035 00 Manual EPROM Blankcheck IPORTF
21. port D The DELAY subroutine inserts a time delay sect toggle rom TOGGLE LD A PORTD Input Port D XOR 002 Toggle bit 1 X A PORTD Output changed port bit JSR DELAY Time delay RET endsect end init COP8 OUIC KSIART 24
22. the file so that it corresponds to the listing in Appendix A and save it 10 COP8 EPU Development Tools COP8 OUIC KSIART Stepl Setup of the Circuit The modified software when executing on your EPU will blink an LED at two different rates The LED and a series resistor are connected between V and one of 2 PORT D I O pins Attach a clip lead to the post TP6 which is V This will be used to obtain LED voltage See Fig 7a and 7b TPS Vcc 45V J1 D 0 GND Figure 7a When the assembled circuit Fig 7b is connected and the program is running the LED attached at EPU will blink at approximately 1 2 second on 1 2 second off When the LED is attached to EPU J1 D it will blink at approximately 3 seconds on 3 seconds off Rate will vary a bit depending on your processor speed Since the EPU simulates fetching instructions over the serial RS 232 host port the dominate timing parameter is the baud rate TP6 Vcc RI 330 Ohm a y 0 Figure 7b Executing x Status Finished Information Project e cop8 weop mple main prj obj Time 9 60 sec Result File s linked with success Figure 8 11 COP8 EPU Development Tools COP8 OUIC KSIART Click on the main asm icon Select ExecutelBuild or click on the build icon A window with the title Executing will pop up WCOPS IDE will assemble and if
23. then program a COP8 EPROM or OTP device which can be inserted into the target circuitry for actual real time testing 20 COP8 EPU Development Tools COPS QUIC KST chip Appendix A Assembly Code For The QuickStart Lesson REAL ERE EARLE RAE AEA lt gt 2 lt gt 5 BARA AAR KO ens COMPANY K amp K Development ay PROJECT WCOP8 IDE Test Assembler Project FILENAME Main asm VERSION 1 0 xs rU NC M MP M es This file is part of the test project that comes with the WCOP IDE software The only purpose of the project is to serve as an example when exploring the features of WCOP8 IDE d x K amp K Development makes no warranty representation or guarantee regarding the suitability of this project for any particular purpose T ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck sk ck sk ko ko COP888EG incld main inc sect Set up memory location COUNT1 as a register so that the instruction DRSZ Decrement and Skip if Zero can be used to test the result See it used below REGISTER REG COUNT1 dsb 1 endsect This tells this software module that there is a software subroutine in another module called Subroutine Not us
24. ues described below you will learn to use some of the testing features available using the EPU and iceMaster debugger software COP8 OUIC KSIART 14 COP8 EPU Development Tools Step 6 Adding Using a simple Break Trace This section covers the basics for setting editing and removing breakpoints Breakpoints are generally inserted at critical points in the program to verify program operation Once started the microcontroller runs until the next breakpoint is reached The process is then frozen and the microcontroller s internal state is displayed for examination and possible change When ready the process can be resumed to run until the next breakpoint or restarted Wl Source 1 iol xi File Options View Assemble POTECI Run Until 000 BCEEAD 0003 BCEAE8 LD TMR1LO XE8 0006 3 LD TMR1HI X 03 0009 BCECF4 LD TIRALO XF4 000C 01 LD TIRAHI X01 ODOF BCEGEB Break Flags LD AXES 0012 3 LD TIRBHI X 03 0015 RBIT 3 PORTGD GD3_T1A SBIT 3 PORTGC GC3_T1A LD POW x 11 SBIT 4 CNTRL T1CO JSRL X 0028 0027 F9 JP 0021 0028 DOFF LD FO XFF 002A CO DRSZ FO 0028 FE JP X 002A 0026 RET 002D 00 INTR 0025 00 INTR 002F 00 INTR 0030 00 INTR 0031 00 INTR 0032 00 INTR 0033 00 INTR 0034 00 INTR 0035 00 INTR 0036 00 INTR 0037 00 INTR 0038 00 INTR 0039 00 INTR 003A 00 INTR 0038 00 INTR 0036 00 INTR 003D 00 INTR n92F nn INTE
Download Pdf Manuals
Related Search
Related Contents
「シエロ T NK」の付属品 Samsung S22A350H Керівництво користувача brava brava large - Maschio Gaspardo Mazda CX-5 Smart Start Guide Nemo D4-Le 10785090 Rogowski BestLift Luna Philips SHB6101 Bluetooth Stereo Headset Kit de prélèvement sanguin/perfusion SAFETY - Greiner Bio-One HP 690n Administrator's Guide Copyright © All rights reserved.
Failed to retrieve file