Home
M68HC12B32EVB Evaluation Board
Contents
1. 4 4 Power Input Circuitry The input power connector on the EVB is a 2 pin lever actuated connector P5 Decoupling capacitors filter ripple and noise from the supply voltage M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Hardware Reference 101 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference 4 5 Terminal Interface An RS 232C transceiver U1A or U1B links the MCU s serial communications interface to the RS 232C DB 9 receptacle P1 The communications parameters for this port are described in 2 6 Terminal Communications Setup 4 6 Microcontroller The MC68HC912B32 is one of the first of a family of next generation M68HC11 microcontrollers with both on chip memory and peripheral functions The CPUI2 is a high speed 16 bit processing unit The programming model and stack frame are identical to those of the standard M68HC11 CPU The CPUI2 instruction set is a proper superset of the M68HC 11 instruction set All M68HC11 instruction mnemonics are accepted by CPUI2 assemblers with no changes The EVB resident MC68HC912B32 U2 has seven modes of operation These modes are determined at reset by the state of three mode pins BKGD MODB and MODA as shown in Table 4 2 The EVB is factory configured for MCU operation in the normal single chip mode In this mode of operation all port pins are available to the user On chip FLA
2. EEBASE lt Address gt FBULK BULK Bulk erase on chip EEPROM CALL lt Address gt Execute a user subroutine return to D Bug12 when finished DEVICE Select define a new target MCU device Inform D Bug12 of the targets EEPROM base address Erase the target processor s on chip FLASH EEPROM FLOAD lt AddressOffset gt G lt Address gt GT lt Address gt Program the target processor s on chip FLASH EEPROM from S records Go Begin execution of user program Go Till Set a temporary breakpoint and begin execution of user program HELP LOAD lt AddressOffset gt Display D Bug12 command set and command syntax Load user program in S record format Memory Display Display memory contents in hex M68HC12B32EVB Evaluation Board Rev 1 D A gt EndA gt StartAddress lt EndAddress gt bytes ASCII format Display Memor 16 Bit Word Display memor MDW lt StartAddress gt lt EndAddress gt sp ay e nie O Bit Worm p ay y contents in hex words ASCII format Memory Modify Interactively examine change memor TEE xatas emory Modify teractively examine change memory contents Modify 16 Bit Memory Word Interactivel W address lt data gt Dd y cus 91y pis y examine change memory contents OVE StartAddress EndAddress Move a block of memory lt DestAddress gt NOBR lt Address gt lt Address gt Remove individual user breakpoints
3. 5 15 inches x 3 4 inches 13 1 cm x 8 64 cm M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA General Information 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information 1 7 Typographic Conventions This user s manual uses special typographical conventions to enhance readability They are e Code statements confirmations data entry field text parameters and strings are indicated in regular Courier SINCLUDE INIT AS This option displays an Exit Application confirmation message This new filename replaces the NONAME 1 in the title bar oo FILES e When arguments in code are italicized they are placeholders for values to be entered by the user n argument ncode the user s entry is underlined This underlining does not actually appear onscreen A typical example looks like this baud 9600 User s entry Change Terminal BR D Bug12 s response Press Return gt D Bug12 prompt for next entry e Window names and parts of windows are indicated in initial caps unless the name of the window is capitalized in a unique way Memory and Code windows CASMOSW window WinIDE main window e For usage in this manual filenames are not case sensitive But for consistency they will always appear in all capital letters SETUP EXE MAP file User s Manual M68HC12B32EVB Evaluation Board
4. Most terminal devices whether dumb terminals or the serial ports on host computers are wired as data terminal equipment DTE and employ 9 or 25 pin subminiature D DB 9 or DB 25 plugs In these cases normal straight through cabling is used between the EVB and the terminal Adapters are readily available for connecting 9 pin cables to 25 pin terminal connectors M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Configuration and Setup 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Configuration and Setup User s Manual cables are available for this purpose Table 2 2 RS 232C Interface Cabling If the terminal device is wired as DCE the RXD and TXD lines must be cross connected as shown in Table 2 2 Commercial null modem adapter EVB P1 Terminal Pins DTEC DCE DCE DTE Signal Plug Receptacle Receptacle DB 9 DB 25 DB 9 DB 25 2 Receive data RXD 2 3 3 3 Transmit data TXD 3 3 2 2 5 Ground GND 5 7 5 7 Normal DCE to DTE cable connections 2 Null modem DCE to DCE cable connections Optionally the MCU s background debug mode BDM in W12 interface can serve as the user interface This setup makes the SCI port available for user applications Additional hardware and software are required For more information refer to the documentation for the background debug development tool being used This can be another
5. Rev 1 24 General Information MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information Customer Support e Buttons icons functions and keyboard keys are indicated in small caps Press the ENTER key Type CTRL N or click on the NEW toolbar button The RESET function is an input and output Commands are not case sensitive But for consistency they will always appear in all capital letters unless they contain some peculiarity INPUTx UNDO LOADMAP Menu names options and tabs and dialog edit text and lists boxes are indicated in Times bold Do this by checking the Main File option in the Environment Settings dialog s General Options tab Open the Open File dialog Select the filename in the File Name list and use the filename in the Main filename edit box 1 8 Customer Support To obtain information about technical support or ordering parts call the Motorola help desk at 800 521 6274 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA General Information 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information User s Manual M68HC12B32EVB Evaluation Board Rev 1 26 General Information MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Boa
6. 20 19 M gni NGHS E E So de G10 A 4 o al 20 4 J il LL Mei ee A vin 8 apts 33 1 930u Gan aan dOSS 8c IVOC9GXVW SNOILVOINDWIWOO cecsad 4 Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board A 1 Contents A 2 A 3 AA AS A 6 A 6 1 A 6 2 A 6 3 A 6 4 A 2 Overview Appendix A S Record Format A AAA 111 SR A EE 111 re A 113 a Record CPU as E EO Ed XX ORC X AA 114 S Record ES aas d addu AEN ec don 114 S0 Header Record 22a caso kar bI e CRDI eh 114 buda Re EE qo di Re Iesv ea EM ess 115 S9 Termination Record 116 ASCH Chris cri Ei E baked a axes 117 The Motorola S record format was devised to encode programs or data files in a printable format for transport between computer platforms The format also provides for editing of the S records and monitoring the cross platform transfer process A 3 S Record Contents Each S record is a character string composed of several fields which identify Record type Record length Memory address e Code data e Checksum M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA S Record Format 111 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc S Record Format User s Manual Each byte of binary data is encoded in the S record as a 2 character hexadecimal number The first character represents the
7. Freescale Semiconductor Inc Hardware Reference Schematics PB4 PB6 PE7 PE5 MODA Vssx30 RESET XTAL PE2 PEO PA1 PP4 PP2 PPO PT1 Vppto PT3 PT5 PT7 PBO PB2 Figure 4 2 MCU I O Headers P4 and P6 M68HC12B32EVB Evaluation Board Rev 1 The schematics are available here for your reference User s Manual MOTOROLA Hardware Reference Go to www freescale com For More Information On This Product 107 Inc F 8 Zz 9 s Y D E z i E jo jeeug 8661 82 190190 epseupew SEO Sareea lee ATIVONVA SSIASH LON OG SNIMVHG QHIVHSNHO H3l dWNOO ABU JequinN juewinsog ezg GHvO8 NOLLV TIVA3 Ze83169A3 an STOOL IN3AdO13A3G e OW nm as 2 9 OTM ANY an9 orm om sm uo dont 3no soetd ke o ON ONG A MW euop useq sary SIYA H2d 19734 o D N c 0 m ALON o9 919 Any Be 49 Y cu 8M o OL T INANI ddA H 3 d dda D s 68 E 3 S LL ONG ONG 8 aN O Jnzp o e uo ei TIVNIINH3IL HMd S o aadA f e AS r1 UND da ONG SQVEVIONOIN NI HAY SH TVA SONVIIOVdVO as LIVM p T Wav SHOLSISHH SHHO NI HV SENTWA SONVISISSH DISSI SONSWHAHN vin SMOTIO3 SW NMOHS SHY SHIVO 40 WOIXNDISSG mm Ann ANY SYIAWON NIA SdAL SOIASG WYO MGT O3 s3o3srsed WYO Ar e pebueuj 96 LT ZT CG DIS 01 NId 0Z TIY 40 0I NId S OI 91M Pue GIM T 9m sm 03
8. M68HC12B32EVB Evaluation Board Appendix B Communications Program Examples B 1 Contents B 2 B 3 B 3 1 B 3 2 B 4 B 4 1 B 4 2 B 5 B 5 1 B 5 2 B 6 B 6 1 B 6 2 B 7 B 7 1 B 7 2 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Communications Program Examples For More Information On This Product Go to www freescale com 117 Freescale Semiconductor Inc Communications Program Examples B 2 Introduction In all of these examples first follow the EVB startup procedure in 3 3 Startup When the startup procedure calls for setting up the host computer s communications program for terminal emulation follow the steps in the examples Keyboard entries are illustrated in this appendix using these conventions ENTER Press the keyboard s ENTER CARRIAGE RETURN or RETURN key ALT P While holding down the ALTERNATE key press the P key CTRL While holding down the CONTROL key press the BACKSLASH key lt filename gt Supply the appropriate filename when required The stepwise procedures in this appendix are as accurate as possible However it is not feasible to document all of the communications programs that are available or to guarantee that a newer revision of a program behaves in exactly the same way as the version used to develop the procedure For this reason the steps are as generic as possible in their descriptions They can thus serve as guidelines for pr
9. VERF Verify S Record File Against Memory Continued Restrictions None Example gt VERF_ 1000 Ck CA Ckckockck ckck ckckck ck ck ck kc ck ck ck gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 90 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Modify Register Value lt RegisterName gt Syntax RegisterName RegisterValue Where RegisterName is one of the CPUI2 registers listed in Table 3 4 lt RegisterValue gt is an 8 or 16 bit hexadecimal number Table 3 4 CPU12 Registers Register Name Description Legal Range PC Program counter 0 to FFFF SP Stack pointer 0 to FFFF X X index register 0 to FFFF Y Y index register 0 to FFFF A A accumulator 0 to FF B B accumulator 0 to FF D D accumulator A B 0 to FFFF CCR Condition code register 0 to FF Each of the fields in the condition code register CCR may be modified by using the bit names in Table 3 5 Table 3 5 Condition Code Register Bits CCR Bit Name Description Legal Values S STOP enable 0 or 1 H Half carry 0 or 1 N Negative flag 0 or 1 Z Zero flag 0 or 1 V Two s complement overflow flag 0 or 1 C Carry flag 0 or 1 IM IRQ interrupt mask 0 or 1 XM XIRQ interrupt mask 0 or 1 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 91 F
10. BULK Bulk Erase On Chip EEPROM 55 CALL AE AMA 56 DEVICE Specify Target MCU Device Ne KEE 57 EEBASE Specify Target EEPROM Base Address 61 FBULK Erase Target FLASH EEPROM 63 FLOAD Program Target FLASH EEPROM 65 G Go Execute a User Program lusso ions 67 GT fo xy P T c 68 HELP Onscreen Help Summary 5 22 ANNE ENEE EN 69 LOAD Load S Record File sosissrsicnisrara renos 71 MD KETTER 72 MDW Display Memory as 16 Bit Word 73 MM Memory MER sas ER dE 74 MMW Modify 16 Bit Memory Word 76 MOVE Move Memory Block 1 44 e KMA EES rs 78 NOBR Remove Breakpoints Aa A A ENEE cee 79 RD Register Display EE 80 REGBASE Specify Target EEPROM Register Address 81 RESET Reset Taree MEU EE 83 RM Resister Modify A 84 STOP Stop Execution on Target MCUT 85 T KEE 86 UPLOAD Display Memory in S Record Format 88 VERF Verify S Record File Against Memory 89 RegisterName Modify Register Value 91 3 8 CHI Board Code Generation EE 93 339 Memory USES gheet RE ANS 93 3 8 1 Des EE 94 3 9 2 Memory EE 94 310 Operational LAWNS cocoa e E Ra RAE ARRA 95 SIGs AAA 95 3102 CH CBIp BEPRERUM deg Era ici ia 95 3183 Sel Pom ee poa EE ECK HERI RR EE 95 3104 Dedicated MOU PIS 0 503 000 error e ET pr 95 310 5 Terminal Cominiibaiolls ocoxdesuactescesdetidccne ss 96 M68HC12B32EVB Evaluation Board Rev 1 34 Operation MOTOROLA For More Info
11. D Bug12 at reset instead of the flawed user program When operating in pod mode the D Bug12 RESET or STOP command can be used to regain control of the target system M68HC12B32EVB Evaluation Board Rev 1 42 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation Using D Bug12 Commands 3 6 Using D Bug12 Commands D Bug12 the EVB s firmware resident monitor program provides a self contained operating environment that allows writing evaluation and debugging of user programs 3 6 1 Command Line Prompt D Bug12 displays one of three command line prompts depending upon its operating mode and or the state of the target system When D Bug12 is operating in EVB mode it displays the greater than gt single character at the beginning of a line when it is waiting for the user to enter a command When a command is issued that causes user code to run D Bug12 places the terminal cursor on a blank line where it remains until control returns to D Bug12 When operating in pod mode D Bug12 displays one of two prompts depending upon the state of the attached target system When the target system is in active background mode not running a user program the 2 character prompt S is displayed indicating that the target is stopped and not running a user program When the target system is running a user program the 2 character prompt R gt is displayed indicati
12. D Bug12 v 2 0 0 Copyright 1996 1997 Motorola Semiconductor For Commands type Help gt If the prompt does not appear check all connections and verify that startup steps 1 through 7 in 3 3 1 Startup Procedure have been performed correctly When the prompt appears D Bug12 is ready to accept commands from the terminal as described in 3 6 Using D Bug12 Commands User boot program Upon reset the user program executes immediately D Bug12 commands are not available Terminal communications take place either via the SCI under control of the user program or via the BDM interface and a serial debug interface tool such as Motorola s SDI M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 3 2 2 Jump EEPROM Mode 3 3 2 3 Pod Mode User s Manual In jump EEPROM mode the user code in byte erasable EEPROM starting at address 0D00 is executed immediately Terminal communications are controlled by the user code via the SCI or by an appropriate serial debug tool via the BDM interface For more information refer to 3 2 2 Jump EEPROM Mode Control can be returned to the D Bug12 terminal prompt by doing one of the following e Terminating the user code with appropriate instructions see 3 2 2 Jump EEPROM Mode e Pressing the reset button S1 In pod mode the host EVB serves as a non intrusive contro
13. E rase P rogram or L oadEE Select the desired function by typing an upper or lower case E P or L NOTE Before selecting the Erase or Program function apply Vpp to the EVB via header W8 Then move the jumper on header W7 to position 1 2 After programming is completed remove Vpp and return W7 to position 2 3 The starting address of the user code must be placed in the reset vector position F7FE of the alternate reset interrupt vector jump table For more information see E 4 Vector Jump Table Interrupt and Reset Addresses The bootloader cannot be used with S records containing a code data field longer than 64 bytes S record length field greater than 67 bytes Longer S records will cause the bootloader to crash and or program incorrect data into EEPROM S records may contain ASCII CR and or LF characters CAUTION Ifan Erase or Programoperation is unsuccessful after one or two attempts check the Vpp connection on header W8 and measure the value of Vpp to verify compliance with the MC68HC912B32 Electrical Specifications Supplement A Vpp voltage lower than that specified may cause the erase or program operation to fail A Vpp voltage higher than that specified may cause permanent damage to the device E 3 1 E rase This selection causes a bulk erase of FLASH EEPROM except for the erase protected area starting at address F800 which contains the bootloader program the area reserved for bootloader expansion and the
14. Inc User s Manual M68HC12B32EVB Evaluation Board D 1 Contents Appendix D D Bug12 Customization Data D 2 521 D22 H3 D 2 4 D 2 5 D 2 6 D 2 7 D 2 8 D29 Customization Data Area AER EE AER ses 129 Hs ody ikerin seu aechas 44 ke Wa sati RE ER TER ARES Ad 130 Assembly PONE 46054642504 cane eohs ire 130 Initial User CFU Register Vanes 2 ce dg ad 130 SAR Me EE EE 131 WOR ase Field oscar 131 lA AAA 132 EEBase and EESize Fields cosinriatorianicar cirios 133 EEPROM Erase Program Delay Function Pointer Field 133 Auxiliary Command Table Entries NENNEN EES 133 D 2 Customization Data Area The customization data area located in FLASH EEPROM from FC60 to F6FF allows users to change default data parameters used by D Bug12 The data contained in this area is described by C data structure The CustomData typedef is shown here For those unfamiliar with C an assembly language equivalent is also shown here The purpose of each field also is explained M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA D Bug12 Customization Data 129 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc D Bug12 Customization Data D 2 1 C Format typedef struct Byte UserCCR User CPU Condition Code Register Byte UserB User CPU B accumulator Byte UserA User CP
15. User s Manual MOTOROLA Operation 45 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Table 3 1 D Bug12 Command Set Summary Continued U Command Description RD Register Display Display the CPU register contents REGBASE Inform D Bug12 of the target l O register s base address RESET Reset the target CPU 3 Register Modify Interactively examine change CPU register contents Stop execution of user code on the target processor and STOP E place it in background mode Trace Execute an instruction disassemble it and display T lt Count gt PLOAD lt StartAddress gt lt EndAddress gt VI ERF lt AddressOffset gt the CPU registers Display memory contents in S record format Verify memory contents against S record data lt RegisterName gt lt RegisterValue gt Set CPU lt RegisterName gt to lt RegisterValue gt Refer to Appendix A S Record Format for S record information 3 7 D Bug12 Command Set In the following command descriptions the examples represent what is seen on the terminal display NOTE For clarity the user s entry is underlined This underlining does not actually appear onscreen A typical example looks like this gt baud 9600 User s entry Change Terminal BR Press Return D Bugl2 response gt User s Manual D Bug12 prompt for next entry M68HC12B32EVB
16. WO W12 BDMmterface ee 105 CPU instruction translation 1 2 20 cece nh 48 LEE 103 Teg N Qo 15 IVDO ee SC et Seen Shee e EE E RC RP EET CREE RE ER 15 Crystal poco tector dos ds edad aire dads 103 customer SUDDOTL 42 4 csse amado urs RP dh ee das dba CERA AE ER ead A 25 D D Bug12 aborting a user program ei a AIR ARA RARAS 42 command SEE AAA RAR A REGERE 45 command line format paran dada sidad c la 43 configuration requirements o 20 28 98 CUSIO MZA LO CAG AS AAA da 129 CUSIOMMAING e A Rl A E 142 descripto o ridad dee Ae 1923 generating EE 20 93 limitations imposed bn 95 a AA 94 Operating A PERMET TTLTIM 39 POAC ous acere Ce Gre ERA Ree E ERR X Elder de diea 141 e ur ox code eS EIS I REN IE QE RP Ud bees ead awe eas 42 stack DOIDEGE 404209 95S RECON pie Seno cance s Seri decane canes 94 jen MR TT PUES 38 startup COdE La isct s ex pa ERG REPE EE 125 a P 21 28 35 38 terminal interface ses aad eeu a XR REA Ora AA 102 UDBISUOS EE 141 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Index 149 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc D Dugl2 ABE 224542 Secends soces bbrBeoexu4heesceed ire 24 46 DEVICE commande 57 58 59 60 E EEBASE commande 61 62 EEPROM WEE 20 bootloader 2 0122 cs RR REDE ERG DE KERN ORNA REEES 4E 136 byte erasable MAP Cu cs cde baratas bir alta ee a e 94 EE 63 136 FLA
17. address of EEPROM program erase delay routine AuxCmdCount dc w 0 number of commands in auxiliary command table AuxCmdTableP dc w 0000 pointer to the auxiliary command table D 2 3 Initial User CPU Register Values The first seven fields in the CustomData typedef struct are used to provide default values for the user CPU12 registers In this version of D Bug12 he user CCR value is set to 0x90 This sets the S bit disabling the STOP instruction and the I bit inhibiting IRQ interrupts The X bit is cleared to allow the use of the XIRQ interrupt as a user supplied programmer s switch when operating in EVB mode The user SP value is set to 0x0a00 when operating in User s Manual M68HC12B32EVB Evaluation Board Rev 1 130 D Bug12 Customization Data MOTOROLA For More Information On This Product Go to www freescale com D 2 4 SysClk Field NOTE D 2 5 lOBase Field NOTE Freescale Semiconductor Inc D Bug12 Customization Data Customization Data Area EVB mode which is one byte beyond the last on chip RAM location available to the user The CPU12 stack pointer points to the last byte pushed onto the stack When operating the M68HC12B32EVB in pod mode the values in the table for the CCR and the stack pointer are not used Instead when the target processor is reset by using the RESET command the target s CCR is set to Oxd0 The stack pointer is set to one byte beyond the end of the target system s RA
18. www freescale com Freescale Semiconductor Inc For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Motorola reserves the right to make changes without further notice to any products herein Motorola makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Motorola assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters which may be provided in Motorola data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Motorola does not convey any license under its patent rights nor the rights of others Motorola products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Motorola product could create a Situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola and its officers employees s
19. www freescale com Freescale Semiconductor Inc General Information Functional Overview C vd v gn vd ns Hi I N HH O9 aan 0 PROTOTYPE Z AREA D PAI C19 PS PSQ PEI PEO PS3 PS2 PES PE2 PS5 PS4 W16 XAL C20 cig PS7 PS6 EXTAL RESET PDLC6 VFP WE o Plaga PS v i PEB C21 PDLC2 i pg PE PDLca PDLC3 Z PBB W15 POL U RESET VD GND wm POS PEQT3338 3323 pp DONA ONA SS JS unoggnng 99 AS 28 ALERT gt o ue z le e Ro BDM OUT BDM IN Figure 1 2 EVB Solder Side View 1 4 Functional Overview The EVB is factory configured to execute D Bug12 the FLASH EEPROM resident monitor program without further configuration by the user It is ready for use with an RS 232C terminal for writing and debugging user code Follow the setup instructions in Section 2 Configuration and Setup to prepare for operation M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA General Information 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information User s Manual NOTE The EVB also can be jumper configured to e Runa program directly out of EEPROM e Control a remote pod MCU via the BDM interface e Reprogram EEPROM on either the host EVB or the pod For the correct jumper settings refer to 4 3 Configuration Headers and Jumper Settings The D Bug12 operating instructions in this manual presume the factory default memory config
20. Evaluation Board Rev 1 46 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Assemble Instructions ASM Syntax ASM Address Where Address is a 16 bit hexadecimal number The assembler disassembler is an interactive memory editor that allows memory contents to be viewed and altered using assembly language mnemonics Each entered source line is translated into object code and placed into memory at the time of entry When displaying memory contents each instruction is disassembled into its source mnemonic form and displayed along with the hexadecimal object code and any instruction operands Assembler mnemonics and operands may be entered in any mix of upper and lower case letters Any number of spaces may appear between the assembler prompt and the instruction mnemonic or between the instruction mnemonic and the operand Numeric values appearing in the operand field are interpreted as signed decimal numbers Placing a dollar sign in front of any number will cause the number to be interpreted as a hexadecimal number When an instruction is disassembled and displayed the D Bug12 prompt is displayed following the disassembled instruction If a carriage return is the first non space character entered following the prompt the next instruction in memory is disassembled and displayed on the next line If a CPU12 instruction
21. M68HC12B32EVB or a tool such as Motorola s serial debug interface SDI M68HC12B32EVB Evaluation Board Rev 1 30 Configuration and Setup For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Configuration and Setup Terminal Communications Setup 2 6 Terminal Communications Setup This section describes how communications among terminals are set up 2 6 1 Communication Parameters The EVB s serial communications port uses the communication parameters listed in Table 2 3 Of these only the baud rate can be changed For instructions on changing it refer to 2 6 4 Changing the Baud Rate Table 2 3 Communication Parameters Baud Rate 9600 Data Bits Stop Bits Parity 2 6 2 Dumb Terminal Setup Configuring a dumb terminal for use with the EVB consists of setting its parameters as shown in Table 2 3 Many terminals are configurable with externally accessible switches but the procedure differs between brands and models Consult the manufacturer s instructions for the terminal being used 2 6 3 Host Computer Setup One advantage of using a host computer as the EVB s terminal is the ability to generate code off board for subsequent loading into the EVB s memory It is thus desirable for the host to be capable of running programs such as P amp E Microcomputer Systems IASM12 or Motorola s MCUez assembler For more information see 3 8 Off Board Code Gen
22. Set Summary M68HC11 to CPU 12 Instruction Translation Command Line Names CPU12 Registers Condition Code Register Bits Factory Configuration Memory Map Jumper Selectable Functions CPU Mode Selection BDM Connector J5 Pin Assignments List of Tables User s Manual MOTOROLA For More Information On This Product Go to www freescale com List of Tables 13 Freescale Semiconductor Inc List of Tables User s Manual M68HC12B32EVB Evaluation Board Rev 1 14 List of Tables MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board 1 1 Contents 1 2 1 3 1 4 L3 1 6 UM 1 8 1 2 Introduction Section 1 General Information Ur cT o PTT EEN 13 General Description and Featutes coccion or rr EEN 15 EE MA 19 External Equipment Requirements cius ch ur rd 22 A MA 23 Typographic CONVENIO ds A 24 o MAA 25 This user s manual provides the necessary information for using the M68HC12B32EVB evaluation board EVB an evaluation debugging and code generation tool for the MC68HC912B32 microcontroller unit MCU Reference items such as schematic diagrams and parts lists are shipped as part of the EVB package 1 3 General Description and Features The EVB is an economical tool for designing and debugging code for and evaluating the operation of the MC68HC912B32 MCU By providing the essential MC
23. Transfers to EVB Memory ENEE n 121 Bs Kennt Sun WOULSADOR suscrita 121 B 5 1 A ES B 5 2 S Record Transfers to EVB Memor 122 B 6 MacTerminal Apple Macintosh 122 B 6 1 oo ah M 122 B 6 2 S Record Transfers to EVB Memor 123 B 7 Red Ryder Apple Macintosh 9 og ENEE a RS 124 B 7 1 EE 124 B 7 2 S Record Transfers to EVB Memory ENEE 124 Appendix C D Bug12 Startup Code Appendix D D Bug12 Customization Data PA ns thee cease b ERR AX DRE DEAS DDR DA A OE RR Ed Rd 129 D2 Customizahon Dag EE 129 D 2 1 Mo EE 130 D 2 2 e AAA 130 D23 Initial User CFU Register Vanes iiioeospesceesebs pres bk 130 D 2 4 E rra AA 131 D 2 5 41 77 PA Mme EE 131 D 2 6 ieee Vul Field AMA 132 D 2 7 EEBase and EESi e PiGls 0s ccadesariagivenencuaaebon ds 133 D 2 8 EEPROM Erase Program Delay Function Pointer Field 133 1219 Auxiliary Command Table Entries 2 0 26 52iesdcsesewaees 133 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Table of Contents 9 For More Information On This Product Go to www freescale com User s Manual Freescale Semiconductor Inc Table of Contents E 1 E 2 E3 E34 E 32 E33 E 4 ES ES E52 BE Appendix E EEPROM Bootloader CONTENTS sosa rro rara T treductioti A AER AER EE A A Serial S Record Bootloader ooooo o ERASE 33 AA dq A MOGUL q 9 Vector Jump Table Interrupt and Reset Addresses Reloading a
24. and MODB Refer to Table 4 2 W7 Vpp Vpp Selection 2 3 Connects MCU s Vpp pin to Vpp non programming mode E 1 2 Connects MCU s Vpp pin to Vpp input header programming mode W8 Vpp Input Header o m 1 Vpp input 2 Ground 2 1 W9 BDM In 1 Input to MCU BKGD 2 Ground 3 NC 5 1 4 RESET input to MCU 6 Vpp Note At reset the BKGD input serves with MODA and MODB to determine the CPU mode Refer to Table 4 2 User s Manual M68HC12B32EVB Evaluation Board Rev 1 100 Hardware Reference MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference Power Input Circuitry Table 4 1 Jumper Selectable Functions Sheet 3 of 3 Diagram Setting Description W10 Vpp Connection to BDM Out o u 1 2 Connects Vpp to BDM out pin 6 77 Cut BDM out pin 6 open W11 Reset Connection to BDM Out e 1 2 Connects MCU generated reset PT6 to BDM out pin 4 me Cut BDM out pin 4 open W12 BDM Out 1 BKGD output from MCU PT7 2 Ground 5 1 3 NC 6 2 4 Reset output from MCU PT6 5 NC 6 Vpp W13 W14 RS 232C Configuration Reserved H H In Reserved W15 LVI Reset Enable In On board low voltage reset enabled Cut On board LVI reset disabled provide external reset W16 On Board Crystal Enable In On board crystal connected to MCU EXTAL Cut On board crystal disabled use W16 to provide external clock to EXTAL
25. bootloader Reset and interrupt vectors 32 Kbytes on chip FLASH EEPROM User s Manual M68HC12B32EVB Evaluation Board Rev 1 94 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation Operational Limitations 3 10 Operational Limitations 3 10 1 On Chip RAM In EVB mode D Bug12 requires many of the MC68HC912B32 s resources for execution In this mode the EVB cannot provide true emulation of a target system These limitations are described in the following subsections If target system emulation is required the EVB may be reprogrammed and controlled via the BDM interface Operation as a target is described in 3 2 3 Pod Probe Mode D Bug12 requires 512 bytes of on chip RAM for stack and variable storage This usage is shown in Table 3 6 3 10 2 On Chip EEPROM D Bug12 occupies FLASH EEPROM starting at address 8000 as shown in Table 3 6 This area is thus not available for emulation of a target application 3 10 3 SCI Port Usage D Bug12 requires the MCU s serial communications interface SCI port for the terminal interface The SCI port is either connected default or disconnected from the RS 232C RXD and TXD signals by means of jumpers WI and W2 3 10 4 Dedicated MCU Pins As used on the EVB with D Bug12 the following MCU lines perform specific functions If an application requires their use the EVB hardware and or operat
26. debug monitors and simulators Examples of hardware development tools include simulators logic analyzers and PROM programmers EPROM Erasable programmable read only memory A non volatile type of memory that can be erased by exposure to an ultra violet light source MCUs that have EPROM are easily recognized by their packaging a quartz window allows exposure to UV light If an EPROM MCU is packaged in an opaque plastic package it is termed a one time programmable OTP MCU since there is no way to erase and rewrite the EPROM EEPROM Electrically erasable programmable read only memory input output I O Interfaces between a computer system and the external world For example a CPU reads an input to sense the level of an external signal and writes to an output to change the level on an external signal M68HC12B32EVB Evaluation Board Rev 1 144 Glossary MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Glossary instructions Instructions are operations that a CPU can perform Instructions are expressed by programmers as assembly language mnemonics A CPU interprets an opcode and its associated operand s as an instruction listing A program listing shows the binary numbers that the CPU needs alongside the assembly language statements that the programmer wrote The listing is generated by an assembler in the process of translating assembly lang
27. generate S record files for the new data using an M68HC12 compatible assembler or C compiler Next prepare the D Bug12 S record file for loading and add the customized S records to it Using a text editor perform these steps l 2 Search for the S record line that begins with S123FC00 Delete this line and all remaining S records except for the last line in the file which is the S9 end of file record This removes the bootloader program and vector table from the file Search for the S record line that begins with S120F6CO Replace this line with the S record containing the new customization data Search for the S record line that begins with S123F700 Replace this line and the next one S11FF720 with the S records containing the new startup code Make sure that no blank lines remain in the file as they may cause the loading process to fail The S record file may now be programmed into FLASH EEPROM using the E and P bootloader procedures described in E 3 Serial S Record Bootloader User s Manual M68HC12B32EVB Evaluation Board Rev 1 142 EEPROM Bootloader MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board Glossary 8 bit MCU A microcontroller whose data is communicated over a data bus made up of eight separate data conductors assembler A software program that translates source code mn
28. header footprints P2 P3 P4 and P6 surround the MCU and provide access to its I O and bus lines They may be populated with wire wrap pins or strip headers for use as I O connectors connection points for instrumentation probes and target hardware and connections to the prototype area described in 4 10 Background Debug Mode BDM Interface Figure 4 1 and Figure 4 2 depict the pin assignments for these headers M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Hardware Reference 105 For More Information On This Product Go to www freescale com User s Manual Freescale Semiconductor Inc Hardware Reference PA2 PA4 PA6 Vppa7 VRH PADO PAD2 PAD4 PAD6 Vonan PSO PS2 PS4 PS6 Vep PDLC5 PDLC3 PDLC1 Vggx77 PP7 Figure 4 1 MCU I O Headers P2 and P3 Now 13 15 17 19 Now ao A P CO 12 14 16 18 20 P2 O A PY 12 14 16 18 20 P3 PA3 PA5 PA7 Vss48 VRL DAD PAD3 PAD5 PAD7 Vssap PS1 PS3 PS5 PS7 PDLC6 PDLC4 PDLC2 PDLCO Vopx78 PP6 M68HC12B32EVB Evaluation Board Rev 1 106 Hardware Reference For More Information On This Product Go to www freescale com MOTOROLA 4 13 Schematics PB3 1 PB5 3 PB7 5 PE6 MODB 7 PE4 9 Vppxs1 11 EXTAL 13 PE3 15 PE1 17 DAD 19 P4 PP5 1 PP3 3 PP1 5 PTO 7 PT2 9 Ves 11 PT4 13 PT6 15 BKGD 17 PB1 19 P6 O A 5N CO 12 14 16 18 20 Oo A 5P CO 12 14 16 18 20
29. high order four bits of the byte The second character represents the low order four bits of the byte The five fields that comprise an S record are shown in Table A 1 Table A 1 S Record Fields Record The S record fields are described in Table A 2 Table A 2 S Record Field Contents Field Printable Contents Characters Type 2 S record type S0 S1 etc Record 2 Character pair count in the record excluding the Length type and record length Address 4 6 0r8 2 3 or 4 byte address at which the data field is to be loaded into memory From 0 to n bytes of executable code memory loadable data or descriptive information For Code Data 0 2n compatibility with teletypewriter some programs may limit the number of bytes to as few as 28 56 printable characters in the S record Least significant byte of the one s complement of the sum of the values represented by the pairs of characters making up the record length address and the code data fields Checksum 2 Each record may be terminated with a CR LF NULL Additionally an S record may have an initial field to accommodate other data such as line number generated by some time sharing systems Accuracy of transmission is ensured by the record length byte count and checksum fields M68HC12B32EVB Evaluation Board Rev 1 112 S Record Format MOTOROLA For More Information On This Product Go to www freescale com Frees
30. is displayed and command execution is terminated Before using the FBULK command a target device must have been selected with the DEVICE command that reflects the locations of the target s on chip FLASH EEPROM on chip RAM and the I O registers when the part is reset Failure to follow this restriction will cause the FBULK command to fail and may require that the EVB be reset FLASH EEPROM programming voltage Vpp must be applied to the target MCU If the target system is another M68HC12B32EVB board V pp may be supplied via header W8 with header W7 set accordingly For more information on these EVB headers see Table 4 1 Because the FBULK command downloads a small driver program into the target MCU s on chip RAM D Bug12 s breakpoint table is cleared before beginning execution of the driver This is necessary to prevent previously set breakpoints from accidentally halting the execution of the driver program M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 63 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc FBULK Erase Target FLASH EEPROM Continued Example S gt EBULK Flash Programming Voltage Not Present S gt FBULK F EEPROM Failed To Erase S gt EBULK S gt FBULK Command Not Allowed In EVB Mode gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 64 Operation MOTOROLA For M
31. is entered following the prompt the entered instruction is assembled and placed into memory The line containing the new entry is erased and the new instruction is disassembled and displayed on the same line The next instruction location is then disassembled and displayed on the screen The instruction mnemonics and operand formats accepted by the assembler follow the syntax as described in the CPU 2 Reference Manual Motorola document order number CPU12RM AD M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc ASM Assemble Instructions Continued A number of M68HC11 instruction mnemonics appear in the CPU12 Reference Manual that do not have directly equivalent CPU12 instructions These mnemonics listed in Table 3 2 are translated into functionally equivalent CPUI2 instructions To aid the current M68HC11 users who may desire to continue using the M68HC11 mnemonics the disassembler portion of the assembler disassembler recognizes the functionally equivalent CPU12 instructions and disassembles those instructions into the equivalent M68HC11 mnemonics When entering branch instructions the number placed in the operand field should be the absolute destination address of the instruction The assembler calculates the two s complement offset of the branch and places the offset in memory with the instruction T
32. memory Requires a user supplied communications program capable of emulating a dumb terminal Examples of acceptable communications programs are given in Appendix B Communications Program Examples Host computer using the MCU s BDM interface Frees the target MCU s SCI port for user applications This requires another M68HC12B32EVB for use as the target or a background debug development tool such as the Motorola serial debug interface SDI e Power supply and terminal interconnection cables as required For full details of equipment setup cabling and special requirements refer to Section 2 Configuration and Setup User s Manual M68HC12B32EVB Evaluation Board Rev 1 22 General Information MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information EVB Specifications 1 6 EVB Specifications Characteristic Table 1 1 lists the EVB specifications Table 1 1 EVB Specifications Specifications MCU MCU UO ports BDM in and out MC68HC912B32 HCMOS compatible 2 row x 3 pin headers Communications port Power requirements 16 MHz clock source Prototype area Area Holes RS 232C DCE port 2 7 to 45 0 Vdc 100 mA max For low voltage operation refer to 4 9 Low Voltage Inhibit LVI Approximately 1 5 inches x 3 inches 3 8 cm x 7 6 cm Approximately 15 wide x 31 high on 0 1 inch 2 54 mm centers Board dimensions
33. mode is selected If no external MCU is detected the software informs the user The target s EEPROM may be programmed while the host M68HC12B32EVB board is in EVB mode using the D Bug 12 commands BULK LOAD FBULK and FLOAD n bootload mode the host EVB s byte erasable or FLASH EEPROM may be reprogrammed with user code This mode also may be used to reload or customize D Bug12 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA General Information 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information D Bug12 allows programming of the MC68HC912B32 s on chip EEPROM through commands that directly alter memory For full details of all the commands refer to 3 7 D Bug12 Command Set When operating in EVB mode the MCU must manage the EVB hardware and execute D Bug 12 in addition to serving as the user application processor There are a few restrictions on its use For more information refer to 3 10 Operational Limitations 1 5 External Equipment Requirements In addition to the EVB the following user supplied external equipment is required Power supply See Table 1 1 for voltage and current requirements User terminal Options RS 232C dumb terminal Allows single line on board code assembly and disassembly Host computer with RS 232C serial port Allows off board code assembly that can be loaded into the EVB s
34. once in normal modes H COPCTL CME F CME FCM FCOP DISR CR2 CRI EE Il H c COPCTL disable watchdog H Clear all monitor RAM to start from a known state i ldx MonRAMStart ClrRAM eu sheet Clear one and inc pointer Cpx MonRAMStart MonRAMSize bne C1rRAM loop till RAM clear H Enable pipe signals E low strobe and read write in port E A PIPOE NECLK LSTRE and RDWE are write once in normal modes E PEAR ARSIE CDLTE PIPOE NECLK LSTRE RDWE 0 0 0A i ldaa 2c prevent later protection lock staa PEAR PROTLK is write once 7 Without changing modes enable internal visibility A MODE SMODN MODB MODA ESTR IVIS 0 EMD EME 0B i bset ODE 08 set IVIS 7 Enable EEPROM so monitor can program erase bytes A EEMCR p I T e XE rcc la 5p E i PROTLK EERC FO BPROT 1 BPROT6 BPROT5 BPROT4 BPROT3 BPROT2 BPROT1 BPROTO F i ldaa Sfc prevent later protection lock User s Manual M68HC12B32EVB Evaluation Board Rev 1 126 D Bug12 Startup Code MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc D Bug12 Startup Code staa EEMCR PROTLK is write once ELE BPROT allow EE program and erase i E Disable writing to the on chip FLASH EEPRO 7 FEELCK LG 30 2 0 Se Y
35. requirement is necessary for the FBULK and FLOAD commands to work properly M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 59 For More Information On This Product Go to www freescale com DEVICE Example User s Manual Freescale Semiconductor Inc gt DEVICE Specify Target MCU Device Continued Device 912B32 EEPROM 0D00 SOFFF F S lash 8000 SFFFF RAM 0800 SOBFF I O Regs 0000 gt DEVICE 912032 1d00 1fff 8000 ffff 800 bff O Device 912B32 EEPROM 1D00 S1FFF E S lash 8000 SFFFF RAM 0800 SOBFF I O Regs 0000 gt DEVICE 812a4 EE 812A4 EPROM 1000 S1FFF S RAM 0800 SOBFF I O Regs 0000 gt M68HC12B32EVB Evaluation Board Rev 1 60 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Specify Target EEPROM Base Address EEBASE Syntax Where NOTE Restrictions EEBASE Address Address is an optional 16 bit hexadecimal number Each time D Bug12 performs a memory write it automatically performs the necessary register manipulations to program the on chip EEPROM if the write operation falls within the address range of the target s on chip E
36. reset interrupt vector table After the erase operation a verify operation checks for proper erasure of all locations If the erase operation was successful the message Erased is displayed and the bootloader s prompt is redisplayed M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA EEPROM Bootloader 137 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader E 3 2 P rogram E 3 3 L oadEE User s Manual If any locations were found to contain a value other than FF the message Not Erased is displayed and the bootloader s prompt is redisplayed If an error occurs see the previous caution In FLASH programming mode the bootloader sends an ASCII asterisk character to the host computer indicating that it is ready to receive an S record The host then sends a single S record and waits for the prompt from the bootloader before sending the next S record This process is repeated until the bootloader receives an end of file S9 record from the host computer If no S9 record is received the bootloader continues to wait for another S record indefinitely In this situation the EVB must be reset to return to the bootloader s prompt S records already loaded into FLASH EEPROM are unaffected by the missing S9 record reprogramming is not necessary If a FLASH EEPROM location fails to program properly the message Not Programmed is displayed and
37. sarta Seen RE RECO RT hereon A 111 REGBASE commande 81 82 E EE 53 67 68 83 84 85 86 94 129 1 M 21 28 32 38 42 102 103 RESET command 24222805 244460 xw Rb OE ER PR ROUEN EN 83 RM command cese errre and nsten terret ane EPER Md bequeme Cds 84 A aaa EE 20 RS 232C interface es 29 30 95 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Index 153 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc S EECH E et ene RE tye he 65 71 88 89 90 91 92 111 116 lee he gee O EEN 21 SCI port aud Fate des ecc Rene cene ek eee EE EE EE ooh ee 51 ei date zi dd oe eae dare ied eo ke EUR d eee eee E 29 limitations A eR ee Pe ede ah Be 95 USAC c 22 29 30 serial debug interface SDI iius RR ER RR dee ee Ee 20 22 30 specifications A LAETI 23 SRAM sei TI PPS BH EG v uU Re er EP S 20 S record CONLENE a Io MURS e edge wath debe au eR qe ei 111 ee 114 field contents iz aspe Reps i Recipe b Neb a eid 112 UI EE 112 OVERVIEW eins tee eebe a eei eee ie e edad ents 111 SO header record 114 SU TEC a tala ad 114 SI TEC it A ed A gus 115 So ar SEN dad Ee dE dee que bid dus 116 termination record ee 116 STOP command 3 694 956 6448 ee pose Gee Pes EUs ERO SEER EEL REY 85 A UE e ots ie settee the vont 21 locatons oiov ege EE AEN E EEE EE 18 SI A A Ee 42 T Tcommand iib la S eU ERU LACER PIER shed 86 87 target BD
38. setting up and using pod mode e User boot program Upon reset the user program executes immediately D Bug12 commands are not available Communications with the user terminal and with the target system are controlled by the user program M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 41 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 3 2 4 Bootload Mode 3 4 Reset In bootload mode a user program may be loaded into the host EVB s byte erasable or FLASH EEPROM If the user code replaces D Bugl2 in FLASH EEPROM it serves as the boot program when the EVB is restarted in EVB or pod mode This procedure is described in Appendix E EEPROM Bootloader EVB operation can be restarted at any time by activating the hardware reset function Do this in one of two ways e Press and release the on board reset switch S1 always applicable e Activate the external reset input if one has been provided for operation below 3 0 Vdc Note that the EVB s reset circuitry is associated with the low voltage inhibit LVD protection For more information refer to 4 8 Reset and 4 9 Low Voltage Inhibit LVI 3 5 Aborting a User Program User s Manual When operating in EVB mode the only way to recover from an erroneous or runaway user program is to press the reset switch S1 If this becomes necessary the jumpers on headers W3 and W4 should be set to execute
39. supply See Table 1 1 EVB Specifications for the voltage and current specifications For full details of the EVB s power input circuitry refer to 4 4 Power Input Circuitry A power supply with current limiting capability is desirable If this feature is available on the power supply set it at 200 mA Connect the external power supply to connector P5 on the EVB using 20 AWG or smaller insulated wire Strip each wire s insulation 1 4 inch from the end lift the P5 contact lever to release tension on the contact insert the bare end of the wire into P5 and close the lever to secure the wire Observe the polarity carefully Do not use wire larger than 20 AWG in connector P5 Larger wire could damage the connector 2 5 EVB to Terminal Connection For factory default operation connect the terminal to P1 on the EVB as shown in Table 2 2 This setup uses the MCU s SCI port and its associated RS 232C interface for communications with the terminal device Standard commercially available cables may be used in most cases Note that the EVB uses only three of the RS 232C signals Table 2 2 lists these signals and their pin assignments Other signals have been routed through the RS 232C interface chip for proper levels Some terminal interface programs require proper levels on all pins to function correctly The EVB s RS 232C connector P1 is wired as data circuit terminating equipment DCE and employs a 9 pin subminiature D DB 9 receptacle
40. with any parameters 2 From the Macintosh File menu select Send File ASCII 3 From the dialog box select the S record file to be transferred 4 Click on Send NOTE S records are not displayed during the file transfer Upon completion of the S record file transfer the D Bug12 prompt is displayed User s Manual M68HC12B32EVB Evaluation Board Rev 1 124 Communications Program Examples MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board AP PAGE PORTE e EI Ed ZC g EE BI e ODE INITRG INITEE COPCTL CSCTLO CSCTL1 CSSTRO PORTAD EEMCR BPROT FEELCK onRAMSize RAM START RAMSize STACKTOP EE_START MonRAMStart equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ Appendix C D Bug12 Startup Code The D Bug12 startup code is located in the EPROMs U7 and U9A in the address range FD80 to FDFF as shown in Table 3 6 Factory Configuration Memory Map To customize this startup code it is necessary to alter the startup code in FLASH EEPROM For more information refer to Appendix E EEPROM Bootloader 0000 0008 MAP PAGE 0009 MAP PAGE 000a MAP PAGE 000b MAP PAGE 0011 MAP PAGE 0012 MAP PAGE 0016 MAP PAGE 0
41. 0000000000000002144F 12305600000000000000000000000000000000002187A0F 3BAC7A0F 3BBC7A0F11E87A0F 62 12305803C727A0F3C847A0F3C967A0F3CA8F50F379C379D379E27FAF50F379F37BF43FCE8 12305A07501177A4054173540523604361C27F90088B0D637BCO1BC360227F70A0D3E00A9 12305C04500B70427F936BC3C01B0F027F7277537BC400017BC405027F936CC780DB60477 12305E027F936A0274A27F77803B6FEB03A7808B6162776B7DE3730000127F93686752002 9030000FC V C1 ca co c0 C0 C0 C0 C2 C0 c0 c0 c0 0 0 0 0 OQ User s Manual M68HC12B32EVB Evaluation Board Rev 1 88 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Verify S Record File Against Memory VERF Syntax VERF AddressOffset Send File Where AddressOffset isan optional 16 bit hexadecimal number Send File is the host computer communications program s utility for sending an ASCII text file Refer to Appendix B Communications Program Examples The VERF command is used to compare the data contained in an S record object file to the contents of EVB memory The address offset if supplied i
42. 03c MAP PAGE 003d MAP_PAGE 003e MAP_ PAGE 006f MAP PAGE 00f 0 MAP PAGE 00f1 MAP PAGE SOOf4 MAP_ PAGE 0400 0200 0800 0400 RAM_START RAMSize 0d00 M68HC12B32EVB Evaluation Board Rev 1 tack at top of internal RAM EEPROM located here out of reset User s Manual MOTOROLA D Bug12 Startup Code 125 For More Information On This Product Go to www freescale com CustData IOBase ri Si EBase Freescale Semiconductor Inc D Bug12 Startup Code equ S f6c0 equ CustDatat15 location of user supplied base address of I O registers equ CustDatat19 location of user supplied base address of EEPROM xref BootLoad UserFnTable xdef MonStartup EEDelay Switch text KKK Ck C Ck CK C Ck Ck Ck Ck CK C Ck Ck CI Ck CK C Ck CC Ck CK Ck Ck Ck Ck Ck CK Ck Ck Ck Ck Ck Ck Ck Ck kk Ck Ck Sk Ck ck kk Ck CK Sk Ck Ck kk Ck Ck Sk Sk Sk Sk Sk Sk Kk Mk Sk ko ko kx kx ok E INITIALIZATION The code in this section is initialization for the monitor on the EVB12B32 A EE A ROSIE ROMA Meo amen taht MonStartup lds STACKTOP initialize monitor stack pointer r E Disable the COP watchdog by CR2 CR1 CRO 0 0 0 H COPCTL 07 when reset in normal modes H FCME and CRx bits are write
43. 3 6 1 3 6 2 3 6 3 EN Section 3 Operation CAUCUS PC n 33 perl WIGS coy 2645464 eeu scee eee Gessegare ieee es RE PS 32 A e 33 Jump ERPROM Mod c i22c4sieddesentadeecaccnaeebenees 35 Pod Probe Mode oria o V E ebe eg E 36 Target Types Suppotted AER EE ER 36 Target MCU ChatactensibS A 2244244440604 ahh eons 37 Programming the Target s ERBDPROM o 31 Controlling Target EXGCU ON 23 Se AEN EIERE n Eva 37 Bootload Mode Las Ek Age AAA i saniki 37 clc n A rT M 38 Startup EE 38 Opening EE 39 EYB n c C 39 Jump BEPRUM Mode a ENEE AER E 40 Pod E 2295323 9 VR A ed de Perd 40 BOON NOUS AA 42 evP 42 Aborting a User DEORUM ee ME C HERRERA AAA 42 Laos D Baepgl2 Commands ick i cbse a x Rr EEG 43 Command Line Prompt 2252242425 EERSTEN 43 Enternng Commands ca oss oboe pees aloes RERES DER S 43 Command Set SUMMATY EA AER NEE EE ECH prada 45 D B gl2 Command Sel ccoo eases RE REEL r RETE 46 ASM Assemble Instructions a A a EE ne 47 BAUD su Band Rate rd 51 BF Block TT 52 BR Breakpoint Sel socios hg E AE 53 BULK Bulk Erase On Chip EEPROM 55 CALL Call Subroutine aisdad edes radios 56 DEVICE Specify Target MCU Device 57 EEBASE Specify Target EEPROM Base Address 61 FBULK Erase Target FLASH EEPROM 63 M68HC12B32EVB Evaluation Board Rev 1 6 Table of Contents MOTOROLA For More Information On
44. ASM User s Manual Assemble Instructions Continued For all branching instructions Bcc LBcc BRSET BRCLR DBEQ DBNE IBEQ IBNE TBEQ and TBNE the numeric value of the address portion of the operand field is displayed as the hexadecimal absolute address of the branch destination All offsets used with indexed addressing modes are disassembled as signed decimal numbers All addresses whether direct or extended are disassembled as 4 digit hexadecimal numbers All 8 bit mask values BRSET BRCLR ANDCC ORCC are disassembled as 2 digit hexadecimal numbers All 8 bit immediate values are disassembled as hexadecimal numbers All 16 bit immediate values are disassembled as hexadecimal numbers M68HC12B32EVB Evaluation Board Rev 1 50 Operation MOTOROLA For More Information On This Product Go to www freescale com Set Baud Rate Syntax Restrictions Example Freescale Semiconductor Inc Operation D Bug12 Command Set BAUD BAUD BAUDRate Where lt BAUDRate gt is an unsigned 16 bit decimal number The BAUD command is used to change the communications rate of the SCI used by D Bug12 for the terminal interface Because the lt BAUDRat e gt parameter supplied on the command line is a 16 bit unsigned integer baud rates greater than 65 535 baud cannot be set using this command The SCI baud rate divider value for the requested baud rate is calculated using the E clock value supplie
45. ChfD EE 102 programin P 22 microcontroller unit e 15 MM commande T4 73 MMW commande 76 T1 modes operating See EVB modes cisco codes eee he 35 Monitor POETA pos dus pax sux XR RPP RO SEIN des Ds d 19 MOVE cotr mand 2 02 35405 ere RR b EE Dae e ERI E dg 78 N NOBR command ice see ze er RR REV EE p Ed EX 79 O operational limitations A A RR RE AU 95 OSCIIldtoE A A ded 103 User s Manual M68HC12B32EVB Evaluation Board Rev 1 152 Index MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Index P Pl SCIRS 232C port EN EN EN RR Ry Rp Ra 29 30 P2 P3 P4 P6 MCU access enn 16 21 105 PS power input 0 eee ee eee een ees 29 101 packing SE case cipem dio o ied nt Ede ddp d dO de doa M ird E 2 DOd Modo rrr 36 40 power distribution 106 107 indicator LOCA 5 5 5b ob gae dock Sand ta X Sd wp x Neid Maa ed pe 18 input circuit and protection eh 101 input connector EE 29 low voltage inhibit i usus essa x Rex EE REX ERE E RR RS 104 supply connecting 10 2 0 eee uer ed Hee eer RE eee CRESCE a Bees EE 29 supply require miens vu separa ror bre RE E rra RE Ed 22 23 printed circuit board ls EE 97 EE 18 19 program ANON 4254 05 bece PPM HYPE rial daa 21 67 95 ps MA tee n REN A a E i 21 105 R RAM EE 20 WMAP EE 94 USAS EE ens eens 93 102 RD command snoot att sco de dao des 80 record ENE 2 ereecht dd Ee ae ode oun eee aes EN 111 record type
46. E StartAddress EndAddress DestAddress Move a block of memory NOBR lt address gt Remove One All Breakpoint s D Display all CPU registers EGBASE Address Set base address of I O registers ESET Reset target CPU Modify CPU Register Contents Stop target CPU lt count gt Trace lt count gt instructions PLOAD lt StartAddress gt lt EndAddress gt S Record Memory isplay ERF AddressOffset Verify S Records against memory ontents Register Name Register Value Set register contents Register Names PC SP X Y A B D CCR Status Bits S XM H IM N Z V C E 9 FU Q dH mmm M68HC12B32EVB Evaluation Board Rev 1 70 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Load S Record File LOAD Syntax LOAD lt AddressOffset gt Send File Where AddressOffset isan optional 16 bit hexadecimal number Send File is the host computer communications program s utility for sending an ASCII text file Refer to Appendix B Communications Program Examples for examples The LOAD command is used to load S record object files into memory from an external device The address offset if supplied is added to the load address of each S record before its data bytes are placed in memory Providi
47. ED ET odd ENE SId Zyd oF 62 Idd AE GE HEA OTOdA an ZFOGA D EXE Odd Wa Zdd E vdd 4 S Y D E z i p ag ES EE EIERE s mozeosasve9 8 ae JequinN Ueuunoog ezis 4 i EE HLOd LON 108 HOIAZCO NWIXVW WJHLIH sxLV IndOd ALON anu 1001 ININd073A30 NY a D dei OS 8z Q IMOZ9SXVAW 3 ges oE A SEN wen Zu o HH 009 N3 9 i OSH L lt ISH 15 Ob 0 Ord L mu Y o o osy 1 lt eu Gan AH Ch H PLM H L o o z Ozu 1 lt Izu TWNIWYSL OL TVIHSS E ELM Oly 1 lt nu O LI osL o lab b gt OzL ano o E 0 Lis OLL 4 0 o tt 20 VIO S o 20 VIO o S was A 8 de Si ar PA z E Se o z es epe S T gt D SE dei 1 ain I 9 os E osd H er SS Z99x vi we 3 em ONS N3 3n10 0 890 gt o iSa gt ee OSH L lt ISH _ _ ua li uE Ory 1 lt Wu cw OSH 1 lt eu ells A Ss o Oz 1 lt Izy PES sales angg 1 mem OlWL lt 10 de Se e ET rs e 05 ZS K Ae Ce I L 1 osL g a zo x 1 Lis Oz gt IL gt Ol aan ES VL
48. EPROM Because user code may change the EEPROM s base address by writing to the INITEE register D Bug12 must be informed of the EEPROM s location if automatic EEPROM writes are to occur The EEBASE command is used to specify the base address of the target processor s on chip EEPROM When operating in EVB mode the default EEPROM base address and range are specified in the customization data variables CustomData EEBase and CustomData EESize The value in CustomData EEBase is used by the startup code to remap the EEPROM The EEBASE command may not be used to relocate the I O registers When operating in pod mode the target s default EEPROM base address and range are specified by the currently selected device See the DEVICE command for additional details The EEBASE command does not check to ensure that the parameter is a valid base address for the selected M68HC12 Family member If an improper base address is provided automatic programming of the on chip EEPROM will not operate properly The EEBASE command does not automatically modify the INITEE register The user is responsible for ensuring that the INITEE register is modified either manually or through the execution of user code The EEBASE command may not be used when D Bug12 is operated in EVB mode M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 61 For More Information On This Product Go to www freescale com Freescale Sem
49. Freescale Semiconductor Inc M68HC 12B32EVBUM D October 1999 M6SHC 12B32EVB EVALUATION BOARD USER S MANUAL AA MOTOROLA For More Information On This Product o to www freescale com Freescale Semiconductor Inc Important Notice to Users While every effort has been made to ensure the accuracy of all information in this document Motorola assumes no liability to any party for any loss or damage caused by errors or omissions or by statements of any kind in this document its updates supplements or special editions whether such errors are omissions or statements resulting from negligence accident or any other cause Motorola further assumes no liability arising out of the application or use of any information product or system described herein nor any liability for incidental or consequential damages arising from the use of this document Motorola disclaims all warranties regarding the information contained herein whether expressed implied or statutory including implied warranties of merchantability or fitness for a particular purpose Motorola makes no representation that the interconnection of products in the manner described herein will not infringe on existing or future patent rights nor do the descriptions contained herein imply the granting or license to make use or sell equipment constructed in accordance with this description Trademarks This document includes these trademarks Motorola and the Motorola log
50. M as specified by the DEVICE command In both operating modes all of the other registers are initialized with the values contained in the customization data table The SysC1k field is used to inform D Bug12 of the system clock frequency M Its value in hertz is set to 8 000 000 In this implementation the E clock frequency is the same as the system clock frequency M SysC1k is used by the D Bug12 BAUD command in calculating the new value of the SCI baud register for the requested baud rate It is the responsibility of the startup code to perform any actions necessary to set the system clock frequency D Bug12 does not set or change the system clock frequency using the SysC1k value The IOBase field defines the base address of the input output 1 0 registers This address is used by D Bug12 when accessing the I O registers associated with the SCI and when programming or erasing the on chip EEPROM On the MC68HC912B32 the I O registers are mappable to any 2 Kbyte memory space Therefore the TOBase entry should be only a multiple of 2048 The value of TOBase is set to 0x0000 which is the default address of the I O registers for the MC68HC912B22 It is the responsibility of the startup code to set the base address of the I O registers D Bug12 does not set or change the I O register base address M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA D Bug12 Customization Data 131 For More Information On Th
51. M interface 5e Bees bese ee ab a Pe qund 36 execution Control 37 Le E P rr 36 pou o PPP e Ecg Bee ee ee EEN 37 programit o oo qud vd ach a a a a E aes od deed ES 37 User s Manual M68HC12B32EVB Evaluation Board Rev 1 154 Index MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Index terminal baud rate usina tr ad ia das 32 31 Cabling Lp dt is A AA Es 29 30 communications parameters 2 0 0 0 eee eee eee 31 32 communications software 22 31 118 interface PIECUIEEY 4 4c e EAR EXER Per e Ee Sedans ee ED EE fa 102 limitations 0 RRIRRRRRRRR RR 3 res 96 requirements Lo ci cece A PC d 22 SUL BODL v cip oa Sade RUP do E Sha esum s aM apis toed 29 102 SelUD cca eee Rc RO dace qe ec Kor deci ees Ca n 29 31 102 U upacking instructions ye aaa Raw exp RT AS ve ED E ak edo ue 27 UPLOAD command ues RR RR ee 88 V vectors jump Tables caricia ai 139 MEMO e EE 94 VERF command aoaseaaa auena aaeeea 89 90 W W15 external reset eee 101 103 104 Wlo evtemalcdock ec ens 101 103 WS EE 100 137 WO W12 BDM mterface RII 105 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Index 155 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board Rev 1 156 Index MOTOROLA For More Information On This Product Go to
52. MODIFY command is used to examine and or modify the contents of the CPU12 s registers in an interactive manner As each register and its contents are displayed D Bug12 allows the user to enter a new value in hexadecimal for the register If modification of the displayed register is not desired entering a carriage return will cause the next CPU12 register and its contents to be displayed on the next line When the last of the CPU12 s registers has been examined and or modified the RM command displays the first register giving the user an opportunity to make additional modifications to the CPU12 s register contents Typing a period as the first non space character on the line will exit the interactive mode of the REGISTER MODIFY command and return to the D Bug12 prompt The registers are displayed in this order one register per line PC SP X Y A B and CCR When operating in pod mode the CPU registers may not be modified when the R gt prompt is displayed gt RM PC 0206 200 SP 03FF lt CR gt X 1000 1004 Y 3700 lt CR gt A 27 CR B FF lt CR gt CCR DO D1 PC 0200 gt M68HC12B32EVB Evaluation Board Rev 1 84 Operation MOTOROLA For More Information On This Product Go to www freescale com Stop Execution on Target MCU Syntax Restrictions M68HC12B32EVB Evaluation Board Rev 1 Example Freescale Semiconductor Inc STOP Operation D Bug12 Comm
53. O z 0 en 0 ed 0 sc LOCK F4 i ldaa 01 write a 1 to the FLASH LOCK bit to disable accidential reprogramming of staa FEELCK the FLASH memory where we re located H ldd EEBase get the user supplied base address of the on chip EEPROM oraa 1 make sure that the EEON bit remains set staa INITEE re map the on chip EEPROM H ldd IOBase get the user supplied base address of the on chip I O registers staa INITRG re map the on chip registers ldx _UserFnTable point to the table of user accessibl routines jmp 0 x the first entry is a pointer to main Zi A aere s H i i H This small subroutine is used to produce a delay of approximately 10 ms This delay is based on the following conditions H S 1 An 8 00 MHz E clock H 2 Subroutine located in internal memory H S This routine is called by D Bugl2 s WriteEEByte function through a 7 pointer stored in the Customization Data Table H _EEDelay 1dx 20000 load delay count into x DlyLoop dex decrement count bne DlyLoop loop till done rts return H H end M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA D Bug12 Startup Code 127 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc D Bug12 Startup Code User s Manual M68HC12B32EVB Evaluation Board Rev 1 128 D Bug12 Startup Code MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor
54. PROM starting at address 0D00 as shown in Table 3 6 This mode is made using the MCU s PADO line User code may be programmed into byte erasable EEPROM using the D Bug12 commands listed in 3 6 3 Command Set Summary M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Control can be returned to D Bug12 two ways Move the jumpers on headers W3 and W4 to position 0 and reset the EVB e Terminate the user program with code that returns to D Bug12 after execution has finished To return to D Bug12 automatically after a user program has finished include these lines as the last instructions to be executed in the program STACKTOP equ 0c00 Stack at top of on chip RAM AltResetVect equ SF7FE lds STACKTOP jmp AltResetVect PCR jump to start of D Bugl2 3 2 3 Pod Probe Mode In this mode W3 0 and W4 1 the EVB and D Bug12 serve as a pod probe interface between a target system and the user Communications between the EVB and the target are by means of the background debug mode BDM interface using the EVB header W12 BDM out This arrangement allows the target system to perform true emulation of an application as the BDM interface is non intrusive upon the target s foreground operation The target s on chip resources are all available for the application The target
55. SH WAP MC 94 low voltage protection ood 4 veRAWe d RE der ia QI RENE 104 operating modes iuste boe e e ER ERR gos 19 20 21 28 EIERE 65 93 136 starting execution Tromm NN eee rh ny 35 37 136 n M a 93 102 EPROM EEN 20 evaluation board 422i rr ba ERREUR ERR ES aX X PP ER REA 15 EVB component placement o oooocoooco eee 18 CONEICC colors retirar tires 28 98 description HEEL EE E E 15 lege Pr 97 GSUUPBS Lors aside RP HERES SEG RR RP MERE RE SEK eee eee es Pd RS 15 sun Lu eea cote EUER 19 functional OVERVIEW Gess rede teras sw FRIES E E px T qua d e a qnn 19 operating instructions iier EEN RE AE erede iau E dd 38 operating modes bootload s ke iem Resp ann be e Deed 37 42 EVB 35 39 jump EEPROM i42 RR RR EE EE ERR RE E IAE 35 40 POs eid eave EQREEECREOD en bee ee e Ede 36 40 operating procedures lesvianas 39 packing EEN 27 o PERDE RN REENEN 23 startup procedure ccs ERI Dax x RARE E REA RR RR Eqs 38 DDSC EUIS ioa d pore dpa dO do dp d ana oa ed buie 27 AA A a a a aa aaa Naaa 35 39 examples BTGCUDUSA deo a ee dee ote eee aded o a gheet 114 User s Manual M68HC12B32EVB Evaluation Board Rev 1 150 Index MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc FBULK commande file transfers lee PIE WATE eatae ra ae e tt FLASH defined A FLOAD co
56. SH EEPROM is used for program execution with byte erasable EEPROM and some RAM available for user code data Although other MCU modes are available the EVB was designed for the single chip mode of operation There is no provision for external memory For more information on the CPU refer to the CPU12 Reference Manual Motorola document order number CPU12RM AD User s Manual M68HC12B32EVB Evaluation Board Rev 1 102 Hardware Reference MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference Clock Circuitry Table 4 2 CPU Mode Selection 4 7 Clock Circuitry BKGD MODB MODA M Through Header W5 Header W6 Mode Description BDM In 0 0 0 Special single chip 0 0 1 Special expanded narrow 0 1 0 Special peripheral 0 1 1 Special expanded wide 1 0 0 Normal single chip 1 0 1 Normal expanded narrow Reserved currently defaults to 1 1 0 peripheral mode 1 1 1 Normal expanded wide The EVB comes with a 16 MHz crystal Y1 with appropriate startup capacitors The board should be able to accommodate most crystals and ceramic resonators Header W16 may be used to disconnect Y 1 from the MCU s on chip oscillator An external clock may then be supplied to EXTAL through W16 4 8 Reset The reset circuit includes a pullup resistor reset switch S1 and a low voltage inhibit device with a toggle voltage of 3 0 Vdc This reset circuit drives
57. This Product Go to www freescale com Freescale Semiconductor Inc Table of Contents FLOAD Program Target FLASH EEPROM 65 G Go Execute a User Program 22 ELEA ER 67 GT AAA pideei 68 HELP Onscreen Help Summary 69 LOAD ds AA Tl MD Memory Display DD T2 MDW Display Memory as 16 Bit Word 73 MM Memory AMA eG RARO REES 74 MMW Modify 16 Bit Memory Word 76 MOVE Move Memory Block s i sie ene 78 NOBR Remove Breakpoints LuecosesesesVenosc i Gaus 79 RD Register Display 224 d EEN AER AER 80 REGBASE Specify Target EEPROM Register Address 81 RESET Reset Target at DEER 83 RM Register MER ee RUN AE EEN AER 84 STOP Stop Execution on Target MCU 85 T jh be rm 86 UPLOAD Display Memory in S Record Format 88 VERF Verify S Record File Against Memory 89 RegisterName Modify Register Value 91 3 8 OIT Board Lodo e EEN 93 39 Memory Uio ocara enpre EEE 93 3 9 1 o PCR 94 3 9 2 Memon OU E 94 3 10 Operational Limitations d Bee EIERE NEE EE A 95 SIBI EE cra pi ii de besides quias 95 102 Ortp EEPROM 24443 kakXRs EECH Adr ERR EACH 95 SS sl POR USB e Aere rER ERE EP tase eer se aeee eee 95 3104 Dedicated MCL PII Lau gege vide ues onmes e ida 95 3105 Terminal Communications A AEN EENS Ek 96 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Table of Contents 7 For More Information On This Product Go to
58. U A accumulator Address UserX User CPU X index register Address UserY User CPU Y index register Address UserPC User CPU Program Counter Address UserSP User CPU Stack Pointer unsigned long SysClk System Clock frequency in Hz Address IOBase Base address of the I O registers unsigned int SCIBaudRegVal Initial SCI BAUD register value Address EEBase Base address of on chip EEPROM unsigned int EESize size of the on chip EEPROM void Delay void pointer to EEPROM delay routine int AuxCmdCount number of commands in the auxiliary command table CmdTblEntryP AuxCmdTableP pointer to the auxiliary command table CustomData D 2 2 Assembly Format org SF6CO CustData equ UserCCR dc b 90 User CPU Condition Code Register UserB dc b 00 User CPU B accumulator UserA dc b 00 User CPU A accumulator UserX dc w 0000 User CPU X index register UserY dc w 0000 User CPU Y index register UserPC dc w 0000 User CPU Program Counter UserSP dc w 0AO00 User CPU Stack Pointer SysClk dc 1 38000000 System Clock frequency in Hz IOBase dc w 0000 Base address of the I O registers SCIBaudRegVal dc w 52 Initial SCI BAUD register value EEBase dc w 0D00 Base address of the on chip EEPROM EESize dc w 768 Size of the on chip EEPROM EEDelay dc w _EEDelay
59. U timing and input output 1 0 circuitry the EVB simplifies user evaluation of prototype hardware and software M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA General Information 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information The board consists of a 5 15 inch by 3 4 inch 13 1 cm by 8 64 cm double sided printed circuit board PCB that provides the platform for interface and power connections to the MC68HC912B32 MCU chip Figure 1 1 shows the EVB s layout and locations of the major components as viewed from the component side of the board Hardware features of the low cost EVB include User s Manual Double sided PCB Single supply 3 to 5 Vdc power input P5 RS 232C interface BDM background debug mode in and BDM out connectors for remote debugging of a user s target system Header footprints for access to all MCU pins 16 MHz crystal for 8 MHz bus operation Headers for jumper selection of and connection to hardware options for full details of the jumper settings refer to Table 4 1 RS 232 isolation W1 and W2 EVB mode selection W3 and W4 MCU mode selection W5 and W6 Vpp Vpp selection W7 Vppinput W8 BDM in W9 BDM out Vpp reset disconnects W10 and W11 BDM out W12 Low voltage inhibit LVI reset W15 EXTAL source and access W16 Four 2 row x 20
60. ajor alteration of the EVB s hardware operation These headers are populated and the factory installed jumpers on them are preset for the default EVB hardware and firmware D Bug12 configurations Table 4 1 lists these headers by function and describes their default and optional jumper settings e Cut trace header footprints offer EVB hardware options that are less likely to be changed These footprints are not populated The default connection between pins is a trace on the PCB To change a cut trace footprint the PCB trace must be cut To return to the original configuration a header and a jumper must be installed to re establish the shunt Use of the cut trace header footprints requires a thorough understanding of the MCU and of the EVB hardware Refer to the MC68HC912B32 Technical Summary Motorola document order number MC6SHC912BC32TS D and to the EVB schematic diagram 4 13 Schematics for design information When cutting a PCB trace to customize a header footprint use a sharp blade Be careful to avoid personal injury and not to cut adjacent traces M68HC12B32EVB Evaluation Board Rev 1 98 Hardware Reference MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference Configuration Headers and Jumper Settings Key to Table 4 1 Headers are depicted as viewed from either the component side as shown in Figure 1 1 EVB Layout and Component Placement or t
61. and Set STOP When operating in D Bug12 s pod mode the STOP command is used to halt target program execution and place the target processor in active background debug mode When operating in EVB mode the STOP command cannot be used If the STOP command is entered while in EVB mode an error message is displayed and command execution is terminated S gt ASM 4000 4000 CCFFFF LDD FSFFFE 4003 830001 SUBD S0001 4006 26FB BNE 4003 4008 20F6 BRA 4000 400A 00 BGND 2 S gt G 4000 R gt STOP Target Processor Has Been Stopped PC 4003 4003 S SP X Y D A B CCR SXHI NZVC 0A00 0000 00000 SX SE 1101 0000 830001 SUBD 0001 User s Manual MOTOROLA For Mo Operation re Information On This Product Go to www freescale com 85 Freescale Semiconductor Inc T Syntax Restrictions User s Manual Trace T lt Count gt Where lt Count gt is an optional 8 bit decimal number in the range to 255 The TRACE command is used to execute one or more user program instructions beginning at the current program counter PC location As each program instruction is executed the CPU 12 s register contents are displayed and the next instruction to be executed is displayed A single instruction may be executed by entering the TRACE command immediately followed by a carriage return Because of the method used to execute a single instruction branch instr
62. annot be established with the target system after repeated attempts check for these possible problems The host EVB s BDM out W11 must be properly connected to the target system s BDM connector If the target system is another EVB make sure that the host EVB s BDM outis connected to target EVB s BDM in W9 Ifthe target system is not another EVB verify that its BDM connector is wired to the proper MCU signals on each pin Ifthe target MCU does not have any firmware to execute it could run away possibly executing a STOP opcode and preventing BDM communications with the host EVB Thus it is strongly recommended that if the target system does not have firmware to execute at reset the target MCU initially be configured to begin operation in special single chip mode Resetting the target MCU in special single chip mode places it in active background mode See the target MCU s technical summary for details on setting the MCU operating mode Special D Bug12 command line prompts indicate the status of the target system S target is in active background mode R target is running a user program In addition to the normal D Bug12 commands that control execution of user code the RESET and STOP commands are available in pod mode These commands are described in 3 7 D Bug12 Command Set D Bug12 must be informed of the target MCU s basic operating parameters Refer to 3 2 3 Pod Probe Mode for more information about
63. as LDA meaning load A Another representation of an instruction set is the opcodes that are recognized by the CPU M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Glossary 143 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual CPU Central processor unit The part of a computer that controls execution of instructions CPU cycles A CPU clock cycle is one period of the internal bus rate clock Normally this clock is derived by dividing a crystal oscillator source by two or more so the high and low times will be equal The length of time required to execute an instruction is measured in CPU clock cycles CPU registers Memory locations that are wired directly into the CPU logic instead of being part of the addressable memory map The CPU always has direct access to the information in these registers The CPU registers in an MC68HC908 are A 8 bit accumulator X 8 bit index register CCR condition code register containing the H I N Z and C bits SP stack pointer and PC program counter cycles See CPU cycles data bus A set of conductors that are used to convey binary information from a CPU to a memory location or from a memory location to a CPU development tools Software or hardware devices used to develop computer programs and application hardware Examples of software development tools include text editors assemblers
64. ate Se 57 58 59 60 FEBASE cuidad dd ea 61 62 Et e HEI 63 64 EISE MC ele eeh da De dla lala e 65 66 Dir a CRS HEE CRD OEE RR OE REE 67 Cip as 68 HELP EE 69 70 BS EN REENEN 71 IER 72 MDW EE 73 MM dee dee Se e e SE E A 74 75 MMIW ins seats eei eei A do 390 77 MOVE Ze gege Eun rta NDW art ee 78 NOBR icm RR ERREUR eU E e bcc 79 KEE 80 REGBASE eeeeee eee eee s 81 82 RESE W 83 EEN 84 STOP EE 85 DTP 86 87 UPLOAD rronte cere ous rate are es a te ck enn oy roi re dae SEN 88 VERE stare A A n E 89 90 communications BDM es 36 communications EVB host Jee EE 32 51 52 limitations a A E E E ER DRE rus 96 PAIDOS ose cheese Laden E EEA ares re Sc RE 31 32 DOL POs crebris une dede beet at eme data pix eA etas 29 User s Manual M68HC12B32EVB Evaluation Board Rev 1 148 Index MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Index SOM Wales s RRRI eI DEI RERO SAG ee Hee dwe ea 22 31 118 configuration DBA ee de ba b a e RC Race ee Ee ka ed ex caos 125 129 142 nu M 28 35 JUMPETS C rr tr dt A E R E 98 connectors lOa ONS geleet ETT 18 PI SCIRS 232C EE 29 30 P2 P3 P4 P6 MCU accesgg ee 16 21 105 PS powetinp f cdaedu 9 xe xg Rx RE ORE RA AR E Rd E 29 101 EE EE 97 WI evtermmalreset een 101 103 104 W16 external cock ce eee 101 103 WB bp exer p onsen eed vx eee qx aes eee ees 100 137
65. atic shipping bag 3 Save all packing materials for storing and shipping the EVB 2 3 EVB Configuration Because the EVB has been factory configured to operate with D Bug12 it is not necessary to change any of the jumper settings to begin operating immediately As shown in Table 2 2 only two jumpers W3 and W4 should be changed during the course of factory default EVB operation with D Bug12 Table 2 1 EVB Startup Mode Jumpers Jumper Positions Startup Mode W3 WA EVB execution mode default D Bug12 is executed from FLASH 0 0 EEPROM upon reset The D Bug12 prompt appears immediately on the terminal display Jump EEPROM mode User code is executed from byte erasable 1 0 EEPROM upon reset For more information refer to Section 3 Operation 0 1 Remote debugging through BDM out header W12 1 1 Bootload mode Other jumper settings affect the hardware setup and or MCU operational modes For an overview of all jumper selectable functions refer to 1 3 General Description and Features For details of the settings see Table 4 1 Jumper Selectable Functions User s Manual M68HC12B32EVB Evaluation Board Rev 1 28 Configuration and Setup MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Configuration and Setup EVB to Power Supply Connection 2 4 EVB to Power Supply Connection CAUTION The EVB requires a user provided external power
66. ation D Bug12 Command Set Breakpoint Set BR Syntax BR lt Address gt Address Where Address is an optional 16 bit hexadecimal number The BR command is used to set a software breakpoint at a specified address or to display any previously set breakpoints The function of a breakpoint is to halt user program execution when the program reaches the breakpoint address When a breakpoint address is encountered D Bug12 disassembles the instruction at the breakpoint address prints the CPU 12 s register contents and waits for a D Bug12 command to be entered by the user Breakpoints are set by typing the breakpoint command followed by one or more breakpoint addresses Entering the breakpoint command without any breakpoint addresses will display all the currently set breakpoints Restrictions D Bug12 implements the breakpoint function by replacing the opcode at the breakpoint address in the user s program with an SWI instruction when operating in EVB mode or with the BGND instruction when operating in pod mode A breakpoint may not be set on a user SWI instruction when operating in EVB mode In either mode breakpoints may be set only at an opcode address and breakpoints may be placed only at memory addresses in alterable memory Even though D Bug12 supports a maximum of 10 user defined breakpoints a maximum of nine breakpoints may be set on the command line at one time This restriction is due to the limitation of the command li
67. ation On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board Section 3 Operation 3 1 Contents 3 2 NEE NEEN prados SES 3 2 1 EVB ENEE pick e ACEL EA d E EE CEA 35 EM Jump EEPROM MOI ks ad wes te TPEP RE EE SES 35 3 2 3 Pod Probe Mode AMA 36 KN Target Types pt A Eck rr Ek A dr 36 dba Tatget MCU E TROOOEISEOR ER 37 354 3 Programming the Target s EEPROM EEN 37 3 2 3 4 Controlling Target Execution 3 Ae ebe NENNEN ER Rhen 37 3 2 4 uos AAA ri Er ETE STREET EFEN 37 3 3 CUM T M 38 33 1 MAp Procede ARA IRA 38 EXC Operating Procedures der AAA VAHEE ARA d ES 39 41 544 a Fc 39 d d ad Jump EEPROM MEI iuniores 9 9 3OER DeC AO ROO AFER EROR REA 40 3 3 23 POU d no Cm 40 3 3 2 4 Bootload AAA 42 mY Maris 42 35 Abor ng a User Progr sier ere Ee 42 3 6 Using D Bug12 Commands ev ptr oir se IRES 43 3 6 1 Command Line POMO rr geg obo Rodi eas 43 3 6 2 Entering CONTAMOS cidsis cher eien PRA WR AAA AE ERES KE 43 3 6 3 Command Set Zu 92055069 d RR EEN EE 45 EN D Bug12 Command A ccr m 46 ASM Assemble Instructions i coss sisse cus eua 47 BAUD Set Bund Rale ross bh Hen deh HERI ERU 5 BF BENED 2 2BosdoseeweriC be T dime beans 52 BR DIO SML er 53 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 33 For More Information On This Product Go to www freescale com User s Manual Freescale Semiconductor Inc
68. ave the ability to wait for a specific character or characters before sending a line of text The FLOAD command is terminated when D Bug12 receives an S9 end of file record If the object file being loaded does not contain an S9 record D Bug12 does not return its prompt and continues to wait for the end of file record Pressing the reset switch returns D Bug12 to its command line prompt The host program used to send the S record data must be capable of waiting for an ASCII asterisk character before sending each S record line Because the on chip FLASH EEPROM is only bulk erasable the FBULK command should be used before loading new data into FLASH EEPROM with the FLOAD command M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 65 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc FLOAD Program Target FLASH EEPROM Continued Example User s Manual The FLOAD command cannot be used with S records that contain a code data field longer than 64 bytes Sending an S record with a longer field may cause D Bugl2 to crash or load incorrect data into the FLASH EEPROM Before using the FLOAD command a target device must have been selected using the DEVICE command that reflects the locations of the on chip FLASH EEPROM on chip RAM and the I O registers when the part is reset Failure to follow this restriction will cause the FLOAD command to fail and may re
69. cale Semiconductor Inc S Record Format S Record Types A 4 S Record Types Eight types of S records have been defined to accommodate the several needs of the encoding transportation and decoding functions The various Motorola upload download and other record transportation control programs as well as cross assemblers linkers and other file creating or debugging programs utilize only those S records that serve the purpose of the program For specific information on which S records are supported by a particular program the user manual for that program must be consulted NOTE D Bugl2 supports only the SO S1 and S9 records All data before the first S1 record is ignored Thereafter all records must be S1 type until the S9 record terminates data transfer An S record format may contain the record types listed in Table A 3 Table A 3 S Record Types Type Description Header record for each block of S records The code data field S0 may contain any descriptive information identifying the following block of S records The address field is normally Os S1 Record containing code data and the 2 byte address at which the code data is to reside S2 S8 Ignored by the EVB Termination record for a block of S1 records The address field may optionally contain the 2 byte address of the instruction to S9 which control is to be passed If not specified the first entry point specification encountered in the object module in
70. cintosh computer for use as the EVB terminal first refer to 3 2 Startup for the EVB startup procedure which is inter related with this example Then follow these steps 1 Select the following from the Terminal Settings menu Terminal TTY Cursor Shape Underline Line Width 80 Columns Select On Line Auto Repeat Click on OK User s Manual M68HC12B32EVB Evaluation Board Rev 1 122 Communications Program Examples MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Communications Program Examples MacTerminal Apple Macintosh 2 Select the following from the Compatibility Settings menu Baud Rate 9600 or the customized EVB setting Bits per Character 8 Bits Parity None Handshake None Connection Modem or Another Computer Connection Port Modem or Printer Click on OK 3 Reset the EVB by pressing s1 or by activating the appropriate custom reset circuitry 4 Press ENTER The D Bug12 prompt should appear on the display Continue with the startup procedure in 3 3 Startup B 6 2 S Record Transfers to EVB Memory To load an S record file from the host computer into EVB memory using MacTerminal first verify that the host is correctly configured and operating as the EVB terminal Then follow these steps 1 Atthe D Bugl2 prompt enter the LOAD or VERF command with any parameters 2 From the Macintosh File menu select Send File ASCII 3 From the dialog box se
71. d EVB setting by typing set baud 9600 ENTER Connect to the EVB by typing connect ENTER Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry The D Bug12 prompt should appear on the display Continue with the startup procedure in 3 3 Startup M68HC12B32EVB Evaluation Board Rev 1 120 Communications Program Examples MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Communications Program Examples Kermit Sun Workstation B 4 2 S Record Transfers to EVB Memory To load an S record file from the host computer into EVB memory using Kermit on an IBM compatible host computer first verify that the host is correctly configured and operating as the EVB terminal Then follow these steps 1 Atthe D Bugl2 prompt enter the LOAD or VERF command with any parameters 2 Escape from the D Bug12 prompt and start the Kermit file transfer by typing CTRL c ENTER lt filename gt gt coml ENTER Upon completion of the S record file transfer the D Bug12 prompt is displayed B 5 Kermit Sun Workstation B 5 1 Setup To set up Kermit on the Sun Workstation for use as the EVB terminal first refer to section 3 3 Startup for the EVB startup procedure which is inter related with this example Then follow these steps 1 In a shell window invoke Kermit by typing kermit ENTER 2 Setthe serial port to the one in use for the EVB ttya
72. d in the customization data area Because the SCI baud rate divider is a 13 bit counter certain baud rates may not be supported at particular E clock frequencies If the value calculated for the SCT s baud rate divider is equal to 0 or greater than 8191 command execution is terminated and the communications baud rate is not changed gt BAUD 50 Invalid BAUD Rate gt BAUD 38400 Change Terminal BR Press Return gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 51 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc BF Block Fill Syntax BF lt StartAddress gt EndAddress lt Data gt Where StartAddress isa 16 bit hexadecimal number EndAddress is a 16 bit hexadecimal number lt Data gt is an 8 bit hexadecimal number The BLOCK FILL command is used to place a single 8 bit value into a range of memory locations lt StartAddress gt is the first memory location written with data and lt EndAddress gt is the last memory location written with lt data gt Ifthe data parameter is omitted the memory range is filled with the value 00 Restrictions None Example gt BF 6400 6fff 0 gt BF 6f00 6fff 55 gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 52 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Oper
73. der E 1 Contents B TI AER ERE AE EE abo d REOR Oe bed he ed ts 136 E3 eral Record Bootloader is 136 E 3 1 SINA da A Ee ha Beds EA LK Rede 137 E32 duco Age ed EE EE ir 138 E33 LAU EE EE 138 E 4 Vector Jump Table Interrupt and Reset Addresses 139 E Reloading and Customizing DBusl Less 141 EI Obtaining D Bug12 Upgrades 2222252 AE heu RAS 141 E52 Reloading Lake dch ser usse RC C e ERE Pin dE 141 E33 Customizing D B llZiiseosscesuta AAA PAS 142 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA EEPROM Bootloader 135 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader E 2 Introduction NOTE The EEPROM bootloader occupies 1 Kbyte of erase protected FLASH EEPROM starting at address FCOO It is invoked when the EVB is started in bootload mode W3 1 and W4 1 The bootloader may be used to program user code into byte erasable EEPROM starting at address 0D00 and or FLASH EEPROM starting at address 8000 The user program in FLASH EEPROM may then serve as the boot startup code when the board is placed in EVB mode W3 0 and W4 0 or POD mode W3 0 and W4 1 and reset D Bug12 is overwritten when using FLASH EEPROM for user code But since the bootloader itself cannot be overwritten it is always available for loading new user code or reloading D Bug12 An additional 1 Kbyte of FLASH EEPROM starting at address F800 is reser
74. e Information On This Product Go to www freescale com 87 Freescale Semiconductor Inc UPLOAD Display Memory in S Record Format Syntax UPLOAD lt StartAddress gt lt EndAddress gt Where StartAddress isa 16 bit hexadecimal number lt EndAddress gt is a 16 bit hexadecimal number The UPLOAD command is used to display the contents of memory in Motorola S record format In addition to displaying the specified range of memory the UPLOAD command also outputs an S9 end of file record The output of this command may be captured by the user s terminal program and saved to a disk file Restrictions None Example gt upload 400 5ff 123040000F0000843FC0000F50F379F37BF43FCF50F27FA757F177AFA047504177AFA21C5 123042037B500FF37FAFB0437B5400037FAFB061735FB0037B500C137FAFA003715379C01 1230440F50F379D37BC012C37BD400085009A003C023D02377C0140B6EE7A0F400037B583 123046000033 7FAFA4C37FAFA5037FAFA5437B5502037FAFA4E37B5302037FAFA5237B58A 1230480682037FAFA5637BD014037BC000095008A003C023D02377D0172B6EE37BD017259 12304A037BC020095008A003C023D02377D018EB6EE27F937B0F50F379C37BC00CE27F901 12304C000FC27F9104C27F90E68378000BE0A0D442D42756731362056312E3033202D20E3 12304E04465627567204D6F6E69746F7220466F7220546865204D363848433136204661ED 12305006D696C790A0D2 8432 92031393932204D6F746F 72 6F 6C612053656D69636F 6E64BD 12305207563746F7220496E632E000037B5FF0237FAFA4837B578B037FAFA4A7AO0F005E52 12305400000000000000000020002040208020C02100000000000
75. e name configures D Bugl2 for operation with the selected target device The default device list contains entries for the MC68HC912B32 and the MC68HC812A4 Table 3 3 shows the command line name to use for the two default MCU devices Table 3 3 Command Line Names Device Name Target MCU 912B32 MC68HC912B32 812A4 MC68HC812A4 Entering the DEVICE command followed by a device name and seven hexadecimal parameters allows new devices to be added to the target device table or existing device table entries to be modified When a new device is added or when an existing device entry is modified it becomes the currently selected device If a new device does not contain a particular on chip resource such as FLASH EEPROM a value of 0 should be entered for the starting and ending addresses M68HC12B32EVB Evaluation Board Rev 1 58 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Specify Target MCU Device Continued DEVICE NOTE Restrictions Because the target device data and the current device selection are stored in the probe MCU s on chip EEPROM new device information and the device selection are retained when power is removed from the pod If the M68HC12B32EVB is operated in EVB mode and the contents of any locations of the on chip EEPROM are altered it is strongly recommended that the on chip EEPROM be complete
76. e on chip I O registers a 16 bit hexadecimal number Selecting the proper target MCU with the DEVICE command provides D Bug12 the information necessary to allow transparent alteration of the target MCU s on chip EEPROM using any D Bug12 commands that modify memory It also provides the necessary information to allow the programming and erasure of on chip FLASH EEPROM In addition it allows D Bugl2 to initialize the stack pointer to the top of on chip RAM when the target MCU is reset by use of the RESET command The DEVICE command has three separate command line formats that allow for the display selection and or definition of target device parameters M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 57 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc DEVICE User s Manual Specify Target MCU Device Continued Entering DEVICE on the command line followed by a carriage return displays the name of the currently selected device the on chip EEPROM s starting and ending address the on chip FLASH EEPROM s starting and ending address the on chip RAM s starting and ending address and the I O base address This form of the command may be used when D Bug12 is operating in either EVB or pod mode When D Bugl12 is operated in pod mode the DEVICE command also may be used to select or define a new target device Entering the DEVICE command followed only by a devic
77. e terminal See 2 5 EVB to Terminal Connection Configure the terminal communications interface See 2 6 Terminal Communications Setup Apply power to the EVB and to the terminal If the terminal is a host computer a Verify that it has booted correctly b Start the communications program for terminal emulation See 2 6 3 Host Computer Setup and Appendix B Communications Program Examples Reset the EVB by pressing and releasing the on board reset switch S1 M68HC12B32EVB Evaluation Board Rev 1 38 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation Startup 3 3 2 Operating Procedures 3 3 2 1 EVB Mode After starting the EVB in accordance with 3 3 1 Startup Procedure follow the operating procedure for the EVB mode that was selected EVB jump EEPROM pod or bootload mode These procedures are described in the following subsections In EVB mode the MC68HC912B32 begins executing code at the address contained in the alternate reset vector at F7FE for information on the alternate reset and interrupt vector table see E 4 Vector Jump Table Interrupt and Reset Addresses The code pointed to by the alternate reset vector may either be D Bug12 factory default or a user s program that has replaced D Bug12 in FLASH EEPROM D Bug12 Upon reset the D Bug12 sign on banner and prompt should appear on the terminal s display like this
78. eared Refer to MC68HC912B32 Technical Summary Motorola document order number MC68HC912BC32TS D for locations and operation of the block protect controls gt BULK F EEPROM Failed To Erase gt BULK gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 55 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc CALL Syntax NOTE Restrictions Example User s Manual Call Subroutine CALL lt Address gt Where lt Address gt is an optional 16 bit hexadecimal number The CALL command is used to execute a subroutine and return to the D Bug12 monitor program when the final RTS of the subroutine is executed When control is returned to D Bug12 the CPU register contents are displayed All CPU registers contain the values at the time the final RTS instruction was executed with the exception of the program counter PC The PC contains the starting address of the subroutine If a subroutine address is not supplied on the command line the current value of the PC is used as the starting address No user breakpoints are placed in memory before execution is transferred to user code If the called subroutine modifies the value of the stack pointer during its execution it must restore the stack pointer s original value before executing the final RTS of the called subroutine This restriction is required because a return address is placed
79. ed into EEPROM are unaffected by the missing S9 record reprogramming is not necessary In case of errors during the L oadEE procedure repeat the process several times If the errors persist it is possible that the MCU may be damaged EA Vector Jump Table Interrupt and Reset Addresses The CPU s interrupt and reset vectors are located in the erase protected area of FLASH EEPROM and thus cannot be reprogrammed with the S record bootloader To allow the user code to specify interrupt and reset addresses each member of the erase protected vector table starting at address FFCO contains a pointer to a vector jump table which is located in user programmable FLASH EEPROM starting at address F7CO Each entry in the vector jump table occupies two bytes of memory which is adequate for the addresses of user reset and interrupt service routines The interrupt vector mapping is shown in Table E 1 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA EEPROM Bootloader 139 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader Table E 1 Vector Jump Table Vector Address CPU Interrupt Jump Table Address FFCO FFCF Reserved F7CO F7CF FFDO BDLC J1850 F7D0 FFD2 ATD F7D2 FFD4 Reserved F7D4 FFD6 SCIO F7D6 FFD8 SPI F7D8 FFDA Pulse Acc Input Edge F7DA FFDC Pulse Acc Overflow F7DC FFDE Timer Overflo
80. emonics into opcodes that can then be loaded into the memory of a microcontroller assembly language Instruction mnemonics and assembler directives that are meaningful to programmers and can be translated into an object code program that a microcontroller understands The CPU uses opcodes and binary numbers to specify the operations that make up a computer program Humans use assembly language mnemonics to represent instructions Assembler directives provide additional information such as the starting memory location for a program Labels are used to indicate an address or binary value ASCII American Standard Code for Information Interchange A widely accepted correlation between alphabetic and numeric characters and specific 7 bit binary numbers breakpoint During debugging of a program it is useful to run instructions until the CPU gets to a specific place in the program and then enter a debugger program A breakpoint is established at the desired address by temporarily substituting a software interrupt SWI instruction for the instruction at that address In response to the SWI control is passed to a debugging program byte A set of exactly eight binary bits clock A square wave signal that is used to sequence events in a computer command set The command set of a CPU is the set of all operations that the CPU knows how to perform One way to represent an instruction set is with a set of shorthand mnemonics such
81. emory map To use the FLASH EEPROM area for custom programs refer to Appendix E EEPROM Bootloader When operating in EVB mode D Bugl2 requires 512 bytes of on chip RAM from 0A00 to SOBFF for stack and variable storage The remaining 512 bytes of on chip RAM from 0800 to 0900 are available for variable storage and stack space by user programs D Bug12 sets the default value of the user s stack pointer to 0A00 This is not a mistake The M68HC12 Family s stack pointer points to the last byte that was pushed onto the stack rather than to the next available byte on the stack as the M 68HC11 Family does The M68HC12 Family first decrements its stack pointer then stores data on the stack The M68HC11 Family stores data on the stack and then decrements its stack pointer The information in Table 3 6 describes address ranges and locations Address Range Table 3 6 Factory Configuration Memory Map Usage Description 0000 01FF CPU registers On chip registers 0800 09FF 0A00 0BFF 0D00 0FFF User code data Reserved for D Bug12 User code data 1 Kbyte on chip RAM 768 bytes on chip EEPROM 8000 F67F F680 F6BF F6CO F6FF F700 F77F F780 F7FF F800 FBFF FCOO FFBF FFCO FFFF D Bug12 code User accessible functions D Bug12 customization data D Bug12 startup code Interrupt vector jump table Reserved for bootloader expansion EEPROM
82. eration To serve as the EVB s terminal the host computer must have an RS 232C serial port and an installed communications program capable of operating with the parameters listed in Table 2 3 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Configuration and Setup 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Configuration and Setup Setting up the parameters is normally done within the communications program after it has been started on the host Usually the setup can be saved in a configuration file so that 1t does not have to be repeated Because procedures vary between programs consult the user s guide for the specific program Appendix B Communications Program Examples provides examples of using some of the commonly available communications programs 2 6 4 Changing the Baud Rate The EVB s default baud rate for the RS 232C port is 9600 This can be changed in two ways e For temporary changes use the D Bug12 BAUD command This change remains in effect only until the next reset or power up when the baud rate returns to 9600 e For permanent changes the D Bug12 baud rate initialization value stored in FLASH EEPROM must be modified For instructions refer to Appendix D D Bug12 Customization Data and Appendix E EEPROM Bootloader User s Manual M68HC12B32EVB Evaluation Board Rev 1 32 Configuration and Setup MOTOROLA For More Inform
83. erification of memory contents These subcommands have this format lt Data gt CR Optionally update current location and display the next location lt Data gt lt gt or lt gt Optionally update current location and redisplay the current location lt Data gt lt gt or lt gt Optionally update current location and display the previous location lt Data gt lt gt Optionally update current location and exit MEMORY MODIFY With the exception of the carriage return the subcommand must be separated from any entered data with at least one space character If an invalid subcommand character is entered an appropriate error message is issued and the contents of the current memory location are redisplayed While there are no restrictions on the use of the MM command be careful when modifying target memory while user code is running Accidentally modifying target memory containing program code could lead to program runaway M68HC12B32EVB Evaluation Board Rev 1 74 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Memory Modify Continued MM Example MM 800 0800 00 lt CR gt 0801 FO FE 0802 00 0801 FF CR 0802 00 CR 0803 08 55 09803 55 gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 75 For More Information On T
84. error message is issued and the contents of the current memory location are redisplayed While there are no restrictions on the use of the MMW command caution should be used when modifying target memory while user code is running Accidentally modifying target memory containing program code could lead to program runaway M68HC12B32EVB Evaluation Board Rev 1 76 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Modify 16 Bit Memory Word Continued MMW Example gt MMW_ 800 0800 00F0 lt CR gt 0802 0008 AAS55 0804 843F 0802 AA55 lt CR gt 0804 843F lt CR gt 0806 c000 gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 77 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc MOVE Syntax Restrictions Example User s Manual Move Memory Block MOVE lt StartAddress gt lt EndAddress gt lt DestAddress gt Where StartAddress isa 16 bit hexadecimal number lt EndAddress gt is a 16 bit hexadecimal number lt DestAddress gt is a 16 bit hexadecimal number The MOVE command is used to move a block of memory from one location to another one byte at a time The number of bytes moved is one more than the lt EndAddress gt lt StartAddress gt The block of memory beginning at the destination add
85. f 0800 AA04 376A 0006 27F9 35AE 780D B756 7820 eius Eo WX 0810 B636 27F9 35AE 27F9 359E 27F9 35BE B528 SON e b A E 0820 27F9 35D6 37B8 000F 3782 010A 3736 FFFO Vae A as P Ote le 0830 7C10 37B3 0000 37B6 000F AA04 A502 37B6 usd A Ta 0840 000F 2778 376A 0006 27F9 3578 27F9 3556 tet V Ett ob qe 0850 780D B710 783B 3786 00DC 27F9 3548 7857 x x 7 5HxW 0860 3786 OODE F501 EA09 37B5 ODOA 27F9 362A 7 dovuto 0870 A500 3765 0002 27F9 35E8 379C 374C F502 ee Tena se Sethe Tiss gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 73 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Syntax Restrictions User s Manual Memory Modify MM Address lt Data gt Where lt Address gt is al6 bit hexadecimal number lt Data gt is an optional 8 bit hexadecimal number The MEMORY MODIFY command allows the contents of memory to be examined and or modified as 8 bit hexadecimal data If the 8 bit data parameter is present on the command line the byte at memory location lt Address gt is replaced with lt Dat a gt and the command is terminated If not D Bug12 enters the interactive memory modify mode In the interactive mode each byte is displayed on a separate line following the data s address Once the MEMORY MODIFY command has been entered single character subcommands are used for the modification and v
86. gins Program execution begins at the address defined by the current value of the program counter When user code reaches the temporary breakpoint and control is returned to D Bug12 a message is displayed explaining the reason for user program termination In addition D Bug12 disassembles the instruction at the current PC address prints the CPU12 s register contents and waits for a command to be entered by the user The GT command cannot be issued when the R gt prompt is displayed indicating that the target system is already running a user program S GT 820 R gt Temporary Breakpoint Encountered PC SP X Y D A B CCR SXHI NZVC 0820 O9FE 057C 0000 00 00 1001 0100 0820 08 INX S M68HC12B32EVB Evaluation Board Rev 1 68 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Onscreen Help Summary HELP Syntax HELP The HELP command is used to display a summary of the D Bug12 command set Each command is shown along with its command line format and a brief description of its function Restrictions None M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 69 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc HELP Example User s Manual Onscreen Help Summary Continued gt HELP ASM lt Address gt S
87. he assembly disassembly process may be terminated by entering a period as the first non space character following the assembler prompt Table 3 2 M68HC11 to CPU12 Instruction Translation M68HC11 CPU12 M68HC11 CPU12 Mnemonic Instruction Mnemonic Instruction CLC ANCC FE INS LEAS 1 S CLI ANCC EF TAP TFR A CC CLV ANCC FD TPA TFR CC A SEC ORCC 01 TSX TFR S X SEI ORCC 10 TSY TFR S Y SEV ORCC 02 XGDX EXG D X ABX LEAX B X XGDY EXG D Y ABY LEAY B Y SEX Rg Rig TFR Rg Rig DES LEAS 1 S Restrictions None User s Manual M68HC12B32EVB Evaluation Board Rev 1 48 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Assemble Instructions Continued ASM Example gt ASM 800 0800 CC1000 LDD 51000 Assembly Operand Format Disassembly Operand Format 0803 1803123401FE MOVW 51234 S01FE 0809 OEF9800001F1 BRSET 32768 PC 01 0700 080F 18FF TRAP SFF 0811 183FE3 ETBL Illegal Addr Mode Se gt This section describes the operand format used by the assembler when assembling CPU12 instructions The operand format accepted by the assembler is described separately in the CPU 2 Reference Manual Rather than describe the numeric format accepted for each instruction some general rules are used Exceptions and complicated operand formats are described separatel
88. he solder side as shown in Figure 1 2 EVB Solder Side View 2 pin header with no jumper installed or 2 pin cut trace header with trace cut 2 pin header with jumper installed 2 pin cut trace header with default trace intact 3 pin header with no jumper installed is Ha wa co 3 pin header with jumper installed on left 2 pins A N bold pin numbers indicate factory default settings 1 2 cut italics indicate alternate settings Table 4 1 Jumper Selectable Functions Sheet 1 of 3 Diagram Setting Description W1 RS 232C TXD Connection to SCI PS1 1 1 2 TXD enabled 2 cut TXD disconnected from SCI port W2 RS 232C RXD Connection to SCI PSO 1 1 2 RXD enabled 2 cut RXD disconnected from SCI port M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Hardware Reference 99 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference Table 4 1 Jumper Selectable Functions Sheet 2 of 3 Diagram Setting Description W3 W4 EVB Mode Selection W3 0 W4 0 W3 1 1 0 W4 0 Jump to EEPROM mode l We Pod mode Remote BDM W3 1 W4 1 EVB mode Execution from FLASH EEPROM D Bug12 default Bootload mode W5 W6 MCU Mode Selection MODB W5 MODA W6 MODB MODA 2 2 W5 in 0 0 Single chip mode 1 1 W6 in Note If cut these headers must be wired to external circuitry that provides the desired levels for MODA
89. his Product Go to www freescale com Freescale Semiconductor Inc MMW Syntax Restrictions User s Manual Modify 16 Bit Memory Word MMW Address lt Data gt Where lt Address gt is a 16 bit hexadecimal number lt Data gt is an optional 16 bit hexadecimal number The MMW command allows the contents of memory to be examined and or modified as 16 bit hexadecimal data If the 16 bit data parameter is present on the command line the word at memory location Address is replaced with Data and the command is terminated If not D Bug12 enters the interactive memory modify mode In the interactive mode each word is displayed on a separate line following the data s address Once the MMW command has been entered single character subcommands are used for the modification and verification of memory contents These subcommands have this format lt Data gt CR Optionally update current location and display the next location lt Data gt lt gt or lt gt Optionally update current location and redisplay the current location lt Data gt or lt gt Optionally update current location and display the previous location lt Data gt lt gt Optionally update current location and exit MMW With the exception of the carriage return the subcommand must be separated from any entered data with at least one space character If an invalid subcommand character is entered an appropriate
90. hor 0870 A5 00 37 65 00 02 27 F9 35 E8 37 9C 37 4C F5 02 7e 5 7 7L gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 72 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Display Memory as 16 Bit Word MDW Syntax MDW StartAddress lt EndAddress gt Where lt StartAddress gt isa 16 bit hexadecimal number lt EndAddress gt is an optional 16 bit hexadecimal number The MDW command displays the contents of memory as hexadecimal words and ASCII characters 16 bytes on each line The lt StartAddress gt parameter must be supplied the lt EndAddress gt parameter is optional When the lt EndAddress gt parameter is not supplied a single line is displayed The number supplied as the lt StartAddress gt parameter is rounded down to the next lower multiple of 16 while the number supplied as the lt EndAddress gt parameter is rounded up to the next higher multiple of 16 minus 1 This causes each line to display memory in the range of xxx0 through xxxF For example if 205 is entered as the start address and 217 as the ending address the actual memory range displayed would be 200 through 21F Restrictions None Example gt MDW_800 0800 AA04 376A 0006 27F9 35AE 780D B756 7820 sed jew um Vx VX gt MDW 800 87
91. iconductor Inc EEBASE Specify Target EEPROM Base Address Continued Example S DEVICE Device 912B32 EEPROM 0D0O SOFFF Flash 8000 SFFFF RAM 0800 SOBFF I O Regs 0000 S gt EEBASE 1d00 Device 912B32 EEPROM 1D00 S IFFF Flash 8000 SFFFF RAM 0800 SOBFF I O Regs 0000 S MM 12 0012 01 11 0013 OF e S MD 1d00 IDOO BE EE FE Kb e BE RER REY ER Ek URE SER a KR ER KR ERT sc ete le ee AN S User s Manual M68HC12B32EVB Evaluation Board Rev 1 62 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Erase Target FLASH EEPROM FBULK Syntax Restrictions FBULK The FBULK command is used to erase the entire contents of the target MCU s on chip FLASH EEPROM in a single operation After the bulk erase operation has been performed each on chip FLASH location is verified If the contents are not FF an error message is displayed The target processor s FLASH EEPROM is erased by resetting the target processor and then loading a small driver program into the target processor s on chip RAM For this reason the previous contents of the target processor s on chip RAM are lost When operating in EVB mode the FBULK command cannot be used If the FBULK command is entered while in EV B mode an error message
92. ing software must be custom configured or special precautions must be taken in the application code to avoid conflicts with the D Bug12 usage PADO EVB mode select pin W3 PAD1 EVB mode select pin W4 PES MODA and PE6 MODB Sets MCU chip mode normally single chip M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 95 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 10 5 Terminal Communications High baud rates occasionally result in dropped characters on the terminal display This is not the result of a baud rate mismatch but is due to the host processor being too busy or too slow to process incoming data at the selected baud rate The D Bug12 MD MDW T and HELP commands may be affected by this problem Sometimes the problem can be ignored without harm If it requires correcting try e Using a slower baud rate e A different communications program Closing unnecessary applications or exiting Windows In multitasking environments such as Windows and the Macintosh System 79 the problem can occur when several applications are running at once Displaying fewer address locations or tracing fewer instructions at a time when using the MD MDW or T commands User s Manual M68HC12B32EVB Evaluation Board Rev 1 96 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User
93. ingle line assembler disassembler lt CR gt Disassemble next instruction lt gt Exit assembly disassembly BAUD lt baudrate gt Set communications rate for the terminal BF lt StartAddress gt lt EndAddress gt data Fill memory with data R lt Address gt Set Display user breakpoints ULK Eras ntire on chip EEPROM contents LL lt Address gt Call user subroutine at lt Address gt EVICE lt DevName gt lt Address gt lt Address gt isplay select add target device EBASE Address Set base address of on chip EEPROM FBULK Erase entire target Flash contents FLOAD lt AddressOffset gt Load S Records into target Flash G lt Address gt Begin continue execution of user code GT lt Address gt Set temporary breakpoint at lt Address gt amp xecute user cod HELP Display this D Bugl2 command summary LOAD lt AddressOffset gt Load S Records into memory MD lt StartAddress gt lt EndAddress gt Memory Display Bytes MDW lt StartAddress gt lt EndAddress gt Memory Display Words MM lt StartAddress gt Modify Memory Bytes lt CR gt Examine Modify next location lt gt or lt gt Examine Modify same location or lt gt Examine Modify previous location lt gt Exit Modify Memory command MMW StartAddress Modify Memory Words same subcommands as MM MOV
94. ional fields Fields are separated by any number of space characters All numeric fields unless noted otherwise are interpreted as hexadecimal Command line entries are case insensitive and may be typed using any combination of upper and lower case letters A maximum of 80 characters including the terminating carriage return may be entered on the command line After the 80th character D Bug12 automatically terminates the command line entry and processes the characters entered to that point Before the ENTER key is pressed the command line may be edited using the BACKSPACE key Receiving the backspace character causes D Bug12 to delete the previously received character from its input buffer and erase the character from the display M68HC12B32EVB Evaluation Board Rev 1 44 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 6 3 Command Set Summary Operation Using D Bug12 Commands Table 3 1 summarizes the D Bug12 commands For detailed descriptions of each command refer to 3 7 D Bug12 Command Set Table 3 1 D Bug12 Command Set Summary BF lt StartAddress gt lt EndAddress gt lt Data gt Command Description ASM lt address gt Single line assembler disassembler BAUD lt BAUDRate gt Set the SCI communications baud rate Block fill user memory with data BR lt Address gt lt Address gt Set display user breakpoints
95. ipes the slate clean and control is returned to D Bug12 a message is displayed explaining the reason for user program termination In addition D Bug12 disassembles the instruction at the current program counter PC address prints the CPU12 s register contents and waits for the next D Bug12 command to be entered by the user If a starting address is not supplied in the command line parameter program execution will begin at the address defined by the current value of the PC Restrictions The G command cannot be issued when the R gt prompt is displayed indicating that the target system is already running a user program Example GG 800 R MD 1000 1000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF R gt User Breakpoint Encountered PC SP X Y D A B CCR SXHI NZVC 0820 O9FE 057C 0000 00 00 1001 0100 0820 08 INX S M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 67 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc GT Syntax Restrictions Example User s Manual Go Till GT Address Where Address is a 16 bit hexadecimal number The GT command is similar to the G command except that a temporary breakpoint is placed at the address supplied on the command line Any breakpoints that were set by the use of the BR command are not placed in the user code before program execution be
96. is Product Go to www freescale com Freescale Semiconductor Inc D Bug12 Customization Data D 2 6 SCIBaudRegVal Field User s Manual NOTE The SCIBaudRegVal field is used to set the initial baud rate of the SCI used for console I O by D Bug12 Note that the value in SCIBaudRegVal is written directly to the baud register of the EVB being used for the SCI terminal interface Note that the value in SCIBaudRegVal is not the desired baud rate The calculation of the actual baud rate is not made by D Bug12 because of the possibility of an invalid baud register value Without a valid baud register value during SCI initialization D Bug12 would have no way to inform the user that a problem exists Not all combinations of baud rates and system clock frequencies produce a valid baud register value The formula used to calculate the baud register value is SCIBaudRegVal MCLK 16 SCIBaudRate The initial baud register value for this version of D Bug12 is 52 0x0034 At a system clock frequency of 8 0 MHZ this sets the EVB to terminal baud rate at 9600 baud D Bugl2 takes care of initializing the SCI registers The startup code should not initialize the SCI The SCI data format is set to 8 data bits 1 start bit 1 stop bit and no parity M68HC12B32EVB Evaluation Board Rev 1 132 D Bug12 Customization Data MOTOROLA For More Information On This Product Go to www freescale com Free
97. l interface 6 Reset the EVB by pressing s1 or by activating the appropriate custom reset circuitry 7 Press ENTER The D Bugl2 prompt should appear on the display Continue with the startup procedure in 3 3 Startup M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Communications Program Examples 119 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Communications Program Examples B 3 2 S Record Transfers to EVB Memory To load an S record file from the host computer into EVB memory using Procomm on an IBM compatible host computer first verify that the host is correctly configured and operating as the EVB terminal Then follow these steps 1 At the D Bug12 prompt enter the LOAD or VERF command with any parameters Instruct Procomm to send the S record file by pressing the PAGE UP key Follow the onscreen instructions to select the S record file for transfer using ASCII transfer protocol Upon completion of the S record file transfer the D Bug12 prompt is displayed B 4 Kermit for DOS B 4 1 Setup IBM PC To set up Kermit using DOS on an IBM compatible PC for use as the EVB terminal first refer to section 3 3 Startup for the EVB startup procedure which is inter related with this example Then follow these steps 1 User s Manual At the DOS prompt invoke Kermit by typing kermit ENTER Set the baud rate to 9600 or the customize
98. lect the S record file to be transferred 4 Click on Send NOTE S records are not displayed during the file transfer NOTE Following the file transfer MacTerminal sends a carriage return line feed pair which D Bug 12 interprets as an erroneous command To return to the D Bug12 prompt reset the EVB M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Communications Program Examples 123 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Communications Program Examples B 7 Red Ryder Apple Macintosh B 7 1 Setup To set up Red Ryder on an Apple Macintosh computer for use as the EVB terminal first refer to 3 3 Startup for the EVB startup procedure which is inter related with this example Then follow these steps 1 Launch the Red Ryder program 2 Setup the Red Ryder parameters 9600 baud or the customized EVB setting 8 data bits 1 stop bit no parity full duplex 3 Reset the EVB by pressing s1 or by activating the appropriate custom reset circuitry 4 Press ENTER The D Bugl2 prompt should appear on the display Continue with the startup procedure in 3 3 Startup B 7 2 S Record Transfers to EVB Memory To load an S record file from the host computer into EVB memory using Red Ryder first verify that the host is correctly configured and operating as the EVB terminal Then follow these steps 1 Atthe D Bugl2 prompt enter the LOAD or VERF command
99. ller for the target system via the BDM interface The host EVB begins executing code at the address contained in the alternate reset vector at F7FE For information on the alternate reset and interrupt vector table see E 4 Vector Jump Table Interrupt and Reset Addresses The code pointed to by the alternate reset vector may either be D Bug12 factory default or a user s program that has replaced D Bug12 in FLASH EEPROM D Bugl2 Upon power up or reset D Bug12 attempts to establish communications with a target system connected to BDM out W11 Communications are first attempted without resetting the target system If communications cannot be established this message is displayed Can t Communicate With The Target Processor To reset target hit any key Pressing any key on the terminal s keyboard causes D Bug12 to assert the target s reset pin for approximately 2 ms and to try again to establish communications If communications fail the error message is redisplayed Once communications have been established with the target system the D Bug12 sign on banner and prompt should appear on the terminal s display like this D Bug12 v 2 0 0 Copyright 1996 1997 Motorola Semiconductor For Commands type Help S M68HC12B32EVB Evaluation Board Rev 1 40 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation Startup If communications c
100. ly erased by using the BULK command before using the EVB in pod mode again Erasing the on chip EEPROM causes D Bug12 to reinitialize the device table with the two default MCU devices The information for any new devices that were added to the table will be lost When operating the M68HC12B32EVB in EVB mode the DEVICE command may be used only to display the current device information The DEVICE command maintains a 16 bit checksum on the contents of the entire on chip EEPROM to maintain the integrity of the device table If any of the on chip EEPROM locations are altered while operating the M68HC12B32EVB in EVB mode D Bug12 will reinitialize the device table with the default device information contained in the on chip FLASH EEPROM However it is possible for the checksum verification to fail for instance if the entire contents of the on chip EEPROM is programmed with Os Therefore it is strongly recommended that the on chip EEPROM be completely erased by using the BULK command before using the EVB in pod mode again Using the EVB in probe mode with a corrupt device data table may cause D Bug12 to operate in an unpredictable manner The 768 bytes of on chip EEPROM allow a total of 34 entries in the device table Do not exceed this number When adding a new device to the device table the addresses provided for the on chip FLASH EEPROM on chip RAM and I O registers should reflect the locations of these resources when the part is reset This
101. may be a second M68HC12B32EVB board or any other M68HC12 system D Bug12 commands are entered as usual on the user terminal which is served by the pod EVB 3 2 8 1 Target Types Supported All members of the M68HC12 Family may be used in the target system User s Manual M68HC12B32EVB Evaluation Board Rev 1 36 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation Operating Modes 3 2 8 2 Target MCU Characteristics These D Bug12 commands must be used to inform D Bug12 of the target MCU s essential operating characteristics to allow transparent modification of the target s EEPROM For details refer to the command descriptions in 3 7 D Bug12 Command Set DEVICE Specifies the target s microprocessor type EEBASE Specifies the base address of the target s FLASH EEPROM REGBASE Specifies the base address of the target MCU s input output I O registers 3 2 8 3 Programming the Target s EEPROM The target MCU s on chip byte erasable or FLASH EEPROM may be programmed from user assembled S records on the host terminal computer by using the D Bug12 commands BULK LOAD FBULK and FLOAD For details refer to 3 7 D Bug12 Command Set 3 2 8 4 Controlling Target Execution 3 2 4 Bootload Mode All D Bug12 commands that control the execution of user code may also be used in both EVB mode and pod mode Two additional commands are available in pod
102. mmand eee Crcomimand caian ORG Sad ww OEA PTS ERG GT command eee headers GOITIBEDOE ate EX E E Ea EE CUA COs cus nos dera REOS AS DEE eS description RP JUMPE 234254 odora RER ex Need gs HELP command e wd ELE ere Ex a dex IASM12 assembler o oo jump EEPROM mode E NEEN NEE nn Jamper EE limitations operational ess gU ere EE E ew SER LOAD Commis 6 22 2 ee err eu ERE EE Ya low voltage inhibit NI M68HC12B32EVB Evaluation Board Rev 1 Index et da cds 35 40 TNNT 16 20 98 99 User s Manual MOTOROLA Index For More Information On This Product Go to www freescale com 151 Freescale Semiconductor Inc M M68HC12B32EVB evaluation board cc cece ee 15 MC68HC912B32 microcontroller un 15 MCU access interface ec ee ce eens 21 105 106 GESCUPUON EE 102 locations ex odie GS we Oe Ee RR hee la 18 dee 102 103 restrictions On USE uni tr hh ee Pug dier Puedo 22 D EE dS Sx Xe eerie 23 102 MCUez assembler n RR bod nena denn ex en bei ed 21 31 MD coinmand 42er e RR PIE E AM XOU RENE E dances KE MDW command st esri peinar d aa aa E a E a 73 memory address soc 5 be peru Sp dd EE EE 111 EEPROM on chip ee CERN EE EE SE 21 22 28 55 104 EPROM eg ee qe a ed esu e D E 19 limitations 0 RR RRIRRRRRR RR RR res 95 locations o epus herr Rh VR ia 18 map factory default i25 cdas sierras is 94 On
103. mode RESET Resets the target MCU and places it in active background mode STOP Halts program execution on the target For details refer to the command descriptions in 3 7 D Bug12 Command Set In this mode W3 1 and W4 1 a user program may be loaded into the host EVB s byte erasable or FLASH EEPROM D Bug12 may be replaced as the startup boot program This mode also may be used to reload or customize D Bug12 The procedures are described in Appendix E EEPROM Bootloader M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 3 Startup To operate the M68HC12B32EVB follow the startup procedure described here 3 3 1 Startup Procedure This startup procedure includes a checklist of configuration and setup items from Section 2 Configuration and Setup To begin operating the M68HC12B32EVB follow these steps 1 2 User s Manual Configure the EVB if required See 2 3 EVB Configuration Determine whether execution should begin in EVB mode 3 2 1 EVB Mode jump EEPROM mode 3 2 2 Jump EEPROM Mode pod mode 3 2 3 Pod Probe Mode or bootload mode 3 2 4 Bootload Mode Set the jumpers on headers W3 and W4 accordingly See 2 3 EVB Configuration and 3 2 Operating Modes Connect the EVB to the external power supply See 2 4 EVB to Power Supply Connection Connect the EVB to th
104. nd Customizing D Bugl2 Obtaining D Bugl2 Upgrades Relgading D B gl2 A dek EEN telson Customizing TA EE Glossary Index M68HC12B32EVB Evaluation Board Rev 1 10 Table of Contents For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc User s Manual M68HC12B32VB Evaluation Board Figure Title 1 1 EVB Layout and Component Placement 1 2 EVB Solder Side VIEW sa Rs 4 1 MCU I O Headers P2 and P3 4 2 MCU I O Headers P4 and P6 M68HC12B32EVB Evaluation Board Rev 1 List of Figures User s Manual MOTOROLA List of Figures For More Information On This Product Go to www freescale com 11 Freescale Semiconductor Inc List of Figures User s Manual M68HC12B32EVB Evaluation Board Rev 1 12 List of Figures MOTOROLA For More Information On This Product Go to www freescale com User s Manual M68HC12B32EVB Evaluation Board Freescale Semiconductor Inc M68HC12B32EVB Evaluation Board Rev 1 Table 1 1 2 1 2 2 2 3 3 1 3 2 3 3 3 4 3 5 3 6 4 1 4 2 4 3 A 1 A 2 A 3 A 4 A 5 A 6 E 1 EVB Specifications S Record Fields S Record Field Contents S Record Types SO Header Record S1 Header Record S9 Header Record Vector Jump Table EVB Startup Mode Jumpers RS 232C Interface Cabling Communication Parameters D Bug12 Command
105. ne processor which allows a maximum of 10 command line arguments including the command string When operating in pod mode new breakpoints may not be set with the BR command when the R prompt is displayed However the BR command may be used to display breakpoints that currently are set in the user s running program M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 53 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc BR Example User s Manual Breakpoint Set Continued D Bug12 version 2 0 0 does not support the MC68HC912B32 s hardware breakpoint H W function Later versions of D Bug 12 which may support this function can be obtained from the sources listed in E 5 1 Obtaining D Bug12 Upgrades gt BR 35ec 2f80 c592 Breakpoints 35EC 2F80 C592 gt BR Breakpoints 35EC 2F80 C592 gt M68HC12B32EVB Evaluation Board Rev 1 54 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Bulk Erase On Chip EEPROM BULK Syntax Restrictions Example BULK The BULK command is used to erase the entire contents of byte erasable EEPROM in a single operation After the bulk erase operation has been performed each on chip EEPROM location is checked for an erased condition To erase EEPROM the EEPROM block protect control bits must be cl
106. ng an address offset other than 0 allows object code or data to be loaded into memory at a location other than that for which it was assembled During the loading process the S record data 1s not echoed to the control console However for each 10 S records that are successfully loaded an ASCII asterisk character is sent to the control console When an S record file has been loaded successfully control returns to the D Bug12 prompt The LOAD command is terminated when D Bug12 receives an S9 end of file record If the object file being loaded does not contain an S9 record D Bug12 does not return its prompt and continues to wait for the end of file record Pressing the reset switch returns D Bugl2 to its command line prompt Restrictions When operating in pod mode the LOAD command does not support standard baud rates above 38 400 This is due to the overhead involved in the implementation of the custom serial protocol required by the single wire background debug mode interface Example gt LOAD 1000 KKEKKKKKKKKKKKKKKKKKK gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 71 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc MD Memory Display Syntax MD lt StartAddress gt lt EndAddress gt Where StartAddress isa 16 bit hexadecimal number lt EndAddress gt is an optional 16 bit hexadecimal number The MEMORY DISPLAY command display
107. ng that the target is running a user program Because the M68HC12 background debug mode interface allows the reading and writing of target system memory even when the target is running a user s program the probe microcontroller is always available for the entry of commands D Bug12 commands that examine or modify target system memory may be issued when either the S or R prompt is displayed 3 6 2 Entering Commands Commands are typed on the terminal s D Bug12 prompt line and executed when the carriage return ENTER key is pressed D Bug12 then displays either the appropriate response to the command or an error indication M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Command Line User s Manual The D Bug12 command line prompt is the greater than sign gt Type the command and any other required or optional fields immediately after the prompt like this lt command gt lt parameter gt lt parameter gt ENTER Where command is the command mnemonic lt parameter gt is an expression or address ENTER is the terminal keyboard s carriage return or ENTER key The command line syntax is illustrated using the following special characters for clarification Do not type these characters on the command line lt gt required syntactical element optional field ge repeated opt
108. nterface may serve in two ways e As the probe interface through which a host EVB in pod mode controls a target system see 3 2 3 Pod Probe Mode As the user interface with the EVB This requires a development tool such as Motorola s serial debug interface For more information refer to the SDI M Interface User s Manual Motorola document order number SDIUM D M68HC12B32EVB Evaluation Board Rev 1 104 Hardware Reference MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference Prototype Area Table 4 3 BDM Connector J5 Pin Assignments Pin Description Number WO In W12 Out 1 BKGD input to MCU BKGD output from MCU PT7 2 Vss Vss 3 No connection No connection 4 RESET input to MCU RESET output from MCU PT6 1 5 No connection No connection 6 Vpp Von 1 Refer to Table 4 1 4 11 Prototype Area The EVB s prototype area allows construction of custom I O circuitry that can be connected to the MCU s I O lines through connectors P2 P3 P4 and P6 This area is a grid of holes approximately 15 by 31 on 1 10 inch 2 54 mm centers This spacing accommodates most sockets headers and device packages Figure 1 1 EVB Layout and Component Placement shows the component side view of the prototype area Adjacent Vss ground and Vpp footprints are provided for wire wrap pins 4 12 MCU Connectors Four 2 row x 20 pin
109. o are registered trademarks of Motorola Inc MCUez is a trademark of Motorola Inc Apple Macintosh MacTerminal and System 7 are registered trademarks of Apple Computer Inc Windows and Windows 95 are registered trademarks of Microsoft Corporation in the U S and other countries Intel is a registered trademark of Intel Corporation Sun is a registered trademark of Sun Microsystems Inc in the United States and other countries Motorola Inc is an Equal Opportunity Affirmative Action Employer Motorola Inc 1999 All Rights Reserved For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board List of Sections Section 1 General Information Section 2 Configuration and Setup Section 3 Operation Section 4 Hardware Reference Appendix A S Record Format Appendix B Communications Program Examples 117 Appendix C D Bug12 Startup Code Appendix D D Bug12 Customization Data Appendix E EEPROM Bootloader ci o P M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA List of Sections For More Information On This Product Go to www freescale com 3 Freescale Semiconductor Inc List of Sections User s Manual M68HC12B32EVB Evaluation Board Rev 1 4 List of Sections MOTOROLA For More Info
110. ocomputer Systems IASM12 or Motorola s MCUez assembler may be used on a host computer to generate S record object files which then can be loaded into the EVB s memory using D Bug12 s LOAD command The EVB features a prototype area which allows custom interfacing with the MCU s T O and bus lines These connections are broken out via headers P2 P3 P4 and P6 which are immediately adjacent to the MCU on the board Wire wrap pins may be placed in these headers to connect to the prototyping area as shown in Figure 1 1 An on board push button switch S1 provides for resetting the EVB hardware and restarting D Bug12 The EVB can begin operation in any of four jumper selectable W3 and W4 modes at reset n EVB mode program execution begins in one of two ways If D Bug 12 is resident in FLASH EEPROM for example if bootload mode has not been performed D Bug12 immediately issues its command prompt on the terminal display and waits for a user entry If D Bug 12 has been replaced in FLASH EEPROM with user code for example bootload mode has been performed execution begins with the user program n jump EEPROM mode execution begins directly at location 0D00 with the user code in byte erasable EEPROM n pod mode the board makes use of the BDM out header W12 and uses the D Bug12 commands to non intrusively interrogate an external target MCU Special prompts are displayed to let the user know if this
111. ograms not exemplified in this manual Always consult the documentation for the program being used B 3 Procomm for DOS IBM PC B 3 1 Setup User s Manual To set up Procomm using DOS on an IBM compatible PC for use as the EVB terminal first refer to 3 3 Startup for the EVB startup procedure which is inter related with this example Then follow these steps 1 Atthe DOS prompt invoke the Procomm program by typing PROCOMM And then pressing the RETURN key 2 Enter the Setup menu by pressing ALT S M68HC12B32EVB Evaluation Board Rev 1 118 Communications Program Examples MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Communications Program Examples Procomm for DOS IBM PC 3 From the Terminal Setup submenu select Terminal emulation WYSE 100 Duplex FULL Flow control NONE CR translation in CR CR translation out CR BS translation DEST BS key definition BS Line wrap OFF Scroll ON Break Length ms 350 Enquiry CTRL E OFF 4 From the ASCII Transfer Setup submenu select Echo locally YES Expand blank lines YES Pace character 0 ASCID Character pacing 25 1 1000th sec Line pacing 10 1 10th sec CR translation NONE LF translation NONE 5 Enter the Line Settings menu by pressing ALT P Select baud rate 9600 or the customized EVB setting data bits 8 stop bits 1 parity none COM port Host port used as the EVB termina
112. om Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board lt RegisterName gt Command eens ASCII Clidtacters a lo o ASM COMA n assembler juri MT MP DEPT single line D Bug eese ee background debug mode BDM as uSer Interface interface Connect target system Interface BAUD commande BE command ug 37 6 3 dx ERI eS qe bootload mode bootloader EEPROM 0 0 0000 BR commande BULK commande byte erasable defined os En oe oie hk Ae Swe ew hee Gas CALL command IERENS ERE Was checks m rd EE eripe E Lene SES clock CCU oe EC TP D ere he D Aden ri WEAR I Fe RS Exterig INDI obs pod red es suede EU ex FPE M68HC12B32EVB Evaluation Board Rev 1 Index User s Manual MOTOROLA Index For More Information On This Product Go to www freescale com 147 Freescale Semiconductor Inc on board oops hd Ev P RP e REGE nb ohare and dake 103 oscillator chip and socket 25s aos orar 103 j l JD 103 code firmware modification ee eee eee 125 129 generalon desque Sep xg eR RE AREAS ORE C Ree QE RE 20 93 modifying D Bugl oo ea eee eevee gue is Tau REPE da 142 commands SROSISIQENQHIED meno DIAS s ede Vk aree ye e Seo Rel acia 91 92 ASM ci iS EE 47 48 49 50 BAUD NEEN 21 Bese ee ae A AA E ean ol 52 EE 53 54 UB qr Mm 55 CALCD unius Rc ER MARRIED Re E dme a E n Eder ed 56 DEVICE Jod cee eile alien eU wale dle
113. on 79 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc RD Register Display Syntax RD The REGISTER DISPLAY command is used to display the CPU12 s registers Restrictions When operating in pod mode the CPU registers may not be displayed when the R prompt is displayed Example gt RD PC SP X X D A B CCR SXHI NZVC 0206 O3FF 1000 3700 27 FF 1001 0001 gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 80 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Specify Target EEPROM Register Address REGBASE Syntax REGBASE Address Where Address is a 16 bit hexadecimal number Because D Bug12 supports the ability to transparently program the on chip EEPROM of the target MCU it must know the base address of the I O registers Because user code may change the register block s base address by writing to the INITRG register D Bug12 must be informed of the register block s base address for transparent EEPROM writes to occur The REGBASE command is used to specify the base address of the target processor s on chip registers The REGBASE command does not check to ensure that the lt Address gt parameter is a valid base address for the selected M68HC12 Family member If an improper register base address is provided automatic programming of the on chi
114. on the user s stack that returns to D Bug12 when the final RTS of the subroutine is executed Any subroutine must obey this restriction to execute properly The CALL command cannot be issued when the R gt prompt is displayed indicating that the target system is already running a user program gt CALL 820 Subroutine Call Returned PC SP X Y D A B CCR SXHI NZVC 0820 0A00 057C 0000 OF F9 1001 0000 gt M68HC12B32EVB Evaluation Board Rev 1 56 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Specify Target MCU Device DEVICE Syntax DEVICE DEVICE DeviceName EEStart lt EEEnd gt FStart FEnd RAMStart RAMEnd lt IOBase gt Where lt DeviceName gt is the maximum of seven ASCII characters used to select define a target MCU device lt EEStart gt is the on chip EEPROM starting address a 16 bit hexadecimal number lt EEEnd gt is the on chip EEPROM ending address a 16 bit hexadecimal number lt FStart gt is the on chip FLASH EEPROM starting address a 16 bit hexadecimal number lt FEEnd gt is the on chip FLASH EEPROM ending address a 16 bit hexadecimal number lt RAMStart gt is the on chip RAM starting address a 16 bit hexadecimal number lt RAMEnd gt is the on chip RAM ending address a 16 bit hexadecimal number IOBase is the base address of th
115. oq ra Vd z aan ag 8 dd bam n Ho 5 aoa 0 1 EM wes xL gg awe 1 0 G ano lt e e s d HA o 0 Q A oqva tava ASL e o anro anro Jnro anro aaa ite b 0 810 619 020 120 zegzL60H890W Tavd z 0 8u ec ano PM Su ano Q ie EXATA BZ ESA A n 3 ZFQGA ano Ars E EEN ges tem os Za S2 DITA Ob 68 avadn ui gt AE Sa Ce dan ano O0A Hun os TEA aNd d 9LvEOIN A oz ano 6r HEA A ano NO ano O Wx A A na E i XSSA wa PE Wx ES dbz 13938 SS 13s38 mue vio T o ES 13538 LA ei LNANI anot 00 0 pes SONS TE 798 oo Zz 100A sio Be TSSA H H i n alle 034 91M o 0010d 13d S 13838 on a fonos 239 PEE z E Id SL jaa ega E Ad ow ST0d 22 20103 ales tad T OA Be tO1dd El 62 vad o isa 1 Gd dd a as dy ez VOOWSSd 13538 LL osa 30104 ul soga Ha LZ BOCH dan 08d 39104 OL ES I3d En H 08d T ves Ted FEL 08d ISd 28 zod zag L 6t Tad A wd 9 02 zad dan 83 E ead pH v9 IZ tad vSd pad LE Hd Sd S9 Gog cag 22 rad Sy los gag Lee Y Y 29 Ng daa pve 18d 89 SZ 18d E Sdd ius T Tad EXATA AE 1 idvd ina LZ ord tad asp KZ 28 avd aa la Id TD ZO TOd wd Elon eral eld TXATA TOYdd tdvd YS yava vld EL tId vad wd trova SS cayd IIE tid VOOWS3d SdOW 93d 78d RES 96 saya ara Lee Sid 18d ES EVE 187 java Za LS od sad tSd Get 88 St Zid tad 18d me osa bg E Td OF E Idd El zaa H r Evd 721 eva Geer Edd VITA SR Wd ey yg eaa laz vdd EAE dad EXE wava esa il dd Gate Zid REGER Sr A FR
116. or More Information On This Product Go to www freescale com Freescale Semiconductor Inc Modify Register Value Continued lt RegisterName gt This set of commands uses a CPU12 register name as the command name to allow changing the register s contents Each register name or CCR bit name is entered on the command line followed by a space then followed by the new register or bit contents After successful alteration of a CPU register or CCR bit the entire CPU register set is displayed Restrictions None Example PC 700e PC SP X Y D A B CCR SXHI NZVC 700E 0A00 7315 7D62 47 44 1001 0000 gt X 1000 PG SP X Y D A B CCR SXHI NZVC 700E 0A00 1000 7D62 47 44 1001 0000 C 1 PC SP X Y D A B CCR SXHI NZVC 700E 0A00 1000 7D62 47 44 1001 0001 gt Z P SP X Y D A B CCR SXHI NZVC 700E 0A00 1000 7D62 47 44 1001 0101 gt D adf7 PC SP X X D A B CCR SXHI NZVC 700E 0A00 1000 7D62 AD F7 1001 0101 gt User s Manual M68HC 12B32EVB Evaluation Board Rev 1 92 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation Off Board Code Generation 3 8 Off Board Code Generation Code developed outside the EVB environment should be generated with an M68HC12 compatible assembler or C compiler that can generate object files in S record format The recommended assembler P amp E Mic
117. ore Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Program Target FLASH EEPROM FLOAD Syntax Where Restrictions FLOAD lt AddressOffset gt AddressOffset isa 16 bit hexadecimal number The FLOAD command is used to program a target device s FLASH EEPROM memory with the data contained in S record object files The address offset 1f supplied is added to the load address of each S record before the S record s data bytes are placed in memory Providing an address offset other than 0 allows object code or data to be programmed into memory at a location other than that for which it was assembled or compiled The programming of the on chip FLASH EEPROM uses an algorithm where the time required to program each byte or word can vary from as little as 60 sto as long as 3 5 ms Note however that the programming time for each byte or word typically should take no more than 120 to 180 us Because of this variability the FLOAD command uses a software handshaking protocol to control the flow of S record data from the host computer When the FLOAD command is ready to receive an S record an ASCII asterisk character is sent to the host computer The host computer should respond by sending a single S record The S record may include a carriage return and or line feed character s Most commercial terminal programs that are capable of sending ASCII text files h
118. ors which reside in erase protected areas of FLASH EEPROM Failure to remove them will cause errors Using a text editor prepare the D Bug12 S record file as follows 1 Search for the S record line that begins with S123FC00 2 Delete this line and all remaining S records except for the last line in the file which is the S9 end of file record This removes the bootloader program and vector table from the file 3 Make sure that no blank lines remain in the file as they may cause the loading process to fail The S record file may now be programmed into FLASH EEPROM using the E and P bootloader procedures described in E 3 Serial S Record Bootloader M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA EEPROM Bootloader 141 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader E 5 3 Customizing D Bug12 Two areas within D Bug12 may be customized by the user Customization data Located from F6C0 F6FF This area contains default data parameters that D Bug12 uses for device initialization for instance baud rate for the communications interface Startup code Located from F700 F77F This area contains program code used by D Bug12 to initialize the MC68HC912B32 s hardware Appendix C D Bug12 Startup Code and Appendix D D Bug12 Customization Data contain detailed explanations and source listings for these two areas First
119. p EEPROM will not operate properly When operating in EVB mode the default register base address is specified in the customization data variable Cust omData IOBase This value is used by the startup code to remap the I O registers The REGBASE command may not be used to relocate the I O registers NOTE The REGBASE command does not automatically modify the INITRG register The user is responsible for ensuring that the INITRG register is modified either manually or through the execution of user code Restrictions The REGBASE command may not be used when D Bug12 is operated in the EVB mode M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 81 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc REGBASE Specify Target EEPROM Register Address Continued Example User s Manual S gt DEVICE Device 912B32 EEPROM 0D00 SOFFF Flash 8000 SFFFF RAM 0800 SOBFF I O Regs 0000 S gt REGBASE 2000 Device 912B32 EEPROM 0D00 SOFFF Flash 8000 SFFFF RAM 0800 SOBFF I O Regs 2000 EE M68HC12B32EVB Evaluation Board Rev 1 82 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Reset Target MCU Syntax Restrictions Example Operation D Bug12 Command Set RESET RESET The RESET command is used to reset the targe
120. pin header connectors for access to the MCU s I O and bus lines P2 P3 P4 and P6 Prototype expansion area for customized interfacing with the MCU Low profile reset push button switch S1 LVI protection U3 M68HC12B32EVB Evaluation Board Rev 1 16 General Information MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information General Description and Features Firmware features include D Bugl2 monitor debugger program resident in on chip FLASH EEPROM electrically erasable programmable read only memory e Full support for either dumb terminal or host computer terminal interface e Single line assembler disassembler e File transfer capability from a host computer to RAM or EEPROM allowing off board code generation e Ability to program EEPROM on either the host EVB or a compatible target system M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA General Information 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information M68HC12B32EVB PROTOTYPE AREA ep P5 INPUT K VDD aj VFP L 1 1 BOWE z R GND C17 R12 W9 BDM OUT C MOTOROLA INC 1996 Figure 1 1 EVB Layout and Component Placement User s Manual M68HC12B32EVB Evaluation Board Rev 1 18 General Information MOTOROLA For More Information On This Product Go to
121. put will be used There is no code data field Only one termination record is used for each block of S records Normally only one header record is used although it is possible for multiple header records to occur M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA S Record Format 113 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc S Record Format A 5 S Record Creation S record format programs may be produced by dump utilities debuggers cross assemblers or cross linkers Several programs are available for downloading a file in the S record format from a host system to an 8 or 16 bit microprocessor based system A 6 S Record Example A typical S record format as printed or displayed is shown in this example Example 00600004844521B 1130000285F245F2212226A00042429008237C2A s11300100002000800082529001853812341001813 113002041E900084442234300182342000824A952 s107003000144ED492 S9030000FC In the example the format consists of e An SO header e Four S1 code data records e An S9 termination record A 6 1 SO Header Record User s Manual The SO header record is described in Table A 4 Table A 4 SO Header Record S Record Field Entry Description Type S0 S record type SO indicating a header record Record 06 Hexadecimal 06 decimal 6 indicating six Length character pairs or ASCII b
122. quire that the EVB be reset FLASH EEPROM programming voltage Vpp must be applied to the target MCU If the target system is another M68HC12B32EVB board Vpp may be supplied via header W8 with header W7 set accordingly For more information on these EVB headers see Table 4 1 Because the FLOAD command downloads a small driver program into the target MCU s on chip RAM D Bug12 s breakpoint table is cleared before beginning execution of the driver This is necessary to prevent previously set breakpoints from accidentally halting the execution of the driver program S gt ELOAD Flash Programming Voltage Not Present S gt FLOAD RS RS Ck ck ck kk ck kk ck ck KKK KKK KKK KKK S M68HC12B32EVB Evaluation Board Rev 1 66 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Go Execute a User Program G Syntax G lt Address gt Where Address is an optional 16 bit hexadecimal number The G command is used to begin the execution of user code in real time Before beginning execution of user code any breakpoints that were set with the BR command are placed in memory Execution of the user program continues until a user breakpoint is encountered a CPU exception occurs the STOP or RESET command is entered or the EVB s reset switch is pressed When user code halts for any of these reasons except reset which w
123. r More Information On This Product Go to www freescale com Freescale Semiconductor Inc instead of being part of the addressable memory map The CPU always has direct access to the information in these registers Memory locations that hold status and control information for on chip peripherals are called I O and control registers reset Reset is used to force a computer system to a known starting point and to force on chip peripherals to known starting conditions S record A Motorola standard format used for object code files simulator A computer program that copies the behavior of a real MCU source code See source program source program A text file containing instruction mnemonics labels comments and assembler directives The source file is processed by an assembler to produce a composite listing and an object file representation of the program stack pointer A CPU register that holds the address of the next available storage location on the stack TTL Transistor to transistor logic Nun The positive power supply to a microcontroller typically 5 volts dc Vss The 0 volt dc power supply return for a microcontroller Word A group of binary bits Some larger computers consider a set of 16 bits to be a word but this is not a universal standard User s Manual M68HC12B32EVB Evaluation Board Rev 1 146 Glossary MOTOROLA For More Information On This Product Go to www freescale c
124. rd 2 1 Contents 2 4 23 2 4 2 2 6 2 6 1 20 2 2 6 3 2 6 4 Section 2 Configuration and Setup Unpacking and Piepoli A aie uk rd EELER R3 EROR snes Si A AAA EE 28 EVB to Power Supply Connection c ocorinasisns ricas es 29 EVB to Terminal Connection EE a 29 Terminal Communications Setup ENEE res 31 Communication Parameters A SAAR EEN ENEE EK A 31 Dumb Tecminal Seip 5 254256 0506s 05 dytte isane 31 FOSA OI SONIS Lue qud lcd a A wa eto dor ied pbi Rn 31 Changing the Baud Rale i4 2sosacebatckbekhbr ek rd 32 2 2 Unpacking and Preparation Before beginning configuration and setup of the EVB 1 Verify that these items are present in the EVB package e M68HC12B32EVB board assembly e Background debug mode BDM interface cable 6 pin to 6 pin e Warranty and registration cards e EVB schematic diagram and parts list e M68HC12B32EVB User s Manual e MC68HC912B32 Technical Summary e MC68HC912B32 Electrical Specifications Supplement e CPUI2 Reference Manual e MC SHCI2 Family Brochure M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Configuration and Setup 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Configuration and Setup Using D Bugl2 Callable Routines e Assembly language development toolset e P amp E Microcomputer Systems IASMI2 assembler and user s manual on 3 5 inch diskette 2 Remove the EVB from its anti st
125. re than a total of 10 parameters The second function parameter is a pointer to an array of char Each char points to one of the command line parameters parsed by the command line interpreter The function implementing the new command can report any error conditions to the user in one of two ways e If the error condition can be described by one of the error messages in the enumerated constant list here the user defined command should return the appropriate constant e H some other message text needs to be conveyed to the user the command should communicate the error message directly to the user by using the printf function which is one of the available user callable C functions In this case the user defined command should return an error code of noErr noErr 0 Define No Error WrongNumArgs 6 Wrong Number of Arguments BadStartAddress 7 Invalid Starting Address BadEndAddress 8 Invalid Ending Address StartEndError 9 Start Address Greater Than End Address BadHexData 10 Invalid Hex Data DataSizeError 11 Data Out Of Range NoTargetWrite 12 Can t Write Target Memory D User s Manual M68HC12B32EVB Evaluation Board Rev 1 134 D Bug12 Customization Data MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board Appendix E EEPROM Bootloa
126. ress may overlap the memory block defined by the lt StartAddress gt and lt EndAddress gt One of the uses of the MOVE command might be to copy a program from RAM into the on chip EEPROM memory A minimum of one byte may be moved if the lt StartAddress gt is equal to the lt EndAddress gt The maximum number of bytes that may be moved is St Be careful when moving target memory while user code is running Accidentally modifying target memory containing program code could lead to program runaway gt MOVE 800 8ff 1000 gt M68HC12B32EVB Evaluation Board Rev 1 78 Operation MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Operation D Bug12 Command Set Remove Breakpoints NOBR Syntax NOBR Address Address Where Address is an optional 16 bit hexadecimal number The NOBR command can be used to remove one or more previously entered breakpoints If the NOBR command is entered without any arguments all user breakpoints are removed from the breakpoint table Restrictions When operating in pod mode breakpoints may not be removed with the NOBR command when the R prompt is displayed Example gt BR 800 810 820 830 Breakpoints 0800 0810 0820 0830 gt NOBR 810 820 Breakpoints 0800 0830 gt NOBR All Breakpoints Removed gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operati
127. rmation On This Product Go to www freescale com Freescale Semiconductor Inc Operation Operating Modes 3 2 Operating Modes NOTE 3 2 1 EVB Mode The EVB can operate in one of four jumper selectable modes EVB mode Either D Bugl2 or the user code in FLASH EEPROM executes e Jump EEPROM mode User code in byte erasable EEPROM executes e Pod mode D Bugl2 executes EVB serves as the BDM probe for a target system Bootload mode The host EVB s EEPROM may be reprogrammed The operating mode is determined by jumper headers W3 and W4 as shown in Table 4 1 Jumper Selectable Functions The modes are described in the following three subsections When operating in EVB mode the M68HC12B32EVB cannot fully emulate a target system The limitations are described in 3 10 Operational Limitations Target system emulation may however be performed by using the EVB with D Bug12 as an intelligent non intrusive BDM interface This operation is described in 3 2 3 Pod Probe Mode In the default EVB mode W3 0 and W4 0 D Bug12 begins execution immediately The D Bug12 prompt appears on the terminal and commands may be entered as described in 3 6 Using D Bug12 Commands If D Bug12 has been replaced with user code in FLASH EEPROM execution begins with the user s program 3 2 2 Jump EEPROM Mode In this mode W3 1 and W4 0 the EVB begins operation out of reset by executing the user program in byte erasable EE
128. rmation On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual M68HC12B32EVB Evaluation Board Table of Contents Section 1 General Information 1 1 Ws co rcm 15 1 2 lino 0 T 13 13 General Description and Features eg AEN cies ea 15 L4 Pe DUBIE Los Les hee St bd reper d duree id A 19 L5 External Equipment Requirements sg d e AER EIERE E AER 22 1 6 o AA 23 1 7 Typographic LOBVEBIUDE ccu E EE EE 24 1 8 AND SUPO eet tee quare ia 25 Section 2 Configuration and Setup 2 1 Eder Edda die iride Dacis olia rA ERA A Sd 2 2 2 Unpacking and Preparation 2s 9 SEENEN AER NEE EN 27 2 3 EYB Cooleri Osos ed Eier Re EP E PROPERE less A d RS 28 25 EVB to Power Supply Connectlol sdcsess su e ovre LER E WS 29 25 EVB to Terminal Kom iocos pblRE RR RE ERRARE RES 29 2 6 Terminal Communications Sel iseseercenscswyrebesutoshws 31 2 6 1 Kammer Farage 26 5 kd derre AN EC 31 2 5 2 Dymb Terminal SetuP AN ANERE EEN p A dE Rx RE 31 2 6 3 Host Computer Setup da Se NEE NEE csi RR TeRF EE 31 2 6 4 Changing the Baud Rate EE EE 32 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Table of Contents 5 For More Information On This Product Go to www freescale com User s Manual Freescale Semiconductor Inc Table of Contents 3 1 3 2 ENT 3 2 2 3 4 3 E RCNCM 3 2 3 2 3 4 3 2 32 3 4 3 2 4 33 KEN det 3 3 2 1 33 22 S53 3 3 2 4 3 4 3 3 3 6
129. rocomputer Systems IASMI2 is supplied with the EVB package on the diskette labeled IASM 12 The IASMI2 user s manual IASM12 DOC is also on the diskette S records are described in Appendix A S Record Format When the S record file has been generated it may be loaded from the host computer into EVB memory in these ways nto the host EVB s byte erasable EEPROM or RAM using the D Bug12 commands BULK and LOAD when the host EVB is in EVB mode nto the host EVB s byte erasable or FLASH EEPROM using the EEPROM bootloader when the host EVB is in BOOTLOAD mode ntoatarget MCU s byte erasable EEPROM or RAM using the D Bug12 commands BULK and LOAD when the host EVB is in pod mode ntoatarget MCU s FLASH EEPROM using the D Bug12 commands FBULK and FLOAD when the host EVB is in pod mode More information on the EVB operating modes the D Bug12 commands and the EEPROM bootloader can be found in 3 2 Operating Modes 3 3 2 Operating Procedures 3 7 D Bug12 Command Set and Appendix E EEPROM Bootloader 3 9 Memory Usage The EVB s memory usage and requirements are described here and are summarized in Table 3 6 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 93 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 3 9 1 Description NOTE 3 9 2 Memory Map The monitor program D Bug12 occupies the 32 Kbyte FLASH EEPROM area of the MCU s m
130. s added to the load address of each S record before an S record s data bytes are compared to the contents of memory Providing an address offset other than 0 allows the S record s object code or data to be compared against memory other than that for which the S record was assembled During the verification process an ASCII asterisk character is sent to the control console for each 10 S records that are successfully verified When an S record file has been verified successfully control returns to the D Bug12 prompt If the contents of EVB memory do not match the corresponding data in the received S records an error message is displayed and the VERIFY command is terminated D Bug12 then returns to its command line prompt If the host computer continues to send S records to the EVB D Bug12 tries to interpret each S record as a command and issues an error message for each S record received If the contents of EVB memory match the contents of the received S records the VERF command terminates when D Bug12 receives an S9 end of file record If the object file being verified does not contain an S9 record D Bug12 continues to wait for an S9 record without returning to the command line prompt Pressing the reset switch S1 returns D Bug12 to its command line prompt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 89 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc
131. s Manual M68HC12B32EVB Evaluation Board Section 4 Hardware Reference 4 1 Contents 4 2 Printed Circuit Board PCB Description nssnanan naea 97 4 3 Configuration Headers and Jumper Settings 98 Z5 Power lop LIH oo a ode oo hewn ree ae 101 4 5 Termal Derne EM NEM 102 4 6 hoher nr Il C MS 102 4 7 LESER T DOE cdd da dead ioo dior Gl eco Rar NOR aci dA dna d Roo dog 103 4 8 Kr E 103 4 9 Low Voltage nhibit GEN gun e A 104 4 10 Background Debug Mode BDM Interface 104 PIL o aii d EO eo dg o dao pee ded d abd n 105 RIS A coude pd EGER wei HC COR EH 105 E o 0c DT 107 4 2 Printed Circuit Board PCB Description The EVB printed circuit board PCB is an 5 15 inch by 3 4 inch 13 1 cm by 8 64 cm board with two layers Most of the connection points on the EVB use headers spaced on 1 10 inch 2 54 mm centers with these exceptions e Subminiature D connector for the RS 232C interface e External power supply connections M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Hardware Reference 97 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Hardware Reference 4 3 Configuration Headers and Jumper Settings NOTE CAUTION User s Manual For maximum flexibility the EVB uses two types of jumper headers e Factory installed headers are those most likely to be used for configuration without m
132. s the contents of memory as both hexadecimal bytes and ASCII characters 16 bytes on each line The lt StartAddress gt parameter must be supplied the lt EndAddress gt parameter is optional When the lt EndAddress gt parameter is not supplied a single line is displayed The number supplied as the lt St artAddress gt parameter is rounded down to the next lower multiple of 16 while the number supplied as the lt EndAddress gt parameter is rounded up to the next higher multiple of 16 minus 1 This causes each line to display memory in the range of xxx0 through xxxF For example if 205 is entered as the start address and 217 as the ending address the actual memory range displayed would be 200 through 21F Restrictions None Example gt MD 800 0800 AA 04 37 6A 0006 27 F9 35 AE 78 OD B7 56 78 20 73 5 x Vx MD 800 87f 0800 AA 04 37 6A 00 06 27 F9 35 AE 78 OD B7 56 78 20 7j 5 x Vx 0810 B6 36 27 F9 35 AE 27 FO Sb op 27 F9 35 BE B5 28 6 54 5 54 0820 27 F9 35 D6 37 B8 00 OF 37 82 01 OA 37 36 FF FO 5 7 7 76 0830 7C 1037 B3 00 00 37 B6 00 OF AA 04 A5 02 37 BO 7 7 Js 0840 00 OF 27 78 37 6A 00 06 27 F9 35 78 27 F9 35 56 x7j 5x 5V 0850 78 OD B7 10 78 3B 37 86 00 DC 27 F9 35 48 78 57 x x 1 5bHxW 0860 37 86 00 DE F5 01 EA09 37 B5 OD OA 27 F9 36 2A 7 arora
133. scale Semiconductor Inc D Bug12 Customization Data Customization Data Area D 2 7 EEBase and EESize Fields The EEBase and EES ize fields are used to describe the base address and range of the M68HC12 s on chip byte erasable EEPROM This information is used by D Bug12 s WriteMem function to determine when a byte is being written to the on chip EEPROM D Bug12 then calls its WriteEEByte function to place the data in the on chip EEPROM On the MC68HC912B32 the EEPROM base address is mappable to any 4 Kbyte memory space and resides in the upper 768 bytes of the 4 Kbyte block Therefore the EEBase entry should be only a multiple of 0x1000 The value of EEBase is set to 0x0d00 which is the default base address of the on chip EEPROM for the MC68HC912B32 The value of EESi ze is also set to 0x0300 768 which is the size of the on chip EEPROM Setting the value of EESize to 0 disables the WriteMem function s ability to write to on chip EEPROM NOTE Itis the responsibility of the startup code to set the base address of the EEPROM D Bug12 does not set or change the EEPROM base address D 2 8 EEPROM Erase Program Delay Function Pointer Field The void Delay void field is a function pointer that points to an EEPROM program erase delay routine For the MC68HC912B32 the routine should produce a delay of 10 ms before it returns The current implementation of the delay routine is nothing more than a software delay loop The subro
134. sdunf peppy Waat TIY 40 8 NId S OI NId PI TIY JO L NIA 8 01 NId 8 TIY JO p NId OL QNITddV SI oud 96 I IT IMS abueu reen y Jesey 103 sdun m ppy y SNOIIVIOT NId QNnONS z 36 81 01 zez s3 mou sadu 3exoos 43008 eAcweYy 3 96 T 01 SHNdWnn INO SSVdAH DE 481 HHA OCH Z quvod NO T LVO IVAW OL S 0I NId 0Z TIY 4O 0Z NId 5 01 NId 9I TIY 40 91 NId S 2I NId PI TIY 40 PI NIA IVO SV QWVOS NOIIVTVAS ZEZIGOH892H I s 01 NId 8 TIY dO 8 NId OL G ITddw SI ODA dc lodAd E e SNOIIVOOT NId 22A GNOo IS IA 2 d GHI4IONdS ASIMYSHLO SSTINN 8 1 9 J A a z r 4 8 9 S Y D E z i p z Sos 8661 BZ J990190 epssupaw owed s mozeosasve9 8 ano AU J9quiny jueuinoo ezis GND A QHVOS NOLLVITIVA3 ZE82168A3 15 enu wei E 3D aert ER 1 STOOL IN3NdO13A30 VIOHOLON 80 anot iH SM E ILMO Wdd Ir ep 3 ano P 15 Tz T od TM y TIM 9 E eiu 1 15 7 T asi OM LISTA T e doa ad VOOWS3d E BM T o ZUM K eld 9M ug bd aa 3 le ddA 3 E T Sr M 0 FEREN ano SL __ LN
135. ser s Manual S Record Format For More Information On This Product Go to www freescale com 115 Freescale Semiconductor Inc S Record Format The second and third S1 code data records each also contain 13 19T character pairs and are ended with checksum 13 and 52 respectively The fourth S code data record contains 07 character pairs and has a checksum of 92 A 6 3 S9 Termination Record The S9 termination record is described in Table A 6 Table A 6 S9 Header Record S Record Se Field Entry Description Type S9 S record type S9 indicating a termination record Record 03 Hexadecimal 04 indicating three character pairs Length three bytes follow Address i 4 character 2 byte address field zeroes Code Data There is no code data in an S9 record Checksum FC Checksum of S9 record A 6 4 ASCII Characters Each printable ASCII character in an S record is encoded in binary Table A 5 gives an example of encoding for the S1 record The binary data is transmitted during a download of an S record from a host system to a 9 or 16 bit microprocessor based system For example the first S1 record in Table A 5 is sent as shown here LENGTH ADDRESS CODE DATA CHECKSUM A User s Manual M68HC12B32EVB Evaluation Board Rev 1 116 S Record Format MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc User s Manual
136. t system processor when operating in D Bug12 s pod mode The target processor s reset pin is held byte erasable for approximately 2 ms When the reset line is released BDM commands are sent to the target processor to place it in active background mode The target processor s registers are initialized with the same values used for the registers when operating in EVB mode The effects of the RESET command may be different from a user assertion of the target s RESET pin When the RESET command is issued the host EVB controls the state of the target s BKGD pin placing the target processor in special mode and active background execution When a user assertion of the target s RESET pin occurs the target processor may enter either special or normal mode depending on the state of its BKGD pin D Bug12 displays a message indicating that the target processor has been reset When operating in EVB mode the RESET command cannot be used If the RESET command is entered while in EVB mode an error message is displayed and command execution is terminated S gt RESET Target Processor Has Been Reset S G 4000 R gt RESET Target Processor Has Been Reset EE M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 83 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc RM Syntax Restrictions Example User s Manual Register Modify RM The REGISTER
137. the MCU s RESET pin directly Note that header W15 may be used to provide an alternate reset input M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Hardware Reference For More Information On This Product Go to www freescale com 103 Freescale Semiconductor Inc Hardware Reference 4 9 Low Voltage Inhibit LVI Low voltage inhibit LVT uses a Motorola undervoltage sensing device U1 to automatically drive the MCU s RESET pin low when Vpp falls below Ul s threshold This prevents the accidental corruption of EEPROM data if the power supply voltage should drop below the allowable level Depending on the date of manufacture the sensing device installed on the EVB may have either a 2 7 volt or 4 5 volt threshold U1 may be identified by part number e MC34164P 3 2 7 Vdc e MC34164P 5 4 5 Vdc If operation below U1 s threshold but no less than 2 7 Vdc is required one of two methods can be used Replace Ul with a device that has the required threshold voltage e Cut the trace on header W15 to disconnect U1 from the RESET line If this is done an external reset signal should be provided via W15 in case the supply voltage falls below the acceptable level 4 10 Background Debug Mode BDM Interface User s Manual The MCU s serial BDM interface can be accessed through two 2 row x 3 pin headers BDM in W9 and BDM out W12 The pin assignments are shown in Table 4 3 The BDM i
138. the bootloader s prompt is redisplayed If an error occurs during programming see the previous caution If errors persist the problem may be caused by an S record containing data that is outside the range of the available FLASH EEPROM The S record data must be within the range 8000 F7FF This selection causes a bulk erase of byte erasable EEPROM in the address range 0D00 SOFFF After the erase operation a verify operation checks for proper erasure of all locations If any locations were found to contain a value other than FF the message Not Erased is displayed and the bootloader s prompt is redisplayed If the erase operation was successful the bootloader sends an ASCII asterisk character to the host computer indicating that it is ready to receive an S record The host then sends a single S record and waits for the prompt from the bootloader before sending the next S record M68HC12B32EVB Evaluation Board Rev 1 138 EEPROM Bootloader MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader Vector Jump Table Interrupt and Reset Addresses This process is repeated until the bootloader receives an end of file S9 record from the host computer If no S9 record is received the bootloader continues to wait for another S record indefinitely In this situation the EVB must be reset to return to the bootloader s prompt S records already load
139. ttyb etc by typing set line dev ttya ENTER 3 Setthe baud rate to 9600 or the customized EVB setting by typing set speed 9600 ENTER 4 Connect to the EVB by typing connect ENTER 5 Reset the EVB by pressing s1 or by activating the appropriate custom reset circuitry The D Bug12 prompt should appear on the display Continue with the startup procedure in 3 3 Startup M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Communications Program Examples 121 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Communications Program Examples B 5 2 S Record Transfers to EVB Memory To load an S record file from the host computer into EVB memory using Kermit on a Sun Workstation first verify that the host is correctly configured and operating as the EVB terminal Then follow these steps 1 In the shell window being used for the EVB terminal interface at the D Bug12 prompt enter the LOAD or VERF command with any parameters 2 Open a shell window separate from the one being used for the EVB terminal interface In this window type cat lt filename gt gt dev ttya ENTER Upon completion of the S record file transfer the D Bug12 prompt is displayed in the shell window being used for the EVB terminal interface B 6 MacTerminal Apple Macintosh Using MacTerminal on an Apple Macintosh computer is described here B 6 1 Setup To set up MacTerminal on an Apple Ma
140. uage source statements into the binary information that the CPU needs LSB Least significant bit MCU Microcontroller unit Microcontroller A complete computer system including CPU memory clock oscillator and I O on a single integrated circuit MSB Most significant bit object code file A text file containing numbers that represent the binary opcodes and data of a computer program An object code file can be used to load binary information into a computer system Motorola uses the S record file format for object code files operand An input value to a logical or mathematical operation opcode A binary code that instructs the CPU to do a specific operation in a specific way OTPROM A non volatile type of memory that can be programmed but cannot be erased An OTPROM is an EPROM MCU that is packaged in an opaque plastic package It is called a one time programmable MCU because there is no way to expose the EPROM to a UV light program counter The CPU register that holds the address of the next instruction or operand that the CPU will use RAM Random access memory Any RAM location can be read or written by the CPU The contents of a RAM memory location remain valid until the CPU writes a different value or until power is turned off registers Memory locations that are wired directly into the CPU logic M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Glossary 145 Fo
141. ubsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part Motorola and M are registered trademarks of Motorola Inc Motorola Inc is an Equal Opportunity Affirmative Action Employer How to reach us USA EUROPE Locations Not Listed Motorola Literature Distribution RO Box 5405 Denver Colorado 80217 1 303 675 2140 or 1 800 441 2447 Customer Focus Center 1 800 521 6274 JAPAN Motorola Japan Ltd SPS Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 8573 ASIA PACIFIC Motorola Semiconductors H K Ltd Silicon Harbour Centre 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 Mfax Motorola Fax Back System RMFAX0 email sps mot com http sps motorola com mfax TOUCHTONE 1 602 244 6609 US and Canada ONLY 1 800 774 1848 HOME PAGE http motorola com sps Mfax is a trademark of Motorola Inc Motorola Inc 1999 M MOTOROLA M68HC12B32EVBUM D For More Information On This Product Go to www freescale com
142. uctions Bcc LBcc BRSET BRCLR DBEQ NE IBEQ NE and TBEQ NE that contain an offset that branches back to the instruction opcode do not execute D Bug12 appears to become stuck at the branch instruction and does not execute the instruction even if the condition for the branch instruction is satisfied This limitation can be overcome by using the GT GO TILL command to set a temporary breakpoint at the instruction following the branch instruction In EVB mode the TRACE command may be used only for code located in alterable memory These restrictions do not apply when using D Bug12 on a target system in pod mode M68HC12B32EVB Evaluation Board Rev 1 86 Operation MOTOROLA For More Information On This Product Go to www freescale com Trace Continued Example Freescale Semiconductor Inc PC 0803 0803 gt I 3 PC 0806 0806 PC 0803 0803 PC 0806 0806 SP X O9FE 057C 830001 SP X O9FE 057C 26FB SP X O9FE 057C 830001 SP X O9FE 057C 26FB M68HC12B32EVB Evaluation Board Rev 1 Y 0000 Y 0000 BNI Kal 0000 SUBD 0000 D A B 10 00 50001 D A B OF FF 0803 D A B OF FF 50001 D A B D Bug12 CCR SXHI 1001 CCR SXHI 1001 CCR SXHI 1001 CCR SXHI 1001 Operation Command Set T NZVC 0000 NZVC 0000 NZVC 0000 NZVC 0000 User s Manual MOTOROLA Operation For Mor
143. uration Other configurations require different operating software arrangements EEPROM resides in two areas of memory refer to Table 3 6 Factory Configuration Memory Map which are referred to in this manual as byte erasable EEPROM and FLASH EEPROM This distinction is necessary because of the different ways in which they may be programmed and used D Bug12 uses the MCU s serial communications interface SCI for communications with the user terminal For information on the port and its connector refer to 2 5 EVB to Terminal Connection and 4 5 Terminal Interface If the MCU s single wire background debug mode BDM interface serves as the user interface the SCI port becomes available for user applications This mode requires either Another M68HCI2B32EVB and a host computer e A background debug development tool such as Motorola s serial debug interface SDI For more information refer to the SDI M Interface User s Manual Motorola document order number SDIUM D Two methods may be used to generate EVB user code e For small programs or subroutines D Bug12 s single line assembler disassembler may be used to place object code directly into the EVB s RAM or EEPROM M68HC12B32EVB Evaluation Board Rev 1 20 General Information MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc General Information Functional Overview e For larger programs P amp E Micr
144. utine is located in the startup code area of the D Bug12 FLASH EEPROM from F700 to F77F D 2 9 Auxiliary Command Table Entries The last two entries in this table provide a mechanism to extend D Bug12 s command set The AuxCmdTab1eP points to an auxiliary command table and AuxCmdCount contains the number of entries in the auxiliary command table The table is an array of entries of type CndTblEntry EachCmdTblEntry in the auxiliary command table has this structure typedef struct const char CommandStr pointer to the command string int ExecuteCmd int argC char argV pointer to function that implements the command CmdTblEntry CmdTblEntryP M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA D Bug12 Customization Data 133 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc D Bug12 Customization Data enum Error As the typedef shows the first field is a character pointer pointing to a null terminated character array containing the command name The command name string must be in upper case The second field a function pointer points to a function that implements the new D Bug12 command The first parameter to this function is a count of the number of command line arguments that the command line interpreter found on the command line This count includes the command name itself The command line may contain no mo
145. ved for future expansion of the bootloader Thus user code may only occupy the 30 Kbytes from 8000 to F7FF Programs loaded and used in this manner cannot be used for true emulation of an application Refer to the restrictions in 3 9 Memory Usage E 3 Serial S Record Bootloader User s Manual The bootloader contains a serial S record loader that can load assembled code from the host computer into either FLASH EEPROM or byte erasable EEPROM It uses the SCI for communications with the host computer via the EVB s RS 232C interface The only special requirements for the host computer s communications program are e t must operate at 9600 baud s It must wait for the prompt string the ASCII asterisk character before sending a line of text to the EVB This handshaking is necessary because of the variable amount of time required to program each S record into byte erasable or FLASH EEPROM Byte erasable EEPROM requires 10 ms per byte FLASH EEPROM typically requires less than 180 us per byte but can take as long as 3 5 ms M68HC12B32EVB Evaluation Board Rev 1 136 EEPROM Bootloader MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader Serial S Record Bootloader When the EVB is restarted with jumpers W3 and W4 set for bootload mode the EEPROM bootloader executes immediately The bootloader s prompt appears on the host terminal
146. w F7DE FFEO Timer Channel 7 F7E0 FFE2 Timer Channel 6 F7E2 FFE4 Timer Channel 5 F7E4 FFE6 Timer Channel 4 F7E6 FFE8 Timer Channel 3 F7E8 FFEA Timer Channel 2 F7EA FFEC Timer Channel 1 F7EC FFEE Timer Channel 0 F7EE FFFO Real Time Interrupt F7FO FFF2 IRQ F7F2 FFF4 XIRQ F7F4 FFF6 SWI F7F6 FFF8 Illegal Opcode Trap F7F8 FFFA COP Failure Reset F7FA FFFC Clock Mon Fail Reset F7FC FFFE RESET F7FE User s Manual M68HC 12B32EVB Evaluation Board Rev 1 140 EEPROM Bootloader MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc EEPROM Bootloader Reloading and Customizing D Bug12 E 5 Reloading and Customizing D Bug12 D Bug12 should be reloaded into FLASH EEPROM when e User code has been programmed into FLASH EEPROM and it is desired to restore D Bugl2 as the boot program e Upgrading to a newer version of D Bug12 e Modifying the D Bug12 startup code or customization data E 5 1 Obtaining D Bug12 Upgrades Upgrades to D Bug12 are made available for electronic downloading S record files containing the latest version may be obtained from http mot sps com E 5 2 Reloading D Bug12 Whether reloading D Bug12 from an upgrade file or from the file shipped with the EVB package on the IASM12 diskette the S record file requires editing before programming it into FLASH EEPROM This is necessary to remove the S records containing the bootloader and vect
147. www freescale com Freescale Semiconductor Inc Table of Contents User s Manual Section 4 Hardware Reference 4 1 o AAA 4 2 Printed Circuit Board PCB Description 4 3 Configuration Headers and Jumper Settings lA Power Input Circuitry socorrer 4 5 Terminal IME EE ER 4 6 Eet E PT aS 4 7 LIE LB Fas cob P EQ PERRA REEP RC CR EPEPA I QS 4 8 o m C eee 4 9 Low Voltage Inhibit LVD NEEN NEE EEN sora 4 10 Background Debug Mode BDM Interface 211 Pope DEOR escroc dos xh Cie PCR PED AERE T J12 NEEN AAA By BNODONADOS ono ripear rr pagans Appendix A S Record Format AA Boo A OCA hens cod d opa ees Mc Pd AO Recordi AMA Ted UNETE NALE T HR A COMME 77 0009 0 LM BOO Seen Beane AA A 6 1 sU Header RECON 64 bed REP nord A 6 2 iJ Ol o PPP A 6 3 S9 Denunadon BOOD Lau dessus vase t Eas vii b vs A 6 4 ew AA M68HC12B32EVB Evaluation Board Rev 1 8 Table of Contents For More Information On This Product Go to www freescale com MOTOROLA Freescale Semiconductor Inc Table of Contents Appendix B Communications Program Examples Bl TUE AA II EEO DREE 117 Hi TOO I se ewe OTRPETOSRETECEC ERR KFUL ETESEESN 118 B 3 Procomm for DOS IBM Ploocosorisasrrsiorsrararoeos e 118 B 3 1 ada EE EE 118 B 3 2 S Record Transfers to EVB Memory ENEE 120 BA Kermit for DOS IBM PC Lcacceaaeu ehh EE SE KEEN 120 B 4 1 SUN Ee EE rer 120 B 4 2 S Record
148. y In general anywhere the assembler expects a numeric value in the operand field either a decimal or hexadecimal value may be entered Decimal numbers are entered as signed constants having a range of 32 768 to 65 535 A leading minus sign indicates negative numbers the absence of a leading minus sign indicates a positive number A leading plus sign is not allowed Hexadecimal numbers must be entered with a leading dollar sign followed by one to four hexadecimal digits The default number base is decimal For all branching instructions Bcc LBcc BRSET BRCLR DBEQ DBNE IBEQ IBNE TBEQ and TBNE the number entered as the branch address portion of the operand field is the absolute address of the branch destination The assembler calculates the two s complement offset to be placed in the assembled object code The operand format used by the disassembler is described separately in the CPUI2 Reference Manual Rather than describing the numeric format used for each instruction some general rules are applied Exceptions and complicated operand formats are described separately All numeric values disassembled as hexadecimal numbers are preceded by a dollar sign to avoid being confused with values disassembled as signed decimal numbers M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc
149. ytes follow Address pe 4 character 2 byte address field zeroes M68HC1 2B32EVB Evaluation Board Rev 1 114 S Record Format MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc S Record Format S Record Example Table A 4 SO Header Record Continued A 6 2 First S1 Record S Record er Field Entry Description Descriptive information identified these S1 records Code Data 48 ASCII H 44 D 52 R HDR Checksum 1B Checksum of SO record The first S1 record is described in Table A 5 Table A 5 S1 Header Record S Record i oir Field Entry Description Tung S1 S record type S1 indicating a code data record yp to be loaded verified at a 2 byte address Record Hexadecimal 13 decimal 19 indicating 19 L 13 character pairs representing 19 bytes of binary ength data follow 4 character 2 byte address field hexadecimal Address 0000 address 0000 indicates location where the following data is to be loaded Opcode Instruction 28 5F BHCC 0161 24 5F BCC 0163 Code Data 22 12 BHI 0118 22 6A BHI 0172 00 04 24 BRSET 0 04 012F 29 00 BHCS 010D 08 23 7 BRSET 4 23 018C Checksum 2A Checksum of the first S1 record The 16 character pairs shown in the code data field of Table A 5 are the ASCII bytes of the actual program M68HC12B32EVB Evaluation Board Rev 1 U
Download Pdf Manuals
Related Search
Related Contents
FX Positionining Control Systems Sem título-1 LMMpro User`s Manual version 1.xx Acco 62395 wrist rest Directriz 07 - Dirección de Laboratorios de la Sede Bogotá 電子書籍の流通・利用・保存に関する調査研究 Copyright © All rights reserved.
Failed to retrieve file