background image

EEPROM BOOTLOADER

68EVB912B32UM/D

E-3

(P)rogram

In Flash programming mode, the bootloader sends an ASCII "*" (asterisk character) to the host
computer, indicating that it is ready to receive an S-Record.  The host then sends a single
S-Record and waits for the "*" prompt from the bootloader before sending the next S-Record.

This process is repeated until the bootloader receives an end-of-file (S9) record from the host
computer.  If no S9 record is received, the bootloader continues to wait for another S-Record
indefinitely.  In this situation, the EVB must be reset to return to the bootloader’s prompt
(S-Records already loaded into Flash EEPROM are unaffected by the missing S9 record;
reprogramming is not necessary).

If a Flash EEPROM location fails to program properly, the message "

Not Programmed

" is

displayed, and the bootloader’s prompt is redisplayed.

If an error occurs during programming, see the CAUTION on page E-3.  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.

(L)oadEE

This selection causes a bulk erase of byte-erasable EEPROM in the address range $0D00 -
$0FFF.  After the erase operation, a verify operation checks for proper erasure of all locations.  If
any locations were found to contain a value other than $FF, the message "

Not Erased

" is

displayed, and the bootloader’s prompt is redisplayed.

If the erase operation was successful, the bootloader sends an ASCII "*" (asterisk character) to
the host computer, indicating that it is ready to receive an S-Record.  The host then sends a single
S-Record and waits for the "*" prompt from the bootloader before sending the next S-Record.

This process is repeated until the bootloader receives an end-of-file (S9) record from the host
computer.  If no S9 record is received, the bootloader continues to wait for another S-Record
indefinitely.  In this situation, the EVB must be reset to return to the bootloader’s prompt
(S-Records already loaded into EEPROM are unaffected by the missing S9 record;
reprogramming is not necessary).

In case of errors during the 

(L)oadEE

 procedure, repeat the process several times.  If the errors

persist, it is possible that the MCU may be damaged.

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.

Summary of Contents for M68EVB912B32

Page 1: ...68EVB912B32UM D February 1997 M68EVB912B32 EVALUATION BOARD USER S MANUAL MOTOROLA Inc 1997 All Rights Reserved ...

Page 2: ...cations intended to support or sustain life or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur Should Buyer purchase or use Motorola products for any such unintended or unauthorized application Buyer shall indemnify and hold Motorola and its officers employees subsidiaries affiliates and distributors harmless ...

Page 3: ...2 3 EVB TO POWER SUPPLY CONNECTION 2 3 2 4 EVB TO TERMINAL CONNECTION 2 3 2 5 TERMINAL COMMUNICATIONS SETUP 2 5 2 5 1 Communication Parameters 2 5 2 5 2 Dumb Terminal Setup 2 5 2 5 3 Host Computer Setup 2 5 2 5 4 Changing the Baud Rate 2 6 CHAPTER 3 OPERATION 3 1 OPERATING MODES 3 1 3 1 1 EVB Mode 3 1 3 1 2 JUMP EEPROM Mode 3 2 3 1 3 POD Probe Mode 3 2 3 1 3 1 Target Types Supported 3 2 3 1 3 2 Ta...

Page 4: ...Disassembler 3 13 Set Baud Rate 3 16 Block Fill 3 17 Breakpoint Set 3 18 Bulk Erase EEPROM 3 20 Call Subroutine 3 21 Specify Target MCU Device 3 22 Specify Target EEPROM Base Address 3 26 Erase Target Flash EEPROM 3 28 Program Target Flash EEPROM 3 30 Go Execute a User Program 3 32 Go Till 3 33 Onscreen Help Summary 3 34 Load S Record File 3 36 Memory Display 3 37 Memory Display Word 3 38 Memory M...

Page 5: ... EEPROM 3 61 3 9 3 SCI Port Usage 3 61 3 9 4 Dedicated MCU Pins 3 61 3 9 5 Terminal Communications 3 62 CHAPTER 4 HARDWARE REFERENCE 4 1 PCB DESCRIPTION 4 1 4 2 CONFIGURATION HEADERS AND JUMPER SETTINGS 4 1 4 3 POWER INPUT CIRCUITRY 4 5 4 4 TERMINAL INTERFACE 4 6 4 5 MICROCONTROLLER 4 6 4 6 CLOCK CIRCUITRY 4 8 4 7 RESET 4 8 4 8 LOW VOLTAGE INHIBIT 4 8 4 9 BACKGROUND DEBUG MODE BDM INTERFACE 4 8 4 ...

Page 6: ...APPLE MACINTOSH B 6 Setup B 6 S Record Transfers to EVB Memory B 6 RED RYDER APPLE MACINTOSH B 7 Setup B 7 S Record Transfers to EVB Memory B 7 APPENDIX C D BUG12 STARTUP CODE APPENDIX D D BUG12 CUSTOMIZATION DATA INITIAL USER CPU REGISTER VALUES D 3 SysClk FIELD D 3 IOBase FIELD D 3 SCIBaudRegVal FIELD D 4 EEBase AND EESize FIELDS D 4 EEPROM ERASE PROGRAM DELAY FUNCTION POINTER FIELD D 5 AUXILIAR...

Page 7: ...11 Figure 4 2 MCU I O Headers P4 P6 4 12 LIST OF TABLES Table 1 1 EVB Specifications 1 8 Table 2 1 EVB Startup Mode Jumpers 2 3 Table 2 2 RS 232C Interface Cabling 2 4 Table 2 3 Communication Parameters 2 5 Table 3 1 D Bug12 Command Set Summary 3 9 Table 3 2 M68HC11 to CPU12 Instruction Translation 3 14 Table 3 3 CPU12 Registers 3 56 Table 3 4 Condition Code Register Bits 3 56 Table 3 5 Factory Co...

Page 8: ...CONTENTS 68EVB912B32UM D viii ...

Page 9: ...re shipped as part of the EVB package 1 2 GENERAL DESCRIPTION AND FEATURES The EVB is an economical tool for designing and debugging code for and evaluating the operation of the MC68HC192B32 MCU By providing the essential MCU timing and I O circuitry the EVB simplifies user evaluation of prototype hardwareand software The board consists of a 5 15 by 3 4 inch 13 1 by 8 64 cm double sided printed ci...

Page 10: ...er connectors for access to the MCU s I O lines P2 P3 P4 and P6 Prototype expansion area for customized interfacing with the MCU Low profile reset push button switch S1 Low voltage inhibit protection U3 1 For full details of the jumper settings refer to Table 4 1 Firmware features include The D Bug12 monitor debugger program resident in on chip Flash EEPROM Full support for either dumb terminal or...

Page 11: ...GENERAL INFORMATION 68EVB912B32UM D 1 3 Figure 1 1 EVB Layout and Component Placement ...

Page 12: ... It is ready for use with an RS 232C terminal for writing and debugging user code Follow the setup instructions in Chapter 2 to prepare for operation The EVB can also be jumper configured to run a program directly out of EEPROM control a remote pod MCU via the Background Debug Mode interface reprogram EEPROM on either the host EVB or the pod For the correct jumper settings refer to 4 2 Configurati...

Page 13: ...Serial Debug Interface User s Manual Two methods may be used to generate EVB user code 1 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 2 For larger programs P E Microcomputer Systems IASM12 or Motorola s MCUasm assembler may be used on a host computer to generate S Record object files which can ...

Page 14: ...of all D Bug12 commands refer to 3 6 D Bug12 Command Set When operating in EVB mode the MCU must manage the EVB hardware and execute D Bug12 in addition to serving as the user application processor there are a few restrictions on its use For more information refer to 3 9 Operational Limitations 1 4 EXTERNAL EQUPMENT REQUIREMENTS In addition to the EVB the following user supplied external equipment...

Page 15: ...tic Specifications MCU MC68HC912B32 MCU I O ports HCMOS compatible Background Debug Mode interface IN and OUT two 2x3 headers Communications port RS 232C DCE port Power requirements 16 MHz clock source 2 7 Vdc to 5 0 Vdc 100 mA max For low voltage operation refer to section 4 8 Prototype area Area Holes approx 1 5 x 3 in 3 8 x 7 6 cm approx 15 wide x 31 high on 0 1 in 2 54 mm centers Board dimensi...

Page 16: ... 6824 400 MEXICO FRANCE Mexico City 52 5 282 0230 Paris 33134 635900 Guadalajara 52 36 21 8977 GERMANY PUERTO RICO Langenhagen Hannover 49 511 786880 San Juan 809 282 2300 Munich 49 89 92103 0 SINGAPORE 65 4818188 Nuremberg 49 911 96 3190 SPAIN Sindelfingen 49 7031 79 710 Madrid 34 1 457 8204 Wiesbaden 49 611 973050 SWEDEN HONG KONG Solna 46 8 734 8800 Kwai Fong 852 6106888 SWITZERLAND Tai Po 852 ...

Page 17: ...ons Supplement CPU12 Reference Manual MC68HC12 Family Brochure Assembly Language Development Toolset P E Microcomputer Systems IASM12 Assembler and user s manual on 3 5 diskette Using D Bug12 Callable Routines Save all packing materials for storing and shipping the EVB Remove the EVB from its anti static container 2 2 EVB CONFIGURATION Because the EVB has been factory configured to operate with D ...

Page 18: ...ernal power supply See Table 1 1 for the voltage and current specifications For full details of the EVB s power input circuitry refer to 4 3 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...

