Hasher
Junior Member level 1
I'm using PIC18F2420 with mikroC 8.2 with EasyPIC5 development board
I want to view the serial data I read on PORT B
I tried this code but I got nothing on it:
I want to view the serial data I read on PORT B
I tried this code but I got nothing on it:
Code:
unsigned char i;
void main() {
TRISB = 0;
USART_init(19200); // initialize USART module
// (8 bit, 19200 baud rate, no parity bit...)
while (1) {
if (USART_Data_Ready()) { // if data is received
i = USART_Read(); // read the received data
USART_Write(i); // send data via USART
PORTB = i;
Delay_ms(1000);
}
}
}