mikroC - C Compiler for Microchip PIC microcontrollers
Soft_Uart_Read
Prototype
unsigned short Soft_Uart_Read(unsigned short *error);
Returns
Returns a received byte.
Description
Function receives a byte via software UART. Parameter
transfer was successful. This is a non-blocking function call, so you should test the
error
Requires
Soft UART must be initialized and communication established before using this func-
tion. See
Example
// Here's a loop which holds until data is received:
do
data = Soft_Uart_Read(&error);
while (error);
// Now we can work with it:
if (data) {...}
Soft_Uart_Write
Prototype
void Soft_Uart_Write(char data);
Description
Function transmits a byte (data) via UART.
Requires
Soft UART must be initialized and communication established before using this func-
tion. See
Be aware that during transmission, software UART is incapable of receiving data – data
transfer protocol must be set in such a way to prevent loss of information.
Example
char some_byte = 0x0A;
...
Soft_Uart_Write(some_byte);
page
262
manually (check the example below).
.
Soft_Uart_Init
.
Soft_Uart_Init
MikroElektronika: Development tools - Books - Compilers
making it simple...
will be zero if the
error
mikroC
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?