.: EMICROS :.  Embedded Micro Software
Home CAN232 CANUSB I2C232 I2CUSB CanWiser Learn C
Add your text here
Contact

Email : info@emicros.com

Ordering Information

.: Ordering using our PayPal powered shopping cart (PayPal account not required).

CAN232 : $79
CANUSB : $89
I2C232 : $79

I2CUSB : $89

Click here to View Cart and check out.

 

 

 

 
Transmitting an 8 bit byte of information is performed by the CommPortSendByte() function. This function first checks to see if the transmit register can be written to and then writes the byte it. Notice that while it is waiting for the TXIF bit to get set it is checking the framing and overrun error bits.

Add this function to the serial.c file and also don't forget to add the function prototype in the serial.h file.

/* ------------------------------------------
// function: CommPortSendByte( unsigned tx )
// description: This function sends a byte
//              passed to it.
// ---------------------------------------*/
void CommPortSendByte( unsigned char tx )
{
   /* ------------------------------------
   // Wait for the previous transmission
   // to complete.
   // ----------------------------------*/
   while( !TXIF )
   {
      CommPortClearErrors();
   }
   TXREG = tx;
}

 
 
Copyright 2010 Embedded Micro Software. All rights reserved