Page 19: ...tween the EVB and the terminal Adapters are readily available for connecting 9 pin cables to 25 pin terminal connectors 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 DTE Signal Terminal DCE Receptacle DTE 1 Plug DCE 2 Receptacle...

Page 20: ...ne 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 E Microcomputer Systems IASM12 or Motorola s MCUasm assembler For more information refer to 3 7 Off Board Code Generation To serve as the EVB s terminal the host computer must...

Page 21: ...For temporary changes use the D Bug12 BAUD command This change remains in effect only until the next reset or power up at which time the baud rate returns to 9600 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 ...

Page 22: ...CONFIGURATION AND SETUP 68EVB912B32UM D 2 6 ...

Page 23: ...32 cannot fully emulate a target system The limitations are described in 3 9 Operational Limitations Target system emulation may however be performed by using the EVB with D Bug12 as an intelligent non intrusive BDM interface This operation is described in 3 1 3 POD Probe Mode 3 1 1 EVB Mode In the default EVB mode W3 0 and W4 0 D Bug12 begins execution immediately The D Bug12 prompt appears on th...

Page 24: ...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 M68EVB912B32 board or any other M68HC12 s...

Page 25: ...1 4 BOOTLOAD Mode 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 may also be used to reload or customize D Bug12 The procedures are described in Appendix E EEPROM Bootloader 3 2 STARTUP 3 2 1 Startup Procedure The following startup procedure includes a checklist of configuration...

Page 26: ...ctor may either be D Bug12 factory default or a user s program that has replaced D Bug12 in Flash EEPROM D Bug12 upon reset the D Bug12 sign on banner and prompt should appear on the terminal s display as follows D Bug12 v 2 0 0 Copyright 1996 1997 Motorola Semiconductor For Commands type Help If the prompt does not appear check all connections and verify that startup steps 1 through 7 in section ...

Page 27: ... 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 try again to establish communications If communications fail the above 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 as follows D...

Page 28: ...target system are controlled by the user program 3 2 2 4 BOOTLOAD Mode 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 Bug12 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 3 3 RESET EVB operation can be restarted at any ...

Page 29: ... is in active background mode not running a user program the two 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 two character prompt R 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...

Page 30: ... 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 6 Before the ENTER or RETURN 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 char...

Page 31: ...D AddressOffset Load user program in S Record format MD StartAddress EndAddress Memory Display display memory contents in hex bytes ASCII format MDW StartAddress EndAddress Memory Display Word display memory contents in hex words ASCII format MM Address data Memory Modify interactively examine change memory contents MMW address data Memory Modify Word interactively examine change memory contents M...

Page 32: ...ntents against S Record Data RegisterName RegisterValue Set CPU RegisterName to RegisterValue Refer to Appendix A for S Record information 3 6 D BUG12 COMMAND SET In the following command descriptions the examples represent what is seen on the terminal display For clarity the user s entry is underlined This underlining does not actually appear onscreen A typical example looks like this baud 9600 u...

Page 33: ...aracter entered following the prompt the next instruction in memory is disassembled and displayed on the next line If a CPU12 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 ...

Page 34: ...ET 32768 PC 01 0700 080F 18FF TRAP FF 0811 183FE3 ETBL Illegal Addr Mode assembly operand format 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 CPU12 Reference Manual Rather than describe the numeric format accepted for each instruction some general rules are used Excepti...

Page 35: ...ral 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 For all branch Bcc LBcc BRSET BRCLR DBEQ DBNE IBEQ IBNE TBEQ TBNE instructions the numeric value of the address portion of the operand field is displa...

Page 36: ...65535 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 D Bug12 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 SCI s BAUD rate divider is equal to zero or greate...

Page 37: ...ta 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 StartAddress is the first memory location written with data and EndAddress is the last memory location written with data If the data parameter is omitted the memory range is filled with the value 00 restrictions None example BF 6400 6fff 0 BF 6f00 6fff 55 ...

Page 38: ...he breakpoint address in the users program with an SWI instruction when operating in EVB mode or with the BGND instruction when operating in POD mode A breakpoint may not be set on a user SWI instruction when operating in EVB mode In either mode breakpoints may only be set at an opcode address and breakpoints may only be placed at memory addresses in alterable memory Even though D Bug12 supports a...

Page 39: ...OPERATION 68EVB912B32UM D 3 17 example BR 35ec 2f80 c592 Breakpoints 35EC 2F80 C592 BR Breakpoints 35EC 2F80 C592 ...

Page 40: ... operation After the bulk erase operation has been performed each on chip EEPROM location is checked for an erased condition restrictions In order to erase EEPROM the EEPROM block protect control bits must be cleared Refer to the MC68HC912B32 Technical Summary for locations and operation of the block protect controls example BULK F EEPROM Failed To Erase BULK ...

