Azzy anxious
Junior Member level 2
- Joined
- Jan 28, 2014
- Messages
- 23
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 3
- Activity points
- 161
Hi guys,
Can anybody help me regarding uart communication with 3 microcontrollers.
One as a master and other two as a slave devices.
I m working on 89s52 micro-controllers, even i m able to communicate between one slave and master at a time bt when i m trying to communicate two slaves wd master,its not working.....
i m using above codes for receiving data from both slaves......
Help me guys..........:sad:
Can anybody help me regarding uart communication with 3 microcontrollers.
One as a master and other two as a slave devices.
I m working on 89s52 micro-controllers, even i m able to communicate between one slave and master at a time bt when i m trying to communicate two slaves wd master,its not working.....
Code:
void uart_init()
{
TMOD = 0x20; // timer 1 8-bit auto-reload
SCON = 0x50; // Tx and Rx enable
TL1 = 0xFD; // Baud Rate 9600 8-n-1
TH1 = 0xFD; // Reload count
TR1 = 1; // Start timer
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Receiving 8-bit data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
unsigned char read()
{
while(!RI);
RI = 0;
return(SBUF);
}
void uart_send(unsigned char value)
{
SBUF = value;
while(!TI);
TI = 0;
}
i m using above codes for receiving data from both slaves......
Help me guys..........:sad:
Last edited by a moderator: