Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can anyone help- UART Commn

Status
Not open for further replies.

rameshelectro

New Member
I used microC for pgmming 18f4520. the pgm aim is to transmit the same data back to terminal.But what i get is different.
send data:hi dere
received data:ø8øø
Code goes here:

void main() {

unsigned char Temp;
trisb=0x00;
Uart1_Init(9600);
Delay_ms(25);
latb.b1=1;
Delay_ms(50);
UART1_Write_Text("Start");
UART1_Write_Text(" ");
latb.b1=0;
for(;; )
{
while (!UART1_Data_Ready());
Temp = UART1_Read();
latb.b1 = ~latb.b1;
Delay_ms(50);
UART1_Write(Temp);
latb.b1 = ~latb.b1;
Delay_ms(50);

}
 
check the baud rate on your pc, check your crystal.. (if you are using one)
 
check whether the internal oscillator is calibrated correctly... the config bits of pic 18f series are a bit confusing. Double check the config bits.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top