Serial Communications through the SCI on the 6811

Setting Up the Compiler to Communicate Serially

Replace the file located in your SmallC compiler directory that is named "68hc11.h" with the following new version. It contains modifications for correct mappings to registers needed for the Serial Communications Interface.

GetByte() Function

This function gets a byte that is received on the serial port of the 6811 and returns its value in a variable called "iRetVal". This integer value needs to be declared globally in your program. It waits for the byte indefinitely by using a polling loop and does NOT use interrupts in any way. It calls three functions defined in the EVB's ROM. The EVB documentation (the large white manual) has the code for these functions. You should look at it carefully to ensure that there is compatibility between your program and these routines (you may want to copy them and change them a bit - no pun intended).

SendByte() Function

This function sends a byte stored in a variable called "iSendVal" over the serial port of the 6811. This integer value needs to be declared globally in your program. It waits to return until the byte has been sent by using a polling loop and does NOT use interrupts in any way. It calls three functions defined in the EVB's ROM. The EVB documentation (the large white manual) has the code for these functions. You should look at it carefully to ensure that there is compatibility between your program and these routines (you may want to copy them and change them a bit - no pun intended).


Comments to: cse477-webmaster@cs.washington.edu (Last Update: )