Page 41: ...he Program Counter PC is used as the starting address NOTE No user breakpoints are placed in memory before execution is transferred to user code restrictions If the called subroutine modifies the value of the stack pointer during its execution it must restore the stack pointer s original value before executing the final RTS of the called subroutine This restriction is required because a return add...

Page 42: ...cessary 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 s...

Page 43: ...auses D Bug12 to reinitialize the device table with the two default MCU devices The information for any new devices that were added to the table will be lost restrictions When operating the M68EVB912B32 in EVB mode the DEVICE command may only be used 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...

Page 44: ...32 EEPROM 0D00 0FFF Flash 8000 FFFF RAM 0800 0BFF I O Regs 0000 S DEVICE 912b32 1d00 1fff 8000 ffff 800 bff 0 Device 912B32 EEPROM 1D00 1FFF Flash 8000 FFFF RAM 0800 0BFF I O Regs 0000 S DEVICE 812a4 Device 812A4 EEPROM 1000 1FFF RAM 0800 0BFF I O Regs 0000 S ...

Page 45: ...cified in the customization data variables CustomData EEBase and CustomData EESize The value in CustomData EEBase is used by the startup code to remap the EEPROM The EEBASE command may not be used to relocate the I O registers When operating in POD mode the target s default EEPROM base address and range are specified by the currently selected device See the DEVICE command for additional details Th...

Page 46: ...ice 912B32 EEPROM 0D00 0FFF Flash 8000 FFFF RAM 0800 0BFF I O Regs 0000 S EEBASE 1d00 Device 912B32 EEPROM 1D00 1FFF Flash 8000 FFFF RAM 0800 0BFF I O Regs 0000 S MM 12 0012 01 11 0013 0F S MD 1d00 1D00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF S ...

Page 47: ... 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 EEP...

Page 48: ...OPERATION 68EVB912B32UM D 3 26 example S FBULK Flash Programming Voltage Not Present S FBULK F EEPROM Failed To Erase S FBULK S FBULK Command Not Allowed In EVB Mode ...

Page 49: ...and 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 ...

Page 50: ...ng voltage Vpp must be applied to the target MCU If the target system is another M68EVB912B32 board Vpp may be supplied via header W8 with header W7 set accordingly For more information on these EVB headers seeTable 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 ...

Page 51: ...nd 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 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 def...

Page 52: ...t 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 restrictions The GT command cannot be issued when ...

Page 53: ... HELP 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 ...

Page 54: ... this D Bug12 command summary LOAD AddressOffset Load S Records into memory MD StartAddress EndAddress Memory Display Bytes MDW StartAddress EndAddress Memory Display Words MM StartAddress Modify Memory Bytes CR Examine Modify next location or Examine Modify same location or Examine Modify previous location Exit Modify Memory command MMW StartAddress Modify Memory Words same subcommands as MM MOVE...

Page 55: ...embled During the loading process the S Record data is not echoed to the control console However for each ten S Records that are successfully loaded an ASCII asterisk character is sent to the control console When an S Record file has been successfully loaded 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 ...

Page 56: ... next higher multiple of 16 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 MD 800 0800 AA 04 37 6A 00 06 27 F9 35 AE 78 0D B7 56 78 20 7j 5 x Vx MD 800 87f 0800 AA 04 37 6A 00 06 27 F9 35 AE 78 0D B7 56 78...

Page 57: ...dAddress parameter is rounded up to the next higher multiple of 16 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 MDW 800 0800 AA04 376A 0006 27F9 35AE 780D B756 7820 7j 5 x Vx MDW 800 87f 0800 AA04 376A 0...

Page 58: ...rification of memory contents These sub commands have the following format Data CR Optionally update current location and display the next location Data or Optionally update current location and redisplay the current location Data or Optionally update current location and display the previous location Data Optionally update current location and exit Memory Modify With the exception of the carriage...

Page 59: ...OPERATION 68EVB912B32UM D 3 37 example MM 800 0800 00 CR 0801 F0 FF 0802 00 0801 FF CR 0802 00 CR 0803 08 55 0803 55 ...

Page 60: ...n and verification of memory contents These sub commands have the following format Data CR Optionally update current location and display the next location Data or Optionally update current location and redisplay the current location Data or Optionally update current location and display the previous location Data Optionally update current location and exit Memory Modify With the exception of the ...

Page 61: ...OPERATION 68EVB912B32UM D 3 39 example MMW 800 0800 00F0 CR 0802 0008 AA55 0804 843F 0802 AA55 CR 0804 843F CR 0806 C000 ...

Page 62: ...ess StartAddress The block of memory beginning at the destination address may overlap the memory block defined by the StartAddress and EndAddress One of the uses of the MOVE command might be to copy a program from RAM into the on chip EEPROM memory restrictions A minimum of one byte may be moved if the StartAddress is equal to the EndAddress The maximum number of bytes that may be moved is 2 16 1 ...

