2012年1月9日星期一

Based on 51 SCM multimachine parallel communication system

2.2 two-way transfer
Two-way communication mouth can also transmit is receiving data and transmit data, data flow is a two-way street, Ul_L and U2_H is receiving data also transmit data. This way the software programming is more complex, especially two-way transmit data using inquires when way. The inquires between the
http://www.siliconray.com/microcontroller signal more sophisticated. Now is two-way inquires the way as an example, the transfer of data between two single chip microcomputer flow chart as shown in figure 4 shows, U2_H process and U1_L. Among them U1_L U2_H transmit data to the signal and the transfer of one-way query definition, the U2_H P2.3 as U1_L new data transfer to the inquires the signal (the U1_L P2.4), P2.3 = "0" said new data are, P2.3 = "l" said no new data; The Ul_L P2.3 as receiving U2_H data query signal (the U2_H P2.4), P2.3 = "O ?
2.3 the application note
Two single chip microcomputer handshake between if the interrupt, because U2_H to send data U1_L receive external than external data quickly, Ul_L U2_H to transmit data, it is unnecessary to consider U2_H state, and U2_H U1_L to transmit data, due to U2_H receive external data U1_L than to the outside sending data quickly, U2_H must Ul_L inquires the state, that is, if U1_L in receiving U2_H data state, otherwise, U2_H won't be able to Ul_L transmit data.
If as RS_485 communication interface use, just click on the figure 2 a change in the circuit and increase the 75176 chip control of reading and writing, and two single chip with the main communication equipment connected microcontroller as the host, through the P2 mouth the a to coordinate two MCU is receiving data or transmit data.
Note the ?

没有评论:

发表评论