HomePACESearch
ProjectsForumsSite Map

Current:
Level Down:

Users Guide

to the

ECE345 MC68HC912B32 Tester

 

 

Introduction

 

The HC12 Tester was designed to allow students to verify that their HC12 board functions properly.  The tester works by outputting a high signal to one port and reading that port with three or two other ports.  For example, to test port A, a high signal is outputted to each of the pins of port A.  Pin 0 through 7 of port B, P, and T are connected to pin 0 through 7 of port A. Port B, P, and T read in the values outputted by port A.  If the values read are not all high, then the test program detects an error on port A.  Similarly, ports E, S, and DCL are connected to each other and verify each other's functionality.  

 

This web page explains how to set up the HC12 Tester hardware, how to run the tester software, and how to understand the tester's output.  

 


Obtain the HC12 Tester Software

 

The HC12 Tester is capable of verifying port A, port B, port T, port P, port E port S, port DCL, and the A/D converter.  To execute each of these tests you must load your HC12 with a different program.  You can download the source code (.asm) and executables (.s19) from table 1.  


 

  Source File Executable File Run Command
To check port A use: ain.asm ain.s19 G 810
To check port B use: bin.asm bin.s19 G 810
To check port T use: tin.asm tin.s19 G 810
To check port P use: pin.asm pin.s19 G 810
To check port E use: ein.asm ein.s19 G 80A
To check port S use: sin.asm sin.s19 G 80A
To check port DCL use: canin.asm canin.s19 G 80A
To check the A/D converter use:  ad.asm ad.s19 G 810

Table 1:  Source and Executable Files used to 

test each port and the A/D converter.


Setting up the Tester Box

bullet

Obtain the HC12 Tester Box, which should be located in the Senior Design lab.  The box is shown in Figure 1.

 

Figure 1:  HC12 Tester with HC12 evaluation board in place, 

serial cable connected, and power cable connected.  

                             

bullet

Insert your HC12 evaluation board into the mulit-pin connector as shown in Figure 1.  

bullet

Connect the HC12 serial cable to your PC and the HC12 evaluation board
(Pin 2 connects to TxD, Pin 3 connects to RxD, Pin 5 = GND)

bullet

Put switch SW4 to 0

bullet

Put switch SW3 to 0

bullet

Put switch SW7 to RUN

bullet

Connect 5 volts to the red terminal.

bullet

Connect Ground to the black terminal.


Running the HC12 Tester Code  

 

bullet

Make sure that the HC12 debug program is stored in EEPROM.  If it is not in EEPROM, then load it into EEPROM

bullet

Run IASM12.exe, which is the HC12 debugger program.  

bullet

Press F10 to enter the configuration menu:

                               Set Assemble to: F4, S19, OFF, OFF, OFF, HIDE, HIDE    

                               Set Communicate to:  COMM2 9600 BAUD, N, 8, 1

bullet

Press ESC ESC to exit the configuration menu.  

bullet

Press F7 to open the communication window

bullet

Press the red reset button on the HC12 Tester Box.  You should see DBug 12 v2.0.2 in the communication window.  If you do not get this message then you may have improperly connected the serial port to the HC12 evaluation board.  Reconnect the serial cable to the HC12 evaluation board with the transmit pin at the top, and press reset again.  If you still do not get the DBug 12v2.0.2 message, you may have to reload the debug program into EEPROM or the serial port on your HC12 chip is not functioning.   

bullet

Type Load

bullet

Press F6 to download and then type the name of the program you want to download, such as ain.s19, bin.s19, tin.s19, etc .

bullet

Wait until the loading stops

bullet

Push enter a few times to get a prompt

bullet

Type the run command according to Table 1.  The run command is either G 810 or G 80A.  Hit enter to start the program.  


 

Understanding the Tester Output


To understand what the tester output means consider the following example that uses ain.s19.  The output for each of the programs resembles this example.  When ain.s19 was run on a properly functioning board the following output was obtained:  

    Port A to B  =  OK

    Port A to P  =  OK

    Port A to T  =  OK

 

    Port A  =  OK

 

The output signifies that the 8 pin connection from port A to port B was OK, the 8 pin connection from port A to port P was OK, and the 8 pin connection from port A to port T was OK.

 

Therefore, Port A is OK.  

 

When ain.s19 was run on a malfunctioning board, the following output was obtained;  

    Port A to B  =  BAD

    Port A to P  =  BAD

    Port A to T  =  BAD

 

     

Bit 0  =  OK   Bit 1  = BAD   Bit 2  =  OK   Bit 3  =  OK

Bit 4  =  OK   Bit 5  =  OK     Bit6  =  OK   Bit 7  =  OK

 


The output signifies that the 8 pin connection from port A to port B was BAD, the 8 pin connection from port A to port P was BAD, and the 8 pin connection from port A to port T was BAD.  Since the connections to all three ports were bad, this signifies that port A is bad.  In fact the program shows that Bit 1 on port A is bad.

 

Some of the programs display BitX  =  N/A.  This means that the corresponding bit cannot be tested.  For example, the transmit and receive bits on the serial port are N/A, since these pins are being used for communication between the PC and the HC12 chip.  

 

   

Caution!

 

Make sure that your HC12 evaluation board is plugged tightly into the HC12 Tester Box.  All of the pins must be connected to the Tester Box for the system to work properly.  


Also, since the test programs check to make sure that each port is capable of outputting high signals (5 volts), the tester cannot detect when a pin is improperly connected to 5 volts.  Future versions of the tester should be able to test for this error by having the test program output and check for a low signal (0 volts) as well as a high signal.  Currently the tester will only detect accidental shorts. 

  

 
Please contact Professor Gary Swenson (swenson1@uiuc.edu) to learn more about the course, or contact the webmaster (wiegert@uiuc.edu) with questions or comments about the web site.  Web Site designed by Purvesh Thakker.