Page 63: ... previously entered breakpoints If the NOBR command is entered without any arguments all user breakpoints are removed from the breakpoint table restrictions When operating in the POD mode breakpoints may not be removed with the NOBR command when the R prompt is displayed example BR 800 810 820 830 Breakpoints 0800 0810 0820 0830 NOBR 810 820 Breakpoints 0800 0830 NOBR All Breakpoints Removed ...

Page 64: ...x RD The Register Display command is used to display the CPU12 s registers restrictions When operating in POD mode the CPU registers may not be displayed when the R prompt is displayed example RD PC SP X Y D A B CCR SXHI NZVC 0206 03FF 1000 3700 27 FF 1001 0001 ...

Page 65: ...GBASE command does not check to ensure that the Address 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 specified in the customization data variable CustomData IOBase This value is used by the...

Page 66: ...ION 68EVB912B32UM D 3 44 example S DEVICE Device 912B32 EEPROM 0D00 0FFF Flash 8000 FFFF RAM 0800 0BFF I O Regs 0000 S REGBASE 2000 Device 912B32 EEPROM 0D00 0FFF Flash 8000 FFFF RAM 0800 0BFF I O Regs 2000 S ...

Page 67: ...rom 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 indi...

Page 68: ...e 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 d...

Page 69: ...estrictions When operating in the 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 CCFFFF LDD FFFF 4003 830001 SUBD 0001 4006 26FB BNE 4003 4008 20F6 BRA 4000 400A 00 BGND S G 4000 R STOP Target Processor Has Been Stopped PC SP X Y D A B CCR SXHI NZVC 4003 0A00 0000 00...

Page 70: ...return restrictions Because of the method used to execute a single instruction branch instructions Bcc LBcc BRSET BRCLR DBEQ NE IBEQ NE 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 ...

Page 71: ...00 1001 0000 0803 830001 SUBD 0001 T 3 PC SP X Y D A B CCR SXHI NZVC 0806 09FE 057C 0000 0F FF 1001 0000 0806 26FB BNE 0803 PC SP X Y D A B CCR SXHI NZVC 0803 09FE 057C 0000 0F FF 1001 0000 0803 830001 SUBD 0001 PC SP X Y D A B CCR SXHI NZVC 0806 09FE 057C 0000 0F FE 1001 0000 0806 26FB BNE 0803 ...

Page 72: ...0460000337FAFA4C37FAFA5037FAFA5437B5502037FAFA4E37B5302037FAFA5237B58A S1230480682037FAFA5637BD014037BC000095008A003C023D02377D0172B6EE37BD017259 S12304A037BC020095008A003C023D02377D018EB6EE27F937B0F50F379C37BC00CE27F901 S12304C000FC27F9104C27F90E68378000BE0A0D442D42756731362056312E3033202D20E3 S12304E04465627567204D6F6E69746F7220466F7220546865204D363848433136204661ED S12305006D696C790A0D284329203...

Page 73: ... ASCII asterisk character is sent to the control console for each ten S Records that are successfully verified When an S Record file has been successfully verified 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 lin...

Page 74: ...nge 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 4 Table 3 4 Condition Code Register Bits CCR Bit Name Descriptio...

Page 75: ...is entered on the command line followed by a space then followed by the new register or bit contents After successful alteration of a CPU register or CCR bit the entire CPU register set is displayed restrictions None example PC 700e PC SP X Y D A B CCR SXHI NZVC 700E 0A00 7315 7D62 47 44 1001 0000 X 1000 PC SP X Y D A B CCR SXHI NZVC 700E 0A00 1000 7D62 47 44 1001 0000 C 1 PC SP X Y D A B CCR SXHI...

Page 76: ...oader when the host EVB is in BOOTLOAD mode 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 into a target 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 section 3 1 sectio...

Page 77: ... data reserved for D Bug12 1K on chip RAM 0D00 0FFF user code data 768 bytes on chip EEPROM 8000 F67F F680 F6BF F6C0 F6FF F700 F77F F780 F7FF F800 FBFF FC00 FFBF FFC0 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 3 ...

Page 78: ...face 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 W1 and W2 3 9 4 Dedicated MCU Pins As used on the EVB with D Bug12 the following MCU lines perform specific functions If an application requires their use the EVB hardware and or operating software must be custom configured or special precaution...

Page 79: ... and HELP commands may be affected by this problem Sometimes the problem can be ignored without harm If it requires correcting try the following Use a slower baud rate Try a different communications program In multitasking environments such as Windows 3 1 and the MacIntosh System 7 the problem can occur when several applications are running at once Try closing unnecessary applications or exiting W...

Page 80: ...OPERATION 68EVB912B32UM D 3 58 ...

Page 81: ...are operation These headers are populated and the factory installed jumpers on them are preset for the default EVB hardware and firmware D Bug12 configurations Table 4 1 lists these headers by function and describes their default and optional jumper settings Cut trace header footprints offer EVB hardware options that are less likely to be changed These footprints are not populated The default conn...

Page 82: ...talled or 2 pin cut trace header with trace cut 2 pin header with jumper installed 2 pin cut trace header with default trace intact 3 pin header with no jumper installed 3 pin header with jumper installed on left 2 pins 1 2 bold pin numbers indicate factory default settings 1 2 cut italics indicate alternate settings Table 4 1 Jumper and Header Functions Diagram Pins Description W1 RS 232C TXD Con...

Page 83: ...0 0 Single Chip mode 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 CPU Mode Selection W7 Vpp Vdd Selection 1 2 3 2 3 1 2 Connects MCU s Vpp pin to Vdd non programming mode Connects MCU s Vpp pin to Vpp input header programming mode W8 Vpp Input Header 1 2 1 2 Vpp input Ground W9 BDM IN 5 1 6 2 1 2 3 4 5 6 Input t...

Page 84: ... BKGD output from MCU PT7 Ground NC Reset output from MCU PT6 NC Vdd W13 W14 RS 232C Configuration reserved in reserved W15 LVI Reset Enable in cut On board low voltage reset enabled On board LVI reset disabled provide external reset W16 On Board Crystal Enable in cut On board crystal connected to MCU EXTAL On board crystal disabled use W16 to provide external clock to EXTAL 4 3 POWER INPUT CIRCUI...

Page 85: ...B32 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 c...

Page 86: ...ve the MCU s RESET pin low when Vdd falls below U1 s threshold This prevents the accidental corruption of EEPROM data if the power supply voltage should drop below the allowable level Depending on the date of manufacture the sensing device installed on the EVB may have either a 2 7 volt or 4 5 volt threshold U1 may be identified by part number MC34164P 3 2 7 Vdc MC34164P 5 4 5 Vdc If operation bel...

Page 87: ...nctions 4 10 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 shows the component side view of the prototype area Adjacent Vss...

Page 88: ...0 11 l l 12 PAD1 PAD2 13 l l 14 PAD3 PAD4 15 l l 16 PAD5 PAD6 17 l l 18 PAD7 VDDAD 19 l l 20 VSSAD P2 PS0 1 l l 2 PS1 PS2 3 l l 4 PS3 PS4 5 l l 6 PS5 PS6 7 l l 8 PS7 VFP 9 l l 10 PDLC6 PDLC5 11 l l 12 PDLC4 PDLC3 13 l l 14 PDLC2 PDLC1 15 l l 16 PDLC0 VSSX77 17 l l 18 VDDX78 PP7 19 l l 20 PP6 P3 Figure 4 1 MCU I O Headers P2 P3 ...

Page 89: ... 10 VSSX30 VDDX31 11 l l 12 RESET EXTAL 13 l l 14 XTAL PE3 15 l l 16 PE2 PE1 17 l l 18 PE0 PA0 19 l l 20 PA1 P4 PP5 1 l l 2 PP4 PP3 3 l l 4 PP2 PP1 5 l l 6 PP0 PT0 7 l l 8 PT1 PT2 9 l l 10 VDD10 VSS11 11 l l 12 PT3 PT4 13 l l 14 PT5 PT6 15 l l 16 PT7 BKGD 17 l l 18 PB0 PB1 19 l l 20 PB2 P6 Figure 4 2 MCU I O Headers P4 P6 ...

Page 90: ...HARDWARE REFERENCE 68EVB912B32UM D 4 10 ...

Page 91: ...represents the low order 4 bits of the byte The 5 fields that comprise an S Record are shown below TYPE RECORD LENGTH ADDRESS CODE DATA CHECKSUM The S Record fields are composed as follows Field Printable Characters Contents Type 2 S Record type S0 S1 etc Record length 2 The count of the character pairs in the record excluding the type and record length Address 4 6 or 8 The 2 3 or 4 byte address a...

Page 92: ...orts only the S1 and S9 records All data before the first S1 record is ignored Thereafter all code data records must be of type S1 until the S9 record terminates data transfer An S Record format module may contain S Records of the following types S0 The header record for each block of S Records The code data field may contain any descriptive information identifying the following block of S Records...

Page 93: ... of the following character pairs S0 S Record type S0 indicating a header record 06 Hexadecimal 06 decimal 6 indicating six character pairs or ASCII bytes follow 00 00 Four character 2 byte address field zeroes 48 44 52 ASCII H D and R HDR 1B Checksum of S0 record The first S1 code data record is explained as follows S1 S Record type S1 indicating a code data record to be loaded verified at a 2 by...

