simple UART b/w PIC & AT micros
Discussion in "PIC Microcontroller Discussion" started by SmandyS Jul 16, 2013.
Tue Jul 16 2013, 12:42 pm
good day all
here is a little problem communicating between two different micros.
here am trying to communicate between AT89S52 & PIC16F877 via uart(cross connection directly in proteus) at 9600 baud rate.
AT89 as master & PIC16F as slave.
independently, both are working fine (with terminal), but when i cross wire them, PIC received garbage value & shows error.
is there anything am missing?
i shall add the proteus files & the code today.
here is a little problem communicating between two different micros.
here am trying to communicate between AT89S52 & PIC16F877 via uart(cross connection directly in proteus) at 9600 baud rate.
AT89 as master & PIC16F as slave.
independently, both are working fine (with terminal), but when i cross wire them, PIC received garbage value & shows error.
is there anything am missing?
i shall add the proteus files & the code today.
Wed Jul 17 2013, 11:14 am
code will be helpful. What kind of error are you getting? overrun etc.?
Thu Jul 18 2013, 12:32 am
hello ajay..
please find attached all the files.
both the codes are in mikroc. communication is being initialized by AT89 by sending 'Y' as a start.
PIC16 wait for the character, identifies it as 'Y' or not and accordingly prints the response on LCD.
here, for AT89, i have used some custom functions for UART as inbuilt UART isn't responding properly.
please look into and advise.
thanks & regards
please find attached all the files.
both the codes are in mikroc. communication is being initialized by AT89 by sending 'Y' as a start.
PIC16 wait for the character, identifies it as 'Y' or not and accordingly prints the response on LCD.
here, for AT89, i have used some custom functions for UART as inbuilt UART isn't responding properly.
please look into and advise.
thanks & regards
Fri Jul 19 2013, 12:16 am
hmm... for 8051
where as on PIC, uart is running at 9600
looks like a problem to me.
//baud rate 0xF3 for 2400 TH1=0XF3; TL1=0XF3;
where as on PIC, uart is running at 9600
UART1_Init(9600);
looks like a problem to me.
Fri Jul 19 2013, 10:55 am
gr8....this is what happens when we just copy-paste the codes...
Thnaks Ajay...
this is another lesson to be learnt, - new code for every new project...
& never copy the whole project as it is...HAHA
Thnaks Ajay...
this is another lesson to be learnt, - new code for every new project...
& never copy the whole project as it is...HAHA
[ Edited Fri Jul 19 2013, 10:56 am ]
Powered by e107 Forum System