AshleeMakaya
Newbie
hi am having problems with uart communication. am trying to send a simple text "Start" to the virtual terminal but it outputs gabbage.
i am using proteus and mikroc
i am using pic18f45k22
i am using proteus and mikroc
i am using pic18f45k22
Code:
char uart_rd;
void main() {
ANSELC = 0; // Configure PORTC pins as digital
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize
UART1_Write_Text("Start");
UART1_Write(13);
UART1_Write(10);
while (1) { // Endless loop
if (UART1_Data_Ready()) { // If data is received,
uart_rd = UART1_Read(); // read the received data,
UART1_Write(uart_rd); // and send data via UART
}
}
}