Page 94: ...re ended with checksums 13 and 52 respectively The fourth S1 code data record contains 07 character pairs and has a checksum of 92 The S9 termination record is explained as follows S9 S Record type S9 indicating a termination record 03 Hexadecimal 03 indicating three character pairs 3 bytes follow 00 00 Four character 2 byte address field zeroes FC Checksum of S9 record Each printable character in...

Page 95: ...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 manua...

Page 96: ... Select the following baud rate 9600 or the customized EVB setting data bits 8 stop bits 1 parity none COM port the host port used as the EVB terminal interface 6 Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry 7 Press ENTER The D Bug12 prompt should appear on the display Continue with the startup procedure in section 3 2 S Record Transfers to EVB Memory To loa...

Page 97: ...0 or the customized EVB setting by typing set baud 9600 ENTER 3 Connect to the EVB by typing connect ENTER 4 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 section 3 2 S Record Transfers to EVB Memory To load an S Record file from the host computer into EVB memory using Kerm...

Page 98: ... activating the appropriate custom reset circuitry The D Bug12 prompt should appear on the display Continue with the startup procedure in section 3 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 s...

Page 99: ...ts per Character 8 Bits Parity None Handshake None Connection Modem or Another Computer Connection Port Modem or Printer Click on OK 3 Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry 4 Press ENTER The D Bug12 prompt should appear on the display Continue with the startup procedure in section 3 2 S Record Transfers to EVB Memory To load an S Record file from the ...

Page 100: ...gram 2 Set up the Red Ryder parameters as follows 9600 baud or the customized EVB setting 8 data bits 1 stop bit no parity full duplex 3 Reset the EVB by pressing S1 or by activating the appropriate custom reset circuitry 4 Press ENTER The D Bug12 prompt should appear on the display Continue with the startup procedure in section 3 2 S Record Transfers to EVB Memory To load an S Record file from th...

Page 101: ...COMMUNICATIONS PROGRAM EXAMPLES 68EVB912B32UM D B 7 NOTE S Records are not displayed during the file transfer Upon completion of the S Record file transfer the D Bug12 prompt is displayed ...

Page 102: ...COMMUNICATIONS PROGRAM EXAMPLES 68EVB912B32UM D B 8 ...

Page 103: ...MAP_PAGE INITEE equ 0012 MAP_PAGE COPCTL equ 0016 MAP_PAGE CSCTL0 equ 003c MAP_PAGE CSCTL1 equ 003d MAP_PAGE CSSTR0 equ 003e MAP_PAGE PORTAD equ 006f MAP_PAGE EEMCR equ 00f0 MAP_PAGE BPROT equ 00f1 MAP_PAGE FEELCK equ 00f4 MAP_PAGE MonRAMStart equ 0A00 MonRAMSize equ 0200 RAM_START equ 0800 RAMSize equ 0400 STACKTOP equ RAM_START RAMSize stack at top of internal RAM EE_START equ 0d00 EEPROM locate...

Page 104: ... PIPOE NECLK LSTRE RDWE 0 0 0A ldaa 2c prevent later protection lock staa PEAR PROTLK is write once Without changing modes enable internal visibility MODE SMODN MODB MODA ESTR IVIS 0 EMD EME 0B bset MODE 08 set IVIS Enable EEPROM so monitor can program erase bytes EEMCR 1 1 1 1 1 1 PROTLK EERC F0 BPROT 1 BPROT6 BPROT5 BPROT4 BPROT3 BPROT2 BPROT1 BPROT0 F1 ldaa fc prevent later protection lock staa...

Page 105: ...mall subroutine is used to produce a delay of approximately 10 mS This delay is based on the following conditions 1 An 8 00 MHz E clock 2 Subroutine located in internal memory This routine is called by D Bug12 s WriteEEByte function through a pointer stored in the Customization Data Table _EEDelay ldx 20000 load delay count into x DlyLoop dex decrement count bne DlyLoop loop till done rts return e...

Page 106: ...D BUG12 STARTUP CODE 68EVB912B32UM D C 4 ...

Page 107: ...SCIBaudRegVal Initial SCI BAUD reg 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 No of commands in aux cmd table CmdTblEntryP AuxCmdTableP Pointer to auxiliary cmd table CustomData Assembly Format org F6C0 CustData equ UserCCR dc b 90 User CPU Condition Code Register UserB dc b 00 U...

Page 108: ...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 SysClk FIELD The SysClk field is used to inform D Bug12 of the system clock frequency M Its value in Hz is set to 8 000 000 In this implementation the E clock frequency is the same as the system clock frequency M SysClk is used...

Page 109: ...egister 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 NOTE 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 EEBase AND EESize FIELDS The EEBase and EESize fields are used to des...

