# [PIC]Hi, I'm using the sofware UART lib.. but the problem is that if there is no characat

Status
Not open for further replies.

#### medocntrl

##### Newbie level 2
Hi,

I'm using the sofware UART lib.. but the problem is that if there is no characatere to be received, it still waiting in the function...

Code:
char i, error, byte_read;                 // Auxiliary variables

void main(){

TRISB = 0x00;                           // Set PORTB as output (error signalization)
PORTB = 0;                              // No error
TRISC=0;
PORTC=0;
error = Soft_UART_Init(&PORTC, 7, 6, 9600, 0); // Initialize Soft UART at 14400 bps
Soft_UART_Write('s');
while(1) {                              // Endless loop
PORTC=~PORTC;
}
}

Last edited by a moderator:

#### paulfjujo

hello

Code:
 error = Soft_UART_Init(&PORTC, 7, 6, 9600, 0); // Initialize Soft UART at 14400 bps
.......
........
PORTC=~PORTC;

You can not modify PORTC like this, because use of UART !!!
you can modify only unsued bits of PORTC..

Wich MCU used ?
What is your C language ?

Status
Not open for further replies.