Home

M68EVB912B32 Evaluation Board User`s Manual

image

Contents

1. 2 3 4 Y 5 6 7 8 PA2 2 PPO PAG VDD47 u2 VDD10 VRH PT3 PADO __ 7 _______79 36 PAP PTS PAD PPG 80 745 PAG PAD4 PP5 tah ee Bae PAS PADS 7 bag 2 VDDAD PP3 rs bag PP2 p 41 PA2 _ 2 ______ _ __ 2 pai 0 PPO egre PSt PBS 16 58 E e dr PS5 PB7 L PI 14 616 PADS 98 PADS PS7 PEG MODB PES MODA 13 Papa 55 PAD4 PDLC amp 12 prs paps 33 PDLCA e bape 53 Pab EXTAL e Papi 22 PADI PDLCO PE3 7 51 PADO VDDX 8 PEt PP6 PB 8 68 PS7 PBG 54 e Lor PS6 23 PBS PS6 PB4 22 re 65 PS4 PB3 21 bag PS4 ES VDD 20 252 PB1 1921 Fe Hes 62 PS1 PBO 18 51 67 PSO ES PB0 PSO 15k 7 26 70 PDLCG PS0 PEG MODB Era Porce BEA PDLCS 750 RESET PES MODA 25 pes 22 PDLCA PS1 Ps VDD 35 BES 74 R10 36 PDLCI 9 wis pr a RESET wie PES 35 PDLCO PEQ _________ _ 9 T 1o o iz vss VDD INPUT v CHAR 32 VSSX 14 EXTAL 33 RESET VSS M RESET 24pF Sr TAE EXTAL VSSX GND y a y XTAL GND GND 59 MC34164P GND VRL
2. 15 19 i15 External Equipment Requirement 222 2 22 224452 4 0 226 22 LO PVE edis tcd dde did ta 23 7 525525852364 485 24 1 8 SUPO 225825825156 495 ohne tan 25 Section 2 Configuration and Setup 2 1 c o See ee 27 2 2 Unpacking and Preparation 27 2 2 22522569555 ee obese bees 28 24 EVB to Power Supply 29 2 5 EVB io Terminal Comecion 46cb6554icededieds 29 2 6 Terminal Communications 31 2 6 1 Pareles 21 2 0 2 SetuP Rx RE 31 2 6 3 Host Computer 31 2 6 4 Changing the Baud 32 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Table of Contents 5 LETS Ne 5 User s Manual 3 1 3 2 ENT 3 2 2 2 2 9 3232 3 2 3 3 3 2 3 4 3 2 4 23 d 222 3 3 2 1 3 3 2 2 S53 3 3 2 4 3 4 23 3 6 3 6 1 3 6 2 3 6 3 EN Section 3 Operation _____ _ 33 35 e 93 Jump EEPROM 35 Pod Probe Mode 36 Target Types e os sitti HER ER 36 Target MCU Chatactensi
3. 116 M68HC12B32EVB Evaluation Board Rev 1 8 Table of Contents MOTOROLA Table of Contents Appendix B Communications Program Examples BI CONES 117 ear 118 Procomm for DOS 118 B 3 1 dd 118 B 3 2 S Record Transfers to EVB 120 BA 5 4 lt 4 120 B 4 1 Vor E PII ee Hee heen 120 4 2 S Record Transfers to EVB 121 Bs Kennt Sun 2 53222222 2 252 2 2449 121 B 5 1 DENS ee S PES VR ERE 121 B 5 2 S Record Transfers to EVB 122 6 MacTerminal Apple 122 B 6 1 oo e gt 122 B 6 2 S Record Transfers to EVB 123 Red Ryder Apple 124 B 7 1 cic 124 B 7 2 S Record Transfers to EVB 124 Appendix C D Bug12 Startup Code Appendix D D Bug12 Customization Data D DRE DEAS DDR DA A OE RR Ed Rd 129 D2 Customizahon Dag AUN 22222222255222422 4 404 6 129 D 2 1 C 130 0 2 2 Ps
4. 95 HIE ATO ROT 94 Operating A PERMET a 39 eas diea 141 ur 42 225554554541 canes 94 jen TT PUES 38 startup pa ERG REPE EY ease dps 125 P 21 28 35 38 terminal interface 102 tocar 141 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Index 149 252552552465 bera 24 46 DEVICE 57 58 59 60 E EEBASE 61 62 EEPROM 20 bootloader RR 136 byte erasable MAP Arad ERE PS a e 94 nk oae bese REPE See ade wd 63 136 FLASH WAP 94 low voltage protection 104 operating modes 19 20 21 28 programimit eseon aaua kia a PIOS PU MUR PE ud 65 93 136 starting execution 35 3
5. M 28 35 JUMPETS 98 connectors umm 18 PI SCIRS 232C 29 30 P2 P6 MCU 16 21 105 P5 1 29 101 DES bade aT a peed 97 W15 external 101 103 104 W16 external clock 101 103 WB bp eee ees 100 137 W9 W12 BDM 105 CPU instruction 1 48 M JES 103 Teg fa ole Qo 15 15 103 customer SUDDOTL ee das dba Udo ER ead Rd 25 D D Bug12 aborting a user program 42 command SEL sce 45 command line 43 configuration 20 28 98 CUSIOMNZAUON 129 CUSIOMMAING 142 o e boe bere tied qd eng 1322 generating user 20 93 limitations imposed
6. BE cominand dB ED ES ERIS qu bootload bootloader command BULK byte erasable defined cs cedo fee ee eee CALL comma nd i iz bE a checks m eave oe WES eee clock oh tow kee ahd eben extemal IHDI SENI C EE RE M68HC12B32EVB Evaluation Board Rev 1 Index User s Manual MOTOROLA Index 147 on board Ev P hha and end ohare and dake 103 oscillator chip and 103 j l JD 103 code firmware modification 125 129 ORE C 20 93 modifying 22225450 55 eere px n ud EX Tau REPE da 142 commands SROSISIQENQHIED meno adno s ede Vk aree ye e Seo Rel acia 91 92 ASM 47 48 49 50 BAUD gee ERR DR he ant Oe ache deg EIE S 51 52 eas wan NAT ed Ge we ed 53 54 UB qr Mm 55 unius Rc n Eder ed 56 DEVICE Jod cee eile alien eU wale dle ate Se 57 58 59 60 a ee i td te ate Sad 61 62 25 SOS rule
7. OQ User s Manual M68HC12B32EVB Evaluation Board Rev 1 88 Operation MOTOROLA 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 is 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 Bugl2 tries to interpret each S record as a command and issues an
8. 53 67 68 83 84 85 86 94 129 21 28 32 38 42 102 103 RESET command tad teen see aa 83 RM command Md bequeme 84 Geren ieu 20 RS 232C 29 30 95 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Index 153 5 S recordsa 252255 RES OU UR E 65 71 88 89 90 91 92 111 116 Settee he tree testes 21 SCI port Fate csc ecc ek eee ahd eee oe ooh ee 51 ddan zi dd d 29 limitations RR 95 USAC c 22 29 30 serial debug interface SDI 20 22 30 specifications EVB LAETI 23 TI PPS BH EG v uU Re er EP S 20 S record ocu e pex Io MURS e edge wath eR 111 CPS ANS 114 112 112 OVERVIEW ae SO header record 114 114 Sl VECO s iate ht a e em i et gus 115 SO ECOL 2 cernes dus 116 term
9. EE 63 64 65 66 67 vc 68 ected site ate eg 69 70 LOAD 71 MD ee eee ore ee are gee ake es ed 72 ceo i e deri teats 72 MM A 74 75 le ote etes seats 77 MOVE Eun atone tect edes NDW art ee 78 icm RR ERREUR eU 79 RD os oe oe eee ye 80 81 82 EI Pe HERE 83 RM 84 Ryan 85 DTE 86 87 88 VERF 89 90 communications 36 communications EVB host baud tates c codes pae eO od aid Moe ues 32 51 52 limitations eR ox enn ea cada eee as 96 ose chee ede echoes ERE 31 32 ce am eme data pix ee 29 User s Manual M68HC12B32EVB Evaluation Board Rev 1 148 Index MOTOROLA Index dads 22 31 118 configuration bre a x P Race be Es ka ed ex 125 129 142
10. 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 more 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 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 If 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 Invali
11. 68 Operation MOTOROLA 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 HELP Example User s Manual Onscreen Help Summary Continued gt HELP ASM lt Address gt 5 Disassemble next Exit assen lt CR gt lt gt BAUD lt baudrate gt ta R lt Address gt lt StartAddress gt lt ingl Set Set EndAddress lin assembler disassembler instruction nbly disassembly communications rate for the terminal Fill memory with Display Eras nti lt Address gt lt DevName L EVI EBASE Address r o n chip lt data gt user breakpoints EEPROM contents Call user subroutine at lt Address gt gt se FBULK FLOAD G lt Address gt B GT lt Address gt xecute user cod Erase ent ire lt AddressOffset gt egi ELP Display th ts D OAD AddressOf D StartAddress DW StartAddres M StartAddress CR lt gt or lt gt or lt gt lt gt MMW lt StartAddres as MM MOVE block of memory NOBR lt address
12. Ma VDD GNI VEP 69 10 59 10 VDD10 ce m s 24 GND VSSAD Woe ru VDD47 vox 78 VDDX 8 VDD GND W4 GND R8 PADI MC68HC912B32 C21 C20 C19 C18 31e VDD 0 1uF 15k PAD1 PADO m 200 EVB 4 4 4 1 p gt GND 0 1 JMP EE ik wa 1 0 POD os m co tt BDM IN VDD 2 PADO tour Y 01 3 BKGD ase VDD 15k GND 1 2 RESET Wz 1 4148 5 6 VPP it 2 2 VDD R11 we R13 47 wie 1 PES MODA PI BKGD t O O 1 2 RESET wid 15k 5 8 1 2 ee vob R12 5 d Wi PT6 ef 24 cr GND 47 OUT ws R14 DEVELOPMENT TOOLS 1 pe PEG MODB 15k Title EVB912B32 EVALUATION BOARD V GND Bize Document Number Rev GND B 63ASES0920W 5 Date Wednesday October 28 1998 Bheet 2 of 3 2 3 4 4 5 6 8 RS232 COMMUNICATIONS MAX562CAI 28 SSOP VDD VDD note side UIA gt
13. 130 D23 Initial User CFU Register 22 222 22 2225242 130 D 2 4 SYSCIk 131 D235 WEI ae es D 2 6 ieee Vul Lease Xen 132 D 2 7 EEBase and 133 D 2 8 EEPROM Erase Program Delay Function Pointer Field 133 1219 Auxiliary Command Table Entries 133 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Table of Contents 9 LETS Ne 5 User s Manual 1 2 E3 E 32 E33 E 4 ES ES 52 BE Appendix E EEPROM Bootloader CONTENTS 5225545 T treductioti Serial S Record Bootloader E dq oc ORC MOGUL q Vector Jump Table Interrupt and Reset 4 Reloading and Customizing D Bugl2 Obtaining D Bug12 Upgrades Relgading 222552284425 Customizing D Bugl2 2 csse ssh oho eR ES Glossary Index M68HC12B32EVB Evaluation Board Rev 1 10 Table of Contents MOTOROLA User s Manual M68HC12B32VB Evaluation Board Figure Title 1 1 EVB Layout and Component Placement 12 EVB Solder Side View 4 1 MC
14. Configuration and Setup EVB to Power Supply Connection 2 4 EVB to Power Supply Connection CAUTION The EVB requires a user provided external power 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 5 Larger wire could damage the connector 2 5 EVB to Terminal Connection For factory default operation connect the terminal to 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
15. MOTOROLA General Information 15 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 User s Manual 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 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 selection W7 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 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. 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 50400 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 50000 Base address of the on chip EEPROM EESize dc w 768 Size of the on chip EEPROM EEDelay dc w _EEDelay 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 CPU 12 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
17. 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 Vpp The positive power supply to a microcontroller typically 5 volts dc Vss The 0 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 User s Manual M68HC12B32EVB Evaluation Board lt RegisterName gt command ASCII oso ea eis ae ewes ASM assembler CP cewek haere dahon ae single line background debug mode BDM as user interface connector target system interface BAUD command
18. 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 A background debug development tool such as Motorola s serial debug interface SDI For more information refer to the SDI 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 General Information Functional Overview e For larger programs P amp E Microcomputer 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 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
19. Condition Code Register Bits CCR Bit Name Description Legal Values 5 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 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 V Example 7 gt 7 gt User s Manual 700 5 00 0A00 1000 SP 00 0A00 1 SP 2 SP 00 0A00 D adf7 SP 00 0A00 X 7315 1000 1000 1000 1000 Y D A B CCR SXHI 7D62 47 44 1001 Y D A B CCR SXHI 7D62 47 44 1001 X D A B CCR SXHI 7D62 47 44 1001 Y D A B CCR SXHI 7062 47 44 1001 X D A B CCR SXHI 7062 AD F7 1001 NZVC 0000 NZVC 0000 NZVC 0001 NZVC 0101 NZVC 0101 M68HC12B32EVB Evaluation Board Rev 1 92 Operation MOTOROLA Oper
20. Continued A number of M68HC11 instruction mnemonics appear in the CPU12 Reference Manual that do not have directly equivalent CPU 12 instructions These mnemonics listed in Table 3 2 are translated into functionally equivalent CPU 12 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 The 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 5 CLI EF TAP TFR A CC CLV ANCC FD TPA TFR CC A SEC ORCC 01 TSX S X SEI ORCC 10 TSY 5 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 5 None M68HC12B32EVB Evaluation Board Rev 1 48 Operation MOTOROLA Operation D Bug12 Command Set
21. EEPROM Erase Program Delay Function Pointer Field 133 Auxiliary Command Table Entries 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 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 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 CPU A accumulator Address 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
22. Example User s Manual gt DEVICE Specify Target MCU Device Continued Device 912B32 EEPROM 0D00 SOFFF 5 lash 8000 RAM 0800 SOBFF I O Regs 0000 gt DEVICE 912532 1d00 1fff 8000 ffff 800 bff 0 Device 912B32 EEPROM 1D00 1 5 lash 8000 RAM 0800 SOBFF I O Regs 0000 gt DEVICE 812 4 812 4 EPROM 1000 1 5 RAM 50800 SOBFF I O Regs 0000 gt M68HC12B32EVB Evaluation Board Rev 1 60 Operation MOTOROLA 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 EEPROM 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
23. 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 bootloader Reset and interrupt vectors 32 Kbytes on chip FLASH EEPROM User s Manual M68HC12B32EVB Evaluation Board Rev 1 94 Operation MOTOROLA Operation Operational Limitations 3 10 Operational Limitations 3 10 1 On Chip RAM 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 W2 3 10 4 Dedicated MCU Pins As used on the EVB with D Bug12 the following MCU lin
24. MOTOROLA Table of Contents 7 LETS Ne 5 User s Manual 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 412 4 13 A 1 A 4 5 A 6 A 6 1 A 6 2 A 6 3 6 4 Section 4 Hardware Reference C nr 97 Printed Circuit Board PCB 97 Configuration Headers and Jumper 98 Power Input CAG snp S PE RES 101 Nin dti kb oa 102 i rp he 102 Clock 103 a s ee ee 103 Low Voltage Inhibll L 104 Background Debug Mode BDM 104 PIOIOLVDE aa bins ERO cheese cadet eed dikes RE PCR gt 105 eI eq er dud uxo d a A 105 E EET 107 Appendix S Record Format EIS ene don Be s d 111 IU QU 111 t 111 gt 113 S Record EE 114 PNE CT 114 SO Header Record 114 Pues as reris DIEN 115 S9 Termination Record 116 ASCI
25. X XM H Y A IM N B Z D V M68HC12B32EVB Evaluation Board Rev 1 70 Operation MOTOROLA Operation D Bug12 Command Set Load S Record File LOAD Syntax LOAD lt AddressOffset gt Send File Where lt AddressOffset gt 15 optional 16 bit hexadecimal number Send File is 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 Providing 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 is 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
26. lt BAUDRate gt 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 Restrictions Because the lt BAUDRate 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 supplied 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 Example 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 BF Block Fill Syntax lt StartAddress gt lt EndAddress gt lt Data gt Where lt StartAddress gt isa 16 bit hexadecimal number lt EndAddress gt 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 mem
27. 0 3308 R4 1 3 6 2k t za TG 56 Vt C5 4 2 V SHDN 55 2 10 T c2 VDD 171 lt TT1 45 ig 120 lt 5 c2 23 BO ke ur FR R5 be d k 22 Ril gt TR10 7 15k A 51 82 gt T R20 Pg 20 83 gt T R30 Fg Ral gt T R40 34 ST RO Fe lt 0 68uF 0 01uF EN GND RXD m MAX562 gt Pso 1 t 5 TX 1 3 o7 za TG oF T 5 26 V C18 Hi5 gt V SHDN a 51 1 C24 P 0 C i 16 120 lt TT2l 13 23 130 lt TT3l Fs 25 5 wis oi SERIAL TO TERMINAL 21 P gt T R20 8 1 2 20 83 gt R30 r 19 gt T R40 A5 m 14 gt 5 757 EN GND R2 MAX562 as MAX562CWI 28 SO DEVELOPMENT TOOLS Title EVB912B32 EVALUATION BOARD NOTE POPULATE EITHER MAXIM DEVICE BUT NOT BOTH Size Document Number Rev B 63ASE90920W 5 Date of 3 Wednesday October 28 1998 Bheet 7 User s Manual M68HC12B32EVB Evaluation Board A 1 Contents A 2 4 AS A 6 A 6 1 A 6 2 6 3 6 4 A 2 Overview Appendix A S Record Format 445 be eG SESE SEES 111 4 eda ha Sk ERR EY NOS doe d CX RO
28. 2 2 3 2 3 2224 22 54 22 22 3 2 3 4 3 2 4 22 4 3 1 33 2 2227 2222 3 3 2 4 3 4 2 2 3 6 3 6 1 3 8 2 3 6 3 3 7 Section 3 Operation dolo o Gn eo wi eed ened ob 33 EVB 6 445 gt 4255 5 lt 5 ERE TAA EE EPA TE dS 35 lutp BEPRUM Mode isse so Ee eT 35 Pod Probe Mode Lis i gu ke dt died 36 Target Types Supported 36 Target ste 37 Programming the Target s 37 Controlling Target 37 Bootload NIGUB 37 CUM T M 38 aseo ka eR INVE 38 Operating Procedures Cede a ke res ui 39 EVYE AAT E ERE 29 Jutop BEPRONM MOUS 40 Cm 40 Mode EP E RAS 42 RON 42 Pinon User Program Lasse ehh E Pre E ER 42 Using D Bug12 Commands 43 Command Line a ues cw 43 Entering AE ERES 43 Command Set 2144265 s406es 45 L Buglz Command Sel i2ucisactsesxbriibhe 46 ASM Assemble 47 BAUD Set Bund Ra
29. 255 56 5 6 29 30 P2 P6 MCU 55 16 21 105 5 29 101 packing SE case nipote dio oo ede oer Rd hdd dO Geese ae 27 Dod mde osos ds eX eee CE ER RE Ein REA da ias Rs dd RS 36 40 power distribution 2 106 107 indicator ebd qax doge Sand Max ed 18 input circuit and 101 input connector 29 low voltage inhibit 104 supply connecting 10 2 0 cate uer ed Hee 29 supply 22 23 printed circuit board 157 E e 97 l uc 18 19 program Abort doo beso POUR Hd ss 21 67 95 PLOW DC ghee 21 105 R RAM 20 EUH oci 94 rp EUER 93 102 command 259244 oie des 80 record ENE Gee ae ode oun VERS EE 111 record type Seen bee SS e 111 REGBASE command 81 82
30. 800 R gt MD_1000 1000 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 5 gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 67 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 begins 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 5 gt 820 R gt Temporary Breakpoint Encountered PC SP X Y D A B CCR SXHI NZVC 0820 09 057C 0000 00 00 1001 0100 0820 08 INX S M68HC12B32EVB Evaluation Board Rev 1
31. Bug12 commands BULK LOAD FBULK and FLOAD For details refer to 3 7 D Bug12 Command Set 3 2 3 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 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 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 Configure the EVB if required See 2 3 EVB Configuration 2 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
32. EEPROM D Bugl2 Upon reset D Bug12 sign on banner and prompt should appear on the terminal s display like this D Bugl12 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 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 e 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 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 hos
33. Input Edge F7DA FFDC Pulse Acc Overflow F7DC FFDE Timer Overflow F7DE FFEO Timer Channel 7 F7E0 FFE2 Timer Channel 6 F7E2 FFE4 Timer Channel 5 7 4 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 M68HC12B32EVB Evaluation Board Rev 1 140 EEPROM Bootloader MOTOROLA 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 Bug12 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 vectors which re
34. 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 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 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 configuration 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
35. Reference MOTOROLA Hardware Reference Clock Circuitry Table 4 2 CPU Mode Selection BKGD mou LONE Mode Description 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 1 1 0 Reserved currently defaults to peripheral mode 4 7 Clock Circuitry 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 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 103 Hardware Reference 4 9 Low Voltage Inhibit LVI Low voltage inhibit 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
36. Usd ROE 93 3 8 1 DOG de SLE APER 94 3 9 2 Memory Na 94 310 Operational LAWNS 14 uersa add 95 225549594 ETATE Er VOR 95 3102 BEPRERUM 95 SAB Sel Pom Usage 95 3104 Dedicated 8 255 52 25 55 556 59845 5569 95 310 5 96 M68HC12B32EVB Evaluation Board Rev 1 34 Operation MOTOROLA Operation Operating Modes 3 2 Operating Modes NOTE 3 2 1 EVB Mode The EVB can operate in one of four jumper selectable modes e EVB mode Either D Bugl2 or the user code in FLASH EEPROM executes e Jump EEPROM mode User code in byte erasable EEPROM executes 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 EVB mode the M68HC12B32EVB cannot fully emulate 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 ope
37. W3 and W4 accordingly See 2 3 EVB Configuration and 3 2 Operating Modes 3 Connect the EVB to the external power supply See 2 4 EVB to Power Supply Connection 4 Connect the EVB to the terminal See 2 5 EVB to Terminal Connection 5 Configure the terminal communications interface See 2 6 Terminal Communications Setup 6 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 7 Reset the EVB by pressing and releasing the on board reset switch S1 User s Manual M68HC12B32EVB Evaluation Board Rev 1 38 Operation MOTOROLA Operation Startup 3 3 2 Operating Procedures After starting the EVB in accordance with 3 3 1 Startup Procedure follow the operating procedure for the EVB mode that was selected EVB pod or bootload mode These procedures are described in the following subsections 3 3 2 1 EVB Mode 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
38. 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 Operation D Bug12 Command Set Stop Execution on Target MCU STOP Syntax STOP When operating in D Bug12 s pod mode the STOP command 15 used to halt target program execution and place the target processor in active background debug mode Restrictions 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 Example S ASM 4000 4000 LDD 5 4003 830001 SUBD 50001 4006 26FB BNE 4003 4008 20F6 BRA 4000 400A 00 BGN
39. bootloader s prompt S records already loaded into FLASH EEPROM are unaffected by the missing 59 record reprogramming is not necessary If a FLASH EEPROM location fails to program properly the message Not Programmed is displayed and 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 SFF 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 EEPROM Bootloader Vector Jump Table Interrupt and Reset Addresses This process is repeated until the bootloader receives end of file 59 record from the host computer If no S9 record is received the bootloader contin
40. cut jumps for Reset Extal Change SW1 11 1 96 GROUND IS APPLIED TO PIN 4 OF ALL 8 PIN IC s PIN 7 OF ALL 14 PIN IC s PIN 8 OF ALL 16 PIN 5 Added jumps to W5 W6 W10 W11 W15 and W16 IC s PIN 10 OF ALL 20 PIN IC s ETC 12 17 96 hanged all 47K Ohm resistors to 15K Ohm 8 DEVICE TYPE PIN NUMBERS AND REFEREN DESIGNATOR OF GATES ARE SHOWN AS FOLLOW 1407 7407 DEVICE TYPE 1 AND 2 PIN NUMBERS REFERENCE DESIGNATORS 4 RESISTANCE VALUES ARE IN OHMS 5 RESISTORS ARE 1 4 WATT 5 6 CAPACITANCE VALUES ARE IN MICROFARADS GND P mm 5 2 VDD PWR TERMINAL m6 4 V V GND GND R9 t n VPP d 10 _ 47uF NOTE 0 1uF y After PCB DRCs have been done MANUALLY GND GND place cut jump on W5 W6 W10 W11 W15 GND AND W16 n DEVELOPMENT TOOLS Title EVB912B32 EVALUATION BOARD Bize Document Number Rev B 63ASE90920W 5 COMPUTE ENERATED DRAWING DO NOT REVISE MANUALLY Wednesday October 28 1998 Sheet of 3 1 2 3 4 6 8
41. dens ots 140 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA List of Tables 13 List of Tables User s Manual M68HC12B32EVB Evaluation Board Rev 1 14 List of Tables MOTOROLA User s Manual M68HC12B32EVB Evaluation Board 1 1 Contents 1 2 1 3 1 4 L3 1 6 1 2 1 8 1 2 Introduction Section 1 General Information AIG PTT ES 13 General Description and rr Rn 15 Functional Oveni W aH COR EA os 19 External Equipment 22 es 23 Typographic ER ede X esse 24 LOI SUPP oa a9 23 This 5 manual provides necessary information for using 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 MCU timing and input output circuitry the EVB simplifies user evaluation of prototype hardware and software M68HC12B32EVB Evaluation Board Rev 1 User s Manual
42. gt D Display all EGBASE Address SS fset gt lt gt gt 5 gt lt StartAddress gt lt Re CPU gt 5 ESET Reset tar Modify CP lt get Stop lt count gt PLOAD isplay ontents Register CCR Statu lt StartAddress gt lt lt AddressOffset gt Name 5 gt 1 EndAddress gt EndAddress Modify Memory move 11 registers e C PU U Register Contents target CPU Trace count instructions EndAddress Register Name Register Value Bugl2 command su Load S Record Examine Modify next Examine Modify sa Examine Modify previous location Exit Modify Memory command Modify Memory Words mma Memory Me Bytes me t base address of Set regis S in lt Address gt lt Address gt isplay select add target device 1 t base address of on chip target Flash contents Load S Records into target Flash n continue execution of user code Set temporary breakpoint at Address amp ry EEPROM to memory Display mory Display Words Bytes location location same subcommands EndAddress lt DestAddress gt Move a Breakpoint s I O registers S Record Memory Verify S Records against memory ter contents S 5 SP
43. 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 programs 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 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 User s Manual M68HC12B32EVB Evaluation Board Rev 1 118 Communications Program Examples MOTOROLA 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 E
44. 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 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 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 completely erased by using the BULK command before using the EVB in pod mode again Erasing the on chip EEPROM causes 12 to reinitialize the device table with the two default MCU devic
45. 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 e MC34164P 5 4 5 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 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 interface may serve in two ways As the probe interface through which host EVB in pod mode controls a target system see 3 2 3 Pod Probe Mode 5 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 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 Vs
46. 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 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 Operation D Bug12 Command Set Modify 16 Bit Memory Word Continued MMW Example gt 800 0800 0020 lt CR gt 0802 0008 55 0804 843F 0802 55 lt CR gt 0804 843 lt CR gt 0806 gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 77 MOVE Syntax Restrictions Example User s Manual Move Memory Block MOVE lt StartAddress gt lt EndAddress gt lt DestAddress gt Where lt StartAddress gt 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 ano
47. 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 customized 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 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 ENTER lt filename gt gt 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 ex
48. the S record file to be transferred 4 Click on Send NOTE 5 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 User s Manual M68HC12B32EVB Evaluation Board 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 50000 PORTE equ 0008 MAP_PAGE DDRE equ 0009 MAP_PAGE PEAR equ 000a MAP_PAGE ODE equ 000b MAP_PAGE INITRG equ 0011 MAP_PAGE INITEE equ 50012 PAGE COPCTL equ 50016 PAGE CSCTLO equ 003c MAP_PAGE CSCTL1 equ 003d MAP_PAGE CSSTRO equ 003e MAP_PAGE PORTAD equ 006f MAP PAGE EEMCR equ 500 0 PAGE BPROT equ 500 1 PAGE FEELCK equ 500 4 MonRAMStart equ 0A00 onRAMSize equ 50200 RAM START equ 0800 RAMSize equ 0400 STACKTOP equ RAM_START RAMSize Stack at top of internal RAM EE START equ 0d00 EEPROM located here out of reset M68HC12B32EVB Eval
49. 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 ASM User s Manual Assemble Instructions Continued For all branching instructions Bcc LBcc BRSET BRCLR DBEQ DBNE IBNE TBEQ and 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 Operation D Bug12 Command Set Set Baud Rate BAUD Syntax BAUD
50. 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 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 Configuration and Setup 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 cables are available for this purpose Table 2 2 RS 232C Interface Cabling EVB P1 Terminal Pins DTE Signal Plug Receptacle Receptacle DB 9 DB 25 DB 9 DB 25 2 Receive data RXD 2 2 3 3 3 Transmit data TXD 3 3 2 2 5 Ground GND 5 7 5 7 1 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 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 t
51. 0 7 5 800 87f 0800 AA 04 37 6A 00 06 27 F9 35 78 OD B7 56 78 20 7j 5 x Vx 0810 36 27 35 27 35 90R 27 F9 35 BE B5 28 6 54 5 54 0820 27 F9 35 D6 37 8 00 OF 37 82 01 OA 37 36 FF FO 5 7 7 76 0830 7C 10 37 00 00 37 00 OF AA 5 02 37 BO 7 7 0840 00 OF 27 78 37 00 06 27 F9 35 78 27 F9 35 56 x7j 5x 5V 0850 78 7 10 78 37 86 00 DC 27 F9 35 48 78 57 x x 1 5bHxW 0860 37 86 00 DE F5 01 EA 09 37 B5 OD OA 27 F9 36 2A 7 arora 0870 5 00 37 65 00 02 27 F9 35 37 9C 37 F5 02 7e 5 7 7L gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 72 Operation MOTOROLA Operation D Bug12 Command Set Display Memory as 16 Bit Word MDW Syntax MDW lt StartAddress gt lt EndAddress gt Where StartAddress 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 St artAddress gt parameter is
52. 1 1 lists the EVB specifications Table 1 1 EVB Specifications Characteristic Specifications MCU MC68HC912B32 MCU I O ports HCMOS compatible BDM in and out 2 row 3 pin headers Communications port RS 232C DCE port Power requirements 16 MHz clock source 2 7 to 5 0 Vdc 100 mA max For low voltage operation refer to 4 9 Low Voltage Inhibit LVI Prototype area Area Approximately 1 5 inches x 3 inches 3 8 cm x 7 6 cm Holes Approximately 15 wide x 31 high on 0 1 inch 2 54 mm centers Board dimensions 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 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 5 This option displays an Exit Application confirmation message This new filename replaces the NONAME 1 in the title bar FILES 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 res
53. 12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 79 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 gt prompt is displayed Example SP X Y D A B CCR SXHI NZVC 0206 O3FF 1000 3700 27 1001 0001 gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 80 Operation MOTOROLA Operation D Bug12 Command Set Specify Target EEPROM Register Address REGBASE Syntax REGBASE lt Address gt Where lt Address gt 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 chip EEPROM will not operate properly When operating in EVB mode the default register base address is specif
54. 16 General Information MOTOROLA General Information General Description and Features Firmware features include D Bug12 monitor debugger program resident in on chip FLASH EEPROM electrically erasable programmable read only memory Full support for either dumb terminal or host computer terminal interface Single line assembler disassembler File transfer capability from a host computer to RAM or EEPROM allowing off board code generation 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 General Information M68HC12B32EVB PROTOTYPE AREA P5 INPUT VDD aj L 1 1 BOWE z R GND C17 R12 W9 BDM OUT MOTOROLA INC 1996 Figure 1 1 EVB Layout and Component Placement User s Manual M68HC12B32EVB Evaluation Board Rev 1 18 General Information MOTOROLA General Information Functional Overview v HIT 1 N 592 aay PROTOTYPE AREA C19 PS1 PSQ PEt 0 BS Beo PE2 ae 3 D ee C18 PS7 PS6 RESET LE YOD GND PDC PEG C21 Pas al PDLC PDLC3 ii PDLC1 U RESET WDD We ws PBS Pela 711 2227 PP6 O9Naw 55 09 95 55 22422922 gt 0 0o N Figure 1 2 EVB Solder Side View 1 4 Functional
55. 4 6 47 4 8 4 9 4 10 4 11 4 12 4 13 Section 4 Hardware Reference Printed Circuit Board PCB 97 Configuration Headers and Jumper Settings 98 Power Input oon eee bb GER cree PAX nen 101 Tommal iw E Io doe RO 102 hoe ciini o ach 102 ca daos dro ERR 103 Mm 103 104 Background Debug Mode BDM 104 PINS BUB EE ROCK ER HERO dob gt 105 2 5 105 oia rro eee es 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 Subminiature D connector for the RS 232C interface External power supply connections M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Hardware Reference 97 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 Factory installed headers are those most likely to be used for configuration without major alteration of the EVB s hardware operation These headers are po
56. 5 PS6 7 8 PS7 Vp 9 10 PDLC6 PDLC5 11 12 PDLC4 PDLC3 13 14 PDLC2 PDLC1 15 16 PDLCO Ves 17 18 PP7 19 20 PP6 P3 Figure 4 1 MCU I O Headers P2 and P3 User s Manual M68HC12B32EVB Evaluation Board Rev 1 106 Hardware Reference MOTOROLA 4 13 Schematics M68HC12B32EVB Evaluation Board Rev 1 PB3 1 PB5 3 PB7 5 PE6 MODB 7 PE4 9 11 EXTAL 13 15 PE1 17 19 PP3 3 5 PD 7 PT2 9 11 13 PT6 15 BKGD 17 PB1 19 P4 P6 n Hardware Reference Schematics PB4 PB6 PE7 PES MODA Vssxso RESET XTAL PE2 PEO 1 PP2 PPO PT1 Vppto PT3 PT5 PT7 PBO PB2 Figure 4 2 MCU I O Headers P4 and P6 The schematics are available here for your reference User s Manual MOTOROLA Hardware Reference 107 7 2 4 Y 6 7 8 NOTES UNLESS OTHERWISE SPECIFIED REVISIONS 1 VCC PIN LOCATIONS EVB 9 1 2 B 3 2 VCC IS APPLIED TO PIN 8 OF ALL 8 PIN IC s 1 MC68HC912B32 EVALUATION BOARD AS DATE PIN 14 OF ALL 14 PIN IC s PIN 16 OF ALL 16 PIN IC s PIN 20 OF ALL 20 PIN IC s ETC EVALUAT I ON BOARD 2 ADD VRH LPF 5407 BYPASS CUT JUMPERS 10 4 96 3 Remove Socket jmprs new rs 232 10 18 96 2 GROUND PIN LOCATIONS 4 hdd
57. 7 136 i a 93 102 EPROM 545 cody see needa aun red qune neces eens 20 evaluation board ba ERREUR ERR ES X PP ER REA 15 EVB component 18 s 28 98 description Meiers oes E RI eee 15 97 SEG RR RP ESSER SEK eee eee es ed RS 15 cote EUER 19 functional OVBEVIEW Gess rede teras sw FRIES E E px T qua d e a qnn 19 operating instructions iier ices 254555655 ener acerca seen dd 38 operating modes bootload te ann e Deed 37 42 35 39 jump EEPROM RR ERR RE E IAE 35 40 36 40 operating 39 packing list 22624342456 ices 27 23 startup 38 27 EVB 35 39 examples 114 M68HC12B32EVB Evaluation Board Rev 1 Index MOTOROLA Index F FBULK 63 64 hl transfers seno oh bole EE we urs ER Reds 71 93 118 136 ees e q
58. 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 501 50700 080 18FF TRAP SFF 0811 183FE3 ETBL lt Illegal Addr Mode gt PORTS 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 separately 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
59. B0037B500C137FAFA003715379C01 1230440F50F379D37BC012C37BD400085009A003C023D02377C0140B6EE7A0F400037B583 123046000033 7FAFA4C37FAFA5037FAFA5437B5502037FAFA4E37B5302037FAFA5237B58A 1230480682037FAFA5637BD014037BC000095008A003C023D02377D0172B6EE37BD017259 12304A037BC020095008A003C023D02377D0185EB6EE27F937B0F50F379C37BCOO0CE27F901 12304C000FC27F9104C27F90E68378000BE0A0D442D42756731362056312E3033202D20E3 12304E04465627567204D6F6E69746F7220466F7220546865204D363848433136204661ED 12305006D696C790A0D2 8432 92031393932204D6F746F 72 6F 6C612053656D69636F 6E 64BD 12305207563746F7220496E632E000037B5FF0237FAFA4837B578B037FAFA4A7AO0F005E52 12305400000000000000000020002040208020C021000000000000000000000000002144F 12305600000000000000000000000000000000002187A0F 3BAC7A0F 3BBC7A0F11E87A0F 62 12305803C727A0F3C847A0F3C967A0F3CA8F50F379C379D379E27FAF50F37 9F37BF43FCE8 12305A07501177A4054173540523604361C27F90088B0D637BCO1BC360227F70A0D3E00A9 12305 04500 70427 936 3 01 0 027 7277537 400017 405027 936 780 60477 12305E027F936A0274A27F77803B6FEB03A7808B6162776B7DE3730000127F93686752002 9030000FC V ca
60. D gt S G 4000 R gt STOP Target Processor Has Been Stopped 5 X Y D A B CCR SXHI NZVC 4003 0A00 0000 0000 SU 1101 0000 4003 830001 SUBD 50001 5 gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 85 T Syntax Restrictions User s Manual Trace T Count Where Count 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 instructions Bcc 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 sy
61. EPROM 65 G Go Execute a User Program 67 GT TETTE 68 HELP Onscreen Help 69 LOAD Load S Record PUB 71 MD Memory Display DD T2 MDW Display Memory as 16 Bit Word 73 MM Memory Modify Loud sx eee 74 MMW Modify 16 Bit Memory Word 76 MOVE Move Memory 1 78 NOBR Remove 555442295555 Gaus 79 RD Register Display 224 losa ERR 80 REGBASE Specify Target EEPROM Register Address 81 RESET Reset Target MCU oui nao 83 RM Register Modif 84 STOP Stop Execution on Target MCU 85 T j 86 UPLOAD Display Memory S Record Format 88 VERF Verify S Record File Against Memory 89 RegisterName Modify Register Value 91 3 8 Code 93 3 9 tuom o TP 93 3 9 1 ego PCR 94 392 Memon er UPPER 94 3 10 Operational Limitations 95 SUE quias 95 102 EEPROM EACH 95 SS sl 0 eer se 95 3104 Dedicated 95 3105 1 96 M68HC12B32EVB Evaluation Board Rev 1 User s Manual
62. K KKK Ck ck ck KK KKK KKK KK KKK KKK KKK 5 gt M68HC12B32EVB Evaluation Board Rev 1 66 Operation MOTOROLA Operation D Bug12 Command Set Go Execute a User Program G Syntax lt Address gt Where lt Address gt 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 wipes 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 Gcommand cannot be issued when the R gt prompt is displayed indicating that the target system is already running a user program Example 5 gt
63. M68HC 12B32EVBUM D October 1999 M6BHC 12B32EVB EVALUATION BOARD USER S MANUAL AA MOTOROLA 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 logo are registered trademarks of Motorola Inc MCUez is a trademark of Motorola Inc Apple Macintosh MacTerminal and Sy
64. ROM 51900 1 Flash 8000 SFFFF 1000 FF FF FF FF FF FF FF FF FF FF FF FF FF 5 gt M68HC12B32EVB Evaluation Board Rev 1 62 Operation MOTOROLA 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 EVB mode the FBULK command cannot be used If the FBULK command is entered while in EVB mode an error message 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 s
65. Restrictions When operating in pod mode the LOAD command does not support standard baud rates above 38 400 This 1s 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 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 displays 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 800 0800 04 37 6A 00 06 27 F9 35 78 OD B7 56 78 2
66. 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 51 record in Table 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 User s Manual M68HC12B32EVB Evaluation Board Appendix B Communications Program Examples B 1 Contents B 2 3 3 1 3 2 4 4 1 4 2 5 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 117 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
67. U I O Headers P2 and 4 2 MCU I O Headers and M68HC12B32EVB Evaluation Board Rev 1 List of Figures User s Manual MOTOROLA List of Figures 11 List of Figures User s Manual M68HC12B32EVB Evaluation Board Rev 1 12 List of Figures MOTOROLA User s Manual M68HC12B32EVB Evaluation Board List of Tables Table Title Page i EVB es oo 23 2 1 EVB Starup Mode JUMP fS rris 4er E RASSE TREES 28 5952321 Interlace CA 30 2 5 Communication ae estes 31 3 1 D Bugl2 Command Set Summary 45 3 2 to CPU12 Instruction Translation 48 29 C ommand Line dirie Tr TIRONE 58 24 eee RARE EC en 91 3 5 Condition Code Register 91 3 6 Factory Configuration Memory 94 4 1 Jurper electable FPurctoHS 99 53 LPL MOSG oe eo ode Hee Ghee 103 43 BDM Connector 15 Pin 105 Polo eee Pi 112 Secor Field Cones 112 PO TODO Lea oe _ __ 113 SU Header Record 114 AS i lis 116 Bel Vector lump Table non
68. User s Manual MOTOROLA Operation 93 3 9 1 Description The monitor program D Bug12 occupies the 32 Kbyte FLASH EEPROM area of the MCU s memory map To use the FLASH EEPROM area for custom programs refer to Appendix E EEPROM Bootloader When operating in EVB mode D Bug12 requires 512 bytes of on chip RAM from 0A00 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 NOTE 12 sets the default value of the user s stack pointer to 0A00 This is not mistake The M 8HCI2 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 M6SHC12 Family first decrements its stack pointer then stores data on the stack The 68 11 Family stores data on the stack and then decrements its stack pointer 3 9 2 Memory Map The information in Table 3 6 describes address ranges and locations Table 3 6 Factory Configuration Memory Map Address Range 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 FFBF
69. 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 Hardware Reference Power Input Circuitry Table 4 1 Jumper Selectable Functions Sheet 3 of 3 Diagram Setting Description W10 Connection to BDM Out o u 1 2 Connects Vpp to BDM out pin 6 Cut BDM out pin 6 open W11 Reset Connection to BDM Out 1 2 Connects MCU generated reset PT6 to BDM out pin 4 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 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 Hardware Reference 4 5 Terminal Interface RS 232C tr
70. 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 D 2 4 SysClk Field NOTE 0 2 5 Field NOTE 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 target s CCR is set to Oxd0 The stack pointer is set to one byte beyond the end of the target system s RAM 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
71. ample Then follow these steps 1 Inashell window invoke Kermit by typing kermit ENTER 2 Setthe serial port to the one in use for the EVB ttya 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 EVB by pressing 51 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 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 her
72. ansceiver U1A or U1B links the MCU s serial communications interface to the RS 232C DB 9 receptacle The communications parameters for this port are described in 2 6 Terminal Communications Setup 4 6 Microcontroller The 68 912 32 is one of the first of a family of next generation M68HC11 microcontrollers with both on chip memory and peripheral functions The CPU12 is a high speed 16 bit processing unit The programming model and stack frame are identical to those of the standard M68HC11 CPU The CPU 12 instruction set is a proper superset of the M68HC11 instruction set All M68HC11 instruction mnemonics are accepted by CPU12 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 FLASH 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 CPU12 Reference Manual Motorola document order number CPU12RM AD User s Manual M68HC12B32EVB Evaluation Board Rev 1 102 Hardware
73. are 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 S record line that begins with 5123 00 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 S record line that begins with S123F700 Replace this line and the next one S11FF720 with 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 and P bootloader procedures described in E 3 Serial S Record Bootloader User s Manual M68HC12B32EVB Evaluation Board Rev 1 142 EEPROM Bootloader MOTOROLA 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 mnemonics 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
74. 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 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 it 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 User s Manual M68HC12B32EVB Evaluation Board 3 1 Contents M68HC12B32EVB Evaluation Board Rev 1 3 2 321 2
75. assembled 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 CPUI2 instruction 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 CPU12 Reference Manual Motorola document order number CPU12RM AD M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 47 ASM User s Manual Assemble Instructions
76. at 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 500600004844521 1130000285F245F2212226A00042429008237C2A 511300100002000800082529001853812341001813 113002041E900084442234300182342000824A952 5107003000144 492 S9030000FC In the example the format consists of An 50 header e Four 51 code data records An 59 termination record A 6 1 SO Header Record 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 bytes follow Address i 4 character 2 byte address field zeroes User s Manual M68HC12B32EVB Evaluation Board Rev 1 114 S Record Format MOTOROLA A 6 2 First S1 Record S Record Format S Record Example Table A 4 SO Header Record Continued Field Code Data Checksum S Record Entry Descriptive information identified these S1 48 52 1B Checksum of SO record Description records ASCII D R The first 1 record is described in Table 5 Table A 5 S1 Header Record S Record Field Entry Description Tung 51 S rec
77. ation Off Board Code Generation 3 8 Off Board Code Generation Code developed outside the EVB environment should be generated with an M68HC12 compatible assembler C compiler that can generate object files in S record format The recommended assembler P amp E Microcomputer 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 e Into a target 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
78. bS lt 5 2244244440604 37 Programming Target s 37 Controlling Target EXGCIUUON 37 2 i saniki 37 38 2 5555 824 38 Opening 39 EYB Ie 39 Jump BEPRUM 2 58555555659 55 55 earras 40 Node 40 _ 42 re ee ee eee ee ere 42 Aborting User Pr heen sees oases 42 Using D Baepgl2 Commands a x EEG 43 Command Line Prompt 2252242425 43 Enternng Commands ca oboe pees aloes RERES DER S 43 Command Set 45 D B gl2 Command 22255 2 44 5 4555 55 945 64 46 ASM Assemble 47 BAUD su 51 BF 52 BR Breakpoint sense 53 BULK Bulk Erase On Chip EEPROM 55 CALL Call 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 Table of Contents FLOAD Program Target FLASH E
79. ble point to the table of user accessibl routines jmp 0 x the first entry is a pointer to main Sa This small subroutine is used to produce a delay of approximately 10 ms This delay is based on the following conditions i 1 8 00 E clock 2 Subroutine located in internal memory This routine is called by D Bug12 s WriteEEByte function through pointer stored in the Customization Data Table _EEDelay 1 20000 load delay count into x DlyLoop dex decrement count bne DlyLoop loop till done rus return i M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA D Bug12 Startup Code 127 D Bug12 Startup Code User s Manual M68HC12B32EVB Evaluation Board Rev 1 128 D Bug12 Startup Code MOTOROLA User s Manual M68HC12B32EVB Evaluation Board D 1 Contents Appendix D D Bug12 Customization Data D 2 521 D22 D 2 4 D 2 5 D 2 6 D 2 7 D 2 8 p 29 Customization Data Area Loca sssooseerieresrekEP ERE A d ses 129 gt ody Wa sati RE ER TER ARES Ad 130 Assembly PONE 46054642504 130 Initial User CFU Register Vanes 130 SYSLIE Me 131 S VE EET ae PRESE 131 Vul POIL o uo we qai o usc tae dev a d 132 EEBase and 133
80. clock W8 Vpp W9 W12 BDM M68HC12B32EVB Evaluation Board Rev 1 Index TP 29 102 101 103 104 iss 101 103 100 137 User s Manual MOTOROLA Index 155 User s Manual M68HC12B32EVB Evaluation Board Rev 1 156 Index MOTOROLA 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 failu
81. clock frequency using the SysC1k value The IOBase field defines the base address of the input output I O 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 IOBase is set to 0 0000 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 D Bug12 Customization Data 0 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 rate
82. 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 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 5 record
83. ctions sik ek ie hh ee dee 22 Xe eerie 23 102 MCUez assembler n RR bod nena denn ex en bei ed 21 31 MD coinmand AM XOU RENE E dances 22 MDW 73 memory address i e peru Sp LIE CS OES GROG GHEE AOS EE eee 111 EEPROM 21 22 28 55 104 EPROM ed esu Oh ee 19 limitations RR RRIRRRRRR RR RR res 95 locations o epus herr Rh VR UE RSEN G ee RP ERO ES 18 map factory default 94 E E qu 102 programin 22 microcontroller nit 15 73 MMW 76 T1 modes operating See EVB 35 Monitor 25 dus pax e 19 MOVE comm nd 2 02 35405 ere RR b EE e ERI E dg 78 N command ice see ze er wate Pape eae p Ed EX 79 operational limitations 95 103 M68HC12B32EVB Evaluation Board Rev 1 Index MOTOROLA Index Pl SCIRS 232C 5 lt
84. d 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 User s Manual M68HC12B32EVB Evaluation Board Rev 1 134 D Bug12 Customization Data MOTOROLA User s Manual M68HC12B32EVB Evaluation Board E 1 Contents Appendix E EEPROM Bootloader Be so js cope eves EE abo d REOR Oe bed he ed ts 136 E3 eral Record Bootloader 136 E 3 1 ju Beds gt 137 E32 duco TEC 138 E33 tessere 138 4 Vector Jump Table Interrupt and Reset Addresses 139 E Reloading and Customizing 12 141 EI Obtaining D Bug12 Upgrades 2222252 cvecs heu RAS 141 E52 Reloading usse RC 141 R33 Customizing DIRE e ceu sth d PES 142 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA EEPROM Bootloader 135 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 progra
85. d to regain control of the target system M68HC12B32EVB Evaluation Board Rev 1 42 Operation MOTOROLA 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 indicating 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 microcont
86. e B 6 1 Setup To set up MacTerminal on an Apple Macintosh 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 2 Communications Program Examples MacTerminal Apple Macintosh 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 Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry 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 2 3 4 At the D Bug12 prompt enter the LOAD VERF command with any parameters From the Macintosh File menu select Send File ASCII From the dialog box select the S record file to b
87. 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 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 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 D Bug12 at reset instead of the flawed user program When operating in pod mode the D Bug12 RESET or STOP command can be use
88. e transferred Click on Send NOTE 5 records are not displayed during the file transfer NOTE Following the file transfer MacTerminal sends carriage return line feed pair which D Bug12 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 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 1 or by activating the appropriate custom reset circuitry 4 Press ENTER 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 with any parameters 2 From the Macintosh File menu select Send File ASCII 3 From the dialog box select
89. ed each on chip EEPROM location is checked for an erased condition To erase EEPROM the EEPROM block protect control bits must be cleared 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 CALL Syntax NOTE Restrictions Example User s Manual Call Subroutine CALL lt 55 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 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 i
90. 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 VERF Verify S Record File Against Memory Continued Restrictions None Example gt 1000 gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 90 Operation MOTOROLA Operation D Bug12 Command Set Modify Register Value lt RegisterName gt Syntax RegisterName lt RegisterValue gt Where lt RegisterName gt 18 one of the CPUI2 registers listed in Table 3 4 lt RegisterValue gt 15 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
91. es 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 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 requirement is necessary for the FBULK and FLOAD commands to work properly M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 59 DEVICE
92. es perform specific functions If an application requires their use the EVB hardware and or operating 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 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 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 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 User s Manual M68HC12B32EVB Evaluation Board 4 1 Contents 42 4 3 4 4 4 5
93. he 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 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 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 progra
94. he background debug development tool being used This can be another M68HC12B32EVB or a tool such as Motorola s serial debug interface SDI User s Manual M68HC12B32EVB Evaluation Board Rev 1 30 Configuration and Setup MOTOROLA 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 Stop Bits 1 Parity None 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 Generation To serve
95. hip registers 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 Bug12 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 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 Bugl2 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 device name configures D Bugl2 for operation with the selected target device The default device
96. ied in the customization data variable Cust omData 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 REGBASE command may not be used when D Bug12 is operated in EVB mode M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 81 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 5 gt M68HC12B32EVB Evaluation Board Rev 1 82 Operation MOTOROLA Reset Target MCU Syntax Restrictions Example Operation D Bug12 Command Set RESET RESET The RESET command is used to reset the target 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 regis
97. ination 116 STOP command 3 694 956 6448 Gee Pes EUs SEER EEL REY 85 SWITCHES lt 21 locatons oiov dah e Mexx RAE PR RE 18 SI Oa Pie eos Ted s 42 T Tcommand done eS ome S RU ERU ah beta 86 87 target BDM interface ab Bares Pe pun 36 execution 37 rr 36 ues 37 DEDEPRIDIDIDE S o oo qud vd acr a a 37 User s Manual M68HC12B32EVB Evaluation Board Rev 1 154 Index MOTOROLA terminal rate scere LEER 2555 E P communications communications interface 555525554 RERO RE E REP Se oe ee eons Ux ese ee PPS eeu upacking instructions UPLOAD vectors jump table ess peg seeks memory Aled 252 VERF W15 external W16 external
98. ints 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 line 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 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 35ec 2 80 592 Breakpoints 35EC 2F80 C592 gt BR Breakpoints 35EC 2F80 C592 gt M68HC12B32EVB Evaluation Board Rev 1 54 Operation MOTOROLA 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 perform
99. ite once in normal modes ARSIE CDLTE NECLK LSTRE RDWE 0 0 0A ldaa 52 prevent later protection lock staa PEAR PROTLK is write once Without changing modes enable internal visibility 2 MODE SMODN MODB MODA ESTR IVIS 0 EMD EME 0B i bset ODE 08 set 5 Enable EEPROM so monitor can program erase bytes EEMCR 1 1 2 1 4 PROTLK 5 0 BPROT 1 BPROT6 BPROT5 BPROT4 BPROT3 BPROT2 BPROT1 BPROTO F1 i ldaa Sfc prevent later protection lock User s Manual M68HC12B32EVB Evaluation Board Rev 1 126 D Bug12 Startup Code MOTOROLA D Bug12 Startup Code staa EEMCR PROTLK is write once ELF BPROT allow EE program and erase Disable writing to the on chip FLASH EEPROM FEELCK 2270 2 0 YO 0 gt 70 sc LOCK 5 4 ldaa 501 write 1 to the FLASH LOCK bit to disable accidential reprogramming of staa FEELCK the FLASH memory where we re located i 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 ldd get the user supplied base address of the on chip I O registers staa INITRG re map the on chip registers _UserFnTa
100. l Information User s Manual M68HC12B32EVB Evaluation Board Rev 1 26 General Information MOTOROLA User s Manual M68HC12B32EVB Evaluation Board 2 1 Contents 2 2 2 3 2 4 2 2 6 2 6 1 2 6 2 2 6 3 2 6 4 Section 2 Configuration and Setup Unpacking 1 aie uk rd VE R3 EROR snes 27 MOREM EE 28 EVB to Power Supply 29 EVB to Terminal 29 Terminal Communications 31 Communication 21 Dymb Terminal 31 Host SONIS Lue qud 31 Changing the Baud 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 M 65HCI2B32EVB 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 a
101. le ross bh Hen deh HERI 5 BF Block Fill ERE P ER SS 52 BR Breakpoint i rias 53 User s Manual MOTOROLA Operation 33 User s Manual BULK Bulk Erase On Chip 55 CALL Call SUBIOUDUS cs cea C WERTE 56 DEVICE Specify Target MCU 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 67 GT 68 Onscreen Help 69 LOAD Load S Record 71 MD Memory Display 53250558465 EE ERROR REESE 72 MDW Display Memory 16 Bit Word 73 MM Memory Modify ssor REDE RR AES 74 MMW Modify 16 Bit Memory Word 76 MOVE Move Memory Block 78 NOBR Remove 29 RD Register stenoses 80 REGBASE Specify Target EEPROM Register Address 81 RESET Reset Taree MEU Loads RE ER 83 RM Resister Modify 22 3228 35 9 554 RA niia 84 STOP Stop Execution on Target MCU 85 T j P 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 93 39 Memory
102. m the user manual for that program must be consulted NOTE 12 supports only the 50 51 and S9 records All data before the first 81 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 51 Record containing code data and the 2 byte address at which the code data is to reside 52 58 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 59 which control is to be passed If not specified the first entry point specification encountered in the object module input 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 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 form
103. m 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 F 800 is reserved for future expansion of the bootloader Thus user code may only occupy the 30 Kbytes from 8000 to F 7FF 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 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 a
104. 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 50000 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 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 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 i
105. n EVB mode the MCU must manage the EVB hardware and execute D Bug 12 in addition to serving as 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 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 General Information EVB Specifications 1 6 EVB Specifications Table
106. n chip EEPROM Setting the value of EESi ze to 0 disables the WriteMem function s ability to write to on chip EEPROM It is 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 MC68HC912B322 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 subroutine is located in the startup code area of the D Bug12 FLASH EEPROM from F700 to F77F D 2 9 Auxiliary Command Table Entries typedef struct 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 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 D Bug12 Customization Data enum Error
107. nc Motorola Inc 1999 MOTOROLA M68HC12B32EVBUM D
108. nd Setup 27 Configuration and Setup Using D Bug12 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 static shipping bag 3 Save all packing materials for storing and shipping the EVB 2 3 EVB Configuration User s Manual 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 M68HC12B32EVB Evaluation Board Rev 1 28 Configuration and Setup MOTOROLA
109. nd 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 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 3 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 Operation Operating Modes 3 2 3 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
110. nstalled 2 pin cut trace header with default trace intact 3 pin header with no jumper installed 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 Hardware Reference Table 4 1 Jumper Selectable Functions Sheet 2 of 3 Diagram Setting Description W3 W4 EVB Mode Selection W3 0 4 0 W3 1 1 0 4 0 Jump to EEPROM mode 9 2 Pod mode Remote BDM W3 1 4 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 and MODB Refer to Table 4 2 W7 Vpp Vpp Selection 2 3 Connects MCU s Vpp pin to Vpp non programming mode 1 2 Connects MCU s Vpp pin to Vpp input header programming mode W8 Vpp Input Header 1 Vpp input 2 Ground 2 1
111. or 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 have 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
112. ord type 51 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 User s Manual S Record Format 115 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 59 Termination Record The S9 termination record is described in Table A 6 Table A 6 S9 Header Record S Record Field Entry Description Type 59 S record type 59 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
113. ory location written with lt data gt data parameter is omitted the memory range is filled with the value 00 Restrictions None Example gt BF 6400 6fff 0 gt 6f00 6fff 55 gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 52 Operation MOTOROLA Breakpoint Set Syntax Restrictions Operation D Bug12 Command Set BR BR lt Address gt lt Address gt TE 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 CPU12 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 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 breakpo
114. p x dox 11 SEO TUBE 113 3 Record CPU 532565 E Ed XX 114 aas d addu ri Ae RR ec don 114 S0 Header Record bI e CRDI eh 114 buda Rect Iesv ea EM ess 115 S9 Termination Record 116 AOGUCIIUChar ctetb 222622505 Ei E baked eee 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 Code data Checksum M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA S Record Format 111 S Record Format User s Manual Each byte of binary data is encoded in the S record as a 2 character hexadecimal number first character represents the 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 t
115. ponse Press Return gt D Bug12 prompt for next entry 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 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 Rev 1 24 General Information MOTOROLA 1 8 Customer Support General Information Customer Support 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 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 Genera
116. pulated 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 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 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 the 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 i
117. range are specified in the customization data variables CustomData EEBase and CustomData EESize Thevaluein 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 EEBASE Example User s Manual Specify Target EEPROM Base Address Continued S gt DEVICE Device 91 RAM 0800 I O Regs S gt EEBASE 2B32 EEPROM 0000 SOFFF Flash 8000 SFFFF SOBFF 0000 1d00 Device 91 2B32 RAM 50800 I O Regs S gt MM_12 0012 01 11 0013 OF S MD 1400 501 50000 EEP
118. ration 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 EEPROM starting at address 0000 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 Control can be returned to D Bug12 two ways Move jumpers on headers W3 and W4 to position 0 and reset the EVB Terminate the user program with code that returns 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 W4 1 the EVB and D Bug12 serve as a pod probe interface between a target system a
119. re 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 subsidiaries 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 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 hitp motorola com sps Mfax is a trademark of Motorola I
120. 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 User s Manual M68HC12B32EVB Evaluation Board Rev 1 144 Glossary MOTOROLA 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 language 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
121. rn 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 User s Manual M68HC12B32EVB Evaluation Board Rev 1 44 Operation MOTOROLA 3 6 3 Command Set Summary Operation Using 12 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 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 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 lt Address gt GT Address Program the target proces
122. rogram 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 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 EEPROM Bootloader E 3 2 rogram 3 3 1 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
123. roller 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 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 Command Line command parameter parameter ENTER Syntax Where command is the command mnemonic parameter 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 1 optional field ab repeated optional fields e 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 maximum of 80 characters including the terminating carriage retu
124. 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 800 0800 04 376A 0006 27F9 35AE 7800 B756 7820 sed jew VX gt MDW 800 87f 0800 04 376A 0006 27F9 35AE 780D B756 7820 eius WX 0810 B636 27F9 35AE 27F9 359E 27F9 35BE B528 SON 5s 0820 27 9 3506 37B8 000 3782 010A 3736 FFFO Vae dod 0830 7C10 3783 0000 37B6 000F AA04 A502 3786 usd A Ta 0840 000 2778 376A 0006 27F9 3578 27 9 3556 tet V Ett OOM 0850 7800 B710 783B 3786 OODC 27F9 3548 7857 x x 7 5HxW 0860 3786 OODE F501 EA09 37B5 ODOA 27F9 362 7 6 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 Syntax Restrictions User s Manual Memory Modify MM lt Address gt 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 memo
125. ry 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 verification of memory contents These subcommands have this format lt Data gt lt CR gt 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 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 runawa
126. s 3 5 ms M68HC12B32EVB Evaluation Board Rev 1 136 EEPROM Bootloader MOTOROLA 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 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 7 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 9 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 Eraseor 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 p
127. s Vss 3 No connection No connection 4 RESET input to MCU RESET output from MCU 6 5 No connection No connection 6 Vpp Vpp 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 footprints are provided for wire wrap pins 4 12 MCU Connectors Four 2 row x 20 pin 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 Hardware Reference PA2 1 2 PA3 PA4 3 4 PA5 PA6 5 6 PA7 7 8 Vss48 8 10 Vg PADO 11 12 PAD2 13 14 PAD4 15 16 PAD5 PAD6 17 18 7 Vppap 19 20 P2 PSO 1 2 51 PS2 3 4 PS3 PS4 5 6 PS
128. s 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 Bug12 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 D Bug12 Customization Data Customization Data Area D 2 7 EEBase and EESize Fields NOTE The EEBase and EESi ze 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 0 0400 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 o
129. s required because a return address is placed 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 SXHI 0820 0 00 057 0000 OF F9 1001 0000 gt M68HC12B32EVB Evaluation Board Rev 1 56 Operation MOTOROLA Operation D Bug12 Command Set Specify Target MCU Device DEVICE Syntax DEVICE DEVICE lt DeviceName gt lt EEStart gt lt EEEnd gt FStart lt FEnd gt RAMStart lt RAMEnd gt 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 lt gt is base address of the on c
130. side 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 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 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 Bugl2 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 generate S record files for the new data using an M68HC12 compatible assembler or C compiler Next prep
131. sor 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 12 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 as O Bit Worm contents in hex words ASCII format Memory Modify Interactively examine change memor aC teractively examine change memory contents Modify 16 Bit Memory Word Interactivel lt address gt lt data gt y cus 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 User s Manual MOTOROLA Operation 45 Table 3 1 D Bug12 Command Set Summary Continued Command Description RD Register Display Display the CPU register contents REGBASE Inform D Bug12 of the target I O register s base address RESET Reset the target CPU Register Modify Interactively examine change CPU register contents Stop exec
132. stem 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 User s Manual M68HC12B32EVB Evaluation Board List of Sections Section 1 General Information 15 Section 2 Configuration and Setup 27 Section 3 33 Section 4 Hardware Reference 97 Appendix S Record 111 Appendix B Communications Program Examples 117 Appendix C D Bug12 Startup Code 125 Appendix D D Bug12 Customization Data 129 Appendix E EEPROM Bootloader 135 DISSI 143 ee 147 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA List of Sections 3 List of Sections User s Manual M68HC12B32EVB Evaluation Board Rev 1 4 List of Sections MOTOROLA User s Manual M68HC12B32EVB Evaluation Board Table of Contents Section 1 General Information 1 1 Ws co rcm 15 EM o 15 1 2 General Description and
133. stem in pod mode M68HC12B32EVB Evaluation Board Rev 1 86 Operation MOTOROLA Trace Continued Example 0803 0803 gt I 3 PC 0806 0806 PC 0803 0803 PC 0806 0806 SP X 09 057C 830001 SP X 09 057C 26FB SP X 09 057C 830001 SP X 09 057C 26FB M68HC12B32EVB Evaluation Board Rev 1 Y 0000 Y 0000 BNI LH 0000 SUBD 0000 D A B 10 00 50001 D A B OF FF 50803 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 87 UPLOAD Display Memory in S Record Format Syntax UPLOAD lt StartAddress gt lt EndAddress gt Where lt StartAddress gt 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 5 123040000F0000843FC0000F50F379F37BF43FCF50F27FA757F177AFA047504177AFA21C5 123042037B500FF37FAFB0437B5400037FAFB061735F
134. t EVB serves as a non intrusive controller 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 Operation Startup If communications cannot be established with the target system after repea
135. ted 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 out is 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 5 gt target in active background mode R gt 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 setting up and using pod mode
136. ters 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 5 gt M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 83 RM Syntax Restrictions Example User s Manual Register Modify RM The REGISTER 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
137. ther 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 address 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 ee 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 Operation D Bug12 Command Set Remove Breakpoints NOBR Syntax NOBR lt Address gt 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 pod mode breakpoints may not be removed with the NOBR command when the R prompt is displayed Example gt 800 810 820 830 Breakpoints 0800 0810 0820 0830 gt NOBR 810 820 Breakpoints 0800 0830 gt NOBR All Breakpoints Removed M68HC
138. 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 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 Glossar
139. uation Board Rev 1 User s Manual MOTOROLA D Bug12 Startup Code 125 D Bug12 Startup Code CustData equ S f6c0 equ CustData l15 location of user supplied base address of I O registers equ CustDatat19 location of user supplied base address of EEPROM i xref _BootLoad _UserFnTable xdef MonStartup _EEDelay switch text INITIALIZATION The code in this section is initialization for the monitor on the EVB12B32 FRR Ree AER AR OS MonStartup lds STACKTOP initialize monitor stack pointer Disable the COP watchdog by CR2 CR1 CRO 0 0 0 COPCTL 07 when reset in normal modes FCME and CRx bits are write once in normal modes A COPCTL CME F CME FCM FCOP DISR CR2 5 1 6 i c COPCTL disable watchdog i Clear all monitor RAM to start from a known state ldx MonRAMStart ClrRAM eu sheet Clear one and inc pointer MonRAMStart MonRAMSize bne 1 loop till RAM clear Enable pipe signals low strobe and read write PIPOE NECLK LSTRE and RDWE are wr
140. ues Gobet Sead ANE P E duds 19 FLASH 5 gene 20 FLOAD command 65 66 G COMMAN oes dne ee Bg ao ans E EE EE 67 GT command 55252425505 Ee bee 68 H headers CONNECTOR 2 ue ha ee OEE eaa 97 BM SEA CAM S a Meng 98 he dee 97 98 E eee 98 HELP command 69 70 5 12 assembler 21 28 93 J jump EEPROM 35 40 JUrnper Seit mis 16 20 98 99 L limitations cosa gU Eee 95 LOAD 71 low voltage inhibit LVD 104 M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Index 151 M M68HCI2B32EVB evaluation 15 MC68HC912B32 microcontroller 15 MCU access 21 105 106 545555 o a oy eens hase cay ak SEE 102 locations ex odie we Oe 18 MOdES c 102 103 restri
141. ues 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 EEPROM unaffected by the missing 59 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 E 4 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 EEPROM Bootloader Table E 1 Vector Jump Table User s Manual Vector Address CPU Interrupt Jump Table Address Reserved F7CO F7CF FFDO BDLC J1850 F7D0 FFD2 ATD F7D2 FFD4 Reserved F7D4 FFD6 SCIO F7D6 FFD8 SPI F7D8 FFDA Pulse Acc
142. ution 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 the CPU registers UPLOAD lt StartAddress gt lt EndAddress gt Display memory contents in S record format VERF lt AddressOffset gt 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 D Bug12 prompt for next entry User s Manual M68HC12B32EVB Evaluation Board Rev 1 46 Operation MOTOROLA Operation D Bug12 Command Set Assemble Instructions ASM Syntax ASM lt Address gt Where lt Address gt 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 dis
143. with the FLOAD command M68HC12B32EVB Evaluation Board Rev 1 User s Manual MOTOROLA Operation 65 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 Bug12 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 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 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 FLOAD Flash Programming Voltage Not Present S gt ELOAD KKK KKK KKK KKK KKK KK KKK KKK KEK KKK KKK KKK KKK KKK KKK KK KKK KK KKK KKK KK KKK KK
144. xpand 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 terminal interface 6 Reset the EVB by pressing 1 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 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 IBM PC B 4 1 Setup To set up Kermit using DOS on an IBM compatible PC for use as the EVB terminal first refer to
145. y M68HC12B32EVB Evaluation Board Rev 1 74 Operation MOTOROLA Memory Modify Continued Example gt MM_800 0800 00 0801 FO 0802 00 0801 FF 0802 00 0803 08 0803 55 M68HC12B32EVB Evaluation Board Rev 1 A 9 V Hj rr l V Q V Operation D Bug12 Command Set User s Manual MOTOROLA Operation 75 MMW Syntax Restrictions User s Manual Modify 16 Bit Memory Word MMW lt Address gt 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 lt gt
146. y 143 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 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
147. ystem 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 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 5 gt gt FBULK Command Not Allowed In EVB Mode gt User s Manual M68HC12B32EVB Evaluation Board Rev 1 64 Operation MOTOROLA Operation D Bug12 Command Set Program Target FLASH EEPROM FLOAD Syntax Where Restrictions FLOAD lt AddressOffset gt lt AddressOffset gt 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 if 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 f

Download Pdf Manuals

image

Related Search

Related Contents

REDMX 1.06 USER MANUAL - Techni-Lux  リンク - スズキ  Mode d'emploi  Samsung Samsung Galaxy A3 Инструкция по использованию(Lollipop)  Pág. 006 - Licitações e Contratos - Diário Oficial    DURCHFLUSSMENGENMESSGERÄT  Productivity Solutions - Your Tire Shop Supply  Druck DPI 104-IS - GE Measurement & Control  Manuel d`utilisation Optoma EW628  

Copyright © All rights reserved.
Failed to retrieve file