Page 110: ...e number of entries in the auxiliary command table The table is an array of entries of type CmdTblEntry Each CmdTblEntry in the auxiliary command table has the following structure typedef struct pointer to the command string const char CommandStr pointer to the function that implements the command int ExecuteCmd int argC char argV CmdTblEntry CmdTblEntryP The first field is a character pointer to ...

Page 111: ...eyed 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 enum Error noErr 0 Define No Error WrongNumArgs 6 Wrong Number of Arguments BadStartAddress 7 Invalid Starting Address BadEndAddress 8 Invalid Ending Add...

Page 112: ...D BUG12 CUSTOMIZATION DATA 68EVB912B32UM D D 6 ...

Page 113: ...ly occupy the 30 Kbytes from 8000 to F7FF Programs loaded and used in this manner cannot be used for true emulation of an application Refer to the restrictions in section 3 9 Use of the EEPROM bootloader is described in the following sections SERIAL S RECORD BOOTLOADER The bootloader contains a serial S Record loader that can load assembled code from the host computer into either Flash EEPROM or b...

Page 114: ... EEPROM S Records may contain ASCII CR and or LF characters CAUTION If an Erase or Program operation is unsuccessful after one or two attempts check the Vpp connection on header W8 and measure the value of Vpp to verify compliance with the MC68HC912B32 Electrical Specifications Supplement A Vpp voltage lower than that specified may cause the erase or program operation to fail A Vpp voltage higher ...

Page 115: ... causes a bulk erase of byte erasable EEPROM in the address range 0D00 0FFF After the erase operation a verify operation checks for proper erasure of all locations If any locations were found to contain a value other than FF the message Not Erased is displayed and the bootloader s prompt is redisplayed If the erase operation was successful the bootloader sends an ASCII asterisk character to the ho...

Page 116: ...D2 FFD4 reserved F7D4 FFD6 SCI0 F7D6 FFD8 SPI F7D8 FFDA Pulse Acc Input Edge F7DA FFDC Pulse Acc Overflow F7DC FFDE Timer Overflow F7DE FFE0 Timer Channel 7 F7E0 FFE2 Timer Channel 6 F7E2 FFE4 Timer Channel 5 F7E4 FFE6 Timer Channel 4 F7E6 FFE8 Timer Channel 3 F7E8 FFEA Timer Channel 2 F7EA FFEC Timer Channel 1 F7EC FFEE Timer Channel 0 F7EE FFF0 Real Time Interrupt F7F0 FFF2 IRQ F7F2 FFF4 XIRQ F7...

Page 117: ... follows 1 Search for the S Record line that begins with S123FC00 2 Delete this line and all remaining S Records except for the last line in the file which is the S9 end of file record This removes the bootloader program and vector table from the file 3 Make sure that no blank lines remain in the file as they may cause the loading process to fail The S Record file may now be programmed into Flash ...

Page 118: ...s the S9 end of file record This removes the bootloader program and vector table from the file 3 Search for the S Record line that begins with S120F6C0 Replace this line with the S Record containing the new customization data 4 Search for the S Record line that begins with S123F700 Replace this line and the next one S11FF720 with the S Records containing the new startup code 5 Make sure that no bl...

Page 119: ... 36 MMW Memory Modify Word 3 38 MOVE Move Memory Block 3 40 NOBR Remove Breakpoints 3 41 RD Register Display 3 42 REGBASE Specify Target EEPROM Register Address 3 43 REGISTER NAME Modify Register Value 3 52 RESET Reset Target MCU 3 45 RM Register Modify 3 46 STOP Stop Execution on Target MCU 3 47 T Trace 3 48 UPLOAD Display Memory S Record Format 3 50 VERF Verify S Record File against Memory 3 51 ...

Page 120: ...specifications 1 7 startup procedure 3 3 unpacking 2 1 EVB mode 3 1 3 4 F FBULK command 3 25 file transfers 3 33 3 51 3 54 B 1 firmware See D Bug12 Flash EEPROM See EEPROM FLOAD command 3 27 G G command 3 29 GT command 3 30 H headers connector 4 1 See also connectors cut trace 4 1 description 4 1 4 2 jumper 4 1 See also jumper settings HELP command 3 31 I IASM12 assembler 1 5 2 4 3 54 J JUMP EEPRO...

Page 121: ...1 2 5 3 6 4 5 4 6 RESET command 3 45 RM command 3 46 ROM See EEPROM RS 232C interface 2 2 3 56 S S1 See switches SCI port baud rate 3 14 configuration 2 2 usage 1 5 1 6 2 2 2 3 3 56 serial communications interface See SCI port Serial Debug Interface SDI 1 5 1 6 2 3 4 7 specifications EVB 1 7 S Records 3 33 3 51 A 1 STOP command 3 47 switches 1 5 locations 1 3 S1 reset 3 6 T T command 3 48 target B...

Page 122: ...INDEX 68EVB912B32UM D 4 ...

Reviews: