We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am working on a project having three micro controllers.... Out of these three one is master and others are slave.... according to pin conditions of slave,it send some value which is recieve by the master and showed at lcd.... When I use one of the both slave then it is working properly but when I use both the slave it is not working... My programming for this..
void uart_init() { TMOD = 0x20; SCON = 0x50; TL1 = 0xFD; TH1 = 0xFD; TR1 = 1; }
void uart_send(bit_8 value) { SBUF = value; while(!TI); TI = 0; }
bit_8 uart_receive() { while(!RI); RI = 0; return(SBUF); }
I am using same program in both slave becoz both have same circuit...but the value send by the slave are differ...
IF ALL uCs ARE ON THE SAME BOARD: if both slaves have TX as quasi or OD and you use a pullup resistor, it will work with a proper protocol
Erik
The tricky thing with a number of 8051 chips is that for GPIO they may behave like a classic 8051 but switch the pin for UART TX to a full totem output when the UART is used.
I know some that do; however, it can be changed by manually handling the configuration instead of BLINDLY relying on some configuration software.
. @erik.. Both of the slave are connected directly to the Rx pin of the master... I have studied that I have to give address to both the slave and master.. But I don't have any idea about how to give address and how to to call them.... Here i am working on a circuit i can not do any changes to it... I can only change my program... So any idea about programming...?