- This topic has 3 replies, 2 voices, and was last updated 11 years, 4 months ago by .
- You must be logged in to reply to this topic.
We value your privacy
We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.
We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.
The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ...
Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.
No cookies to display.
Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.
No cookies to display.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.
No cookies to display.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
No cookies to display.
Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.
No cookies to display.
Home › Forums › Microcontrollers › PIC Microcontroller › pic16f877a interfacing with pc
Tagged: microcontroller, PIC, USB to UART
Hello There,
I am trying to send a message from pc to pic16f877a and want to display it on lcd. But problem is that no matter the message length that i am sending from pc ,i am able to receive and display only 2 characters on lcd. I am sending you the code. Looking forward for a reply. By the way i am using mikroC for writing the code.
Thank you,
rahul
/*/ LCD module connections*/
sbit LCD_RS at RB7_bit;
sbit LCD_EN at RB6_bit;
sbit LCD_D4 at RB5_bit;
sbit LCD_D5 at RB4_bit;
sbit LCD_D6 at RB3_bit;
sbit LCD_D7 at RB2_bit;
sbit LCD_RS_Direction at TRISB7_bit;
sbit LCD_EN_Direction at TRISB6_bit;
sbit LCD_D4_Direction at TRISB5_bit;
sbit LCD_D5_Direction at TRISB4_bit;
sbit LCD_D6_Direction at TRISB3_bit;
sbit LCD_D7_Direction at TRISB2_bit;
// End LCD module connections
unsigned char uart_rd;
int i;
void main() {
uart1_init(9600);
delay_ms(100);
Lcd_Init(); // Initialize Lcd
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);
while(1){
if(uart1_data_ready()==1){
delay_ms(100);
uart_rd=uart1_read();
lcd_chr_cp(uart_rd);
}
}
}
I also experienced this problem, while using uart and wifi module… I think this problem is due to less buffering space in pic microcontroller…there is only one RSR register for saving the received data…. So if the received data is not read, no data will be received further…
So try transmitting byte by byte..
Thanks Ligo
can you please program it in mikroc and send the codes ?
Try it yourself.. it is simple…
When sending data from PC to PIC.. send it byte by byte…… If you need to send a sentence…
just transmit and receive byte by byte… and you can use a terminator (eg: ‘.’ for the end of a sentence) to know the end of a sentence….
PIC Microcontroller also has interrupt feature… you may use it, to reducing the continuous uart reading load ….