Discussion in "PIC Microcontroller Discussion" started by    SmandyS    Jul 16, 2013.
Tue Jul 16 2013, 12:42 pm
#1
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.
Wed Jul 17 2013, 11:14 am
#2
code will be helpful. What kind of error are you getting? overrun etc.?
Thu Jul 18 2013, 12:32 am
#3
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
Fri Jul 19 2013, 12:16 am
#4
hmm... for 8051
//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
#5
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


[ Edited Fri Jul 19 2013, 10:56 am ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am