Source Code Files
Contents
USB08 Evaluation Board Designer Reference Manual
MOTOROLA Source Code Files 113
U08232.C
//===================== ======================== ======================= ========
// File: U08232.C
// Func: RS232 Implemen tation Module for USB08 Demo Application
// Ver.: 1.00
// Auth: (C)2000,2001 b y Oliver Thamm, MCT Elek tronikladen GbR
// http://hc08web .de/usb08
// Rem.: View/Edit this File with TAB-Size=4
//===================== ======================== ======================= ========
//--------------------- ------------------------ ----------------------- --------
#include "hc08jb8.h" // HC08JB8 Register De finitions
#include "u08232.h" // Header File for RS2 32 Module
//--------------------- ------------------------ ----------------------- --------
//--------------------- ------------------------ ----------------------- --------
// Hardware Dependencie s - Physical Port Usage for Software SCI Tx/Rx
// Change the following Definitions to meet you r Hardware Requirements :
//--------------------- ------------------------ ----------------------- --------
// Transmit Line is PTC[0]
#define setTxLow() (PTC &= ~0x01)
#define setTxHigh() (PTC |= 0x01)
#define enaTxOut() (DDRC |= 0x01)
// Receive Line is PTA[ 7]
#define tstRxLvl() (PTA & 0x80 )
#define enaRxIn() (DDRA &= ~0x80)
//--------------------- ------------------------ ----------------------- --------
// Hardware Dependencie s - SSCI Bit Timing gene rated by System Timer T IM
// Change the following Definitions to meet you r Hardware Requirements :
//--------------------- ------------------------ ----------------------- --------
// clear TSTOP Bit in TSC Register to ac tiv at e Counter
// PS0..PS2 Prescaler B its in TSC Register must be 0 (default)
// so the Counter Rate is 3 MHz (0.333µs )
// 9600 Baud -> 104.1666 us per Bit -> 312. 5 Cl oc ks per Bit @ 3MHz
// 2400 Baud -> 416.6666 us per Bit -> 1250 Cloc ks per Bit @ 3MHz
// Adjust Value depending on Subroutine Call Overhead
//--------------------- ------------------------ ----------------------- --------