uart code in mikroc pro
uart code in mikroc pro
i want an example code of uart at mikroc pro as really i am confused about it and can't make the whole code and thanks in advance
Re: uart code in mikroc pro
Hi,
You can find UART examples in the following folder in the mikroC compiler :
\Examples\Development Systems\EASYPIC7\UART\
For detailed explanation, please see UART library topic in the help file.
Regards,
Filip.
You can find UART examples in the following folder in the mikroC compiler :
\Examples\Development Systems\EASYPIC7\UART\
For detailed explanation, please see UART library topic in the help file.
Regards,
Filip.
Re: uart code in mikroc pro
Hello.
I'm also having trouble with UART using FT232RL on PIC16F688.
I've connected FT`s TX and RX lines vice versa to hardware UART pins on PIC. I'm using Internal 4Mhz clock in PIC. Here's code used from Examples folder of PIC:
In terminal emulator on PC (Putty) insted of "Start" command line shows "Ъ│#oТш", and if i press for example key "A", ir return char "ю". Where to search an explanation how to solve this Thanks.
I'm also having trouble with UART using FT232RL on PIC16F688.
I've connected FT`s TX and RX lines vice versa to hardware UART pins on PIC. I'm using Internal 4Mhz clock in PIC. Here's code used from Examples folder of PIC:
Code: Select all
char uart_rd;
void main() {
CMCON0 = 0x07;
ANSEL = 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
}
}
}
Re: uart code in mikroc pro
Hi Elektrik,
This seems to be the issue with oscillator or the baud rate.
Please, check these things and make sure that they are correctly configured.
Regards,
Filip.
This seems to be the issue with oscillator or the baud rate.
Please, check these things and make sure that they are correctly configured.
Regards,
Filip.
Re: uart code in mikroc pro
Today I've atached external 4Mhz oscillator, configured as XT, and hardware UART works like a charm! Seems like internal oscillator`s frequency is dependant on phase of the moon, and only thing works brillianty with interna osc. is turning LED on and off Thanks mate!filip wrote:Hi Elektrik,
This seems to be the issue with oscillator or the baud rate.
Please, check these things and make sure that they are correctly configured.
Regards,
Filip.