Software Uart Library - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...

Software UART Library

mikroC provides library which implements software UART. These routines are
hardware independent and can be used with any MCU. You can easily communi-
cate with other devices via RS232 protocol – simply use the functions listed
below.
Note: This library implements time-based activities, so interrupts need to be dis-
abled when using Soft UART.
Library Routines
Soft_Uart_Init
Soft_Uart_Read
Soft_Uart_Write
Soft_Uart_Init
Prototype
void Soft_Uart_Init(unsigned short *port, unsigned short rx,
unsigned short tx, unsigned short baud_rate, char inverted);
Description
Initalizes software UART. Parameter
pins are located; parameters
same pin;
clock and working conditions. Parameter
inverted logic on output.
Soft_Uart_Init
Library.
Example
Soft_Uart_Init(&PORTB, 1, 2, 9600, 0);
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
and
rx
is the desired baud rate. Maximum baud rate depends on PIC's
baud_rate
needs to be called before using other functions from Soft UART
specifies port of MCU on which RX and TX
port
need to be in range 0–7 and cannot point at the
tx
, if set to non-zero value, indicates
inverted
page
261

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents