??? 03/16/04 04:08 Read: times |
#66806 - RE: Connection two mcus via the P0 port Responding to: ???'s previous message |
Hallo Marek,
yes, this is possible (if I understood you correctly...). In the following I assume, that master and slave are 80C51 like, referring to Ports' performance. This application demands the use of a free /INT line of master. Otherwise slave does not know, whether data was actually read by master or not! A solution with using free /INT line of slave is also possible. If /INT input is not available, some sort of handshaking would be suited. Assuming that master and slave have all Port0 lines programmed as inputs, Port0 lines of both mircos are connected together and pull-ups (4k7...10k) are connected to the individual connection points, something like this could be used: Slave tells master that he is able to deliver new data, e.g. by taking Port0.7 line low. Then, if master has recognized by periodically polling Port0.7 line, that slave has something new, he (the master) can set low another Port0 line, may be Port0.6. Slave notices this by reading Port0.6 line, deactivates Port 0.7 line (gets high state again) and delivers data at Port0.0...0.6 lines. Master notices, that Port0.7 line is in high state again, deactivates Port0.6 line and reads Port0.0...0.6 lines. Everthing repeats, if Port0.7 line is taken low again by the slave.... 'Deactivating' here means to program according Port0 line as input, means to write '1' to according SFR. Some additional points: -Master and slave can only read Port0 lines, if these are programmed as inputs, means if '1' was written to according SFR. -Port0 lines of standard 80C51 micro does only consist of a single NMOS-FET connected as 'open drain' (unless Port0 is used to address external memory, then push-pulls are activated!). Logical high state can only be provided by the help of pull-up resistor. If NMOS is turned off, pull-up guarantees logical high state. If NMOS is turned-on, output delivers low state. -Keep in mind, that open drain gates are rather slowly, much slowlier than push-pull outputs. This is caused by the high impedance of pull-up resistor in combination with unavoidable stray capacitance. So, if you want to achieve fast switching, keep stray capacitance small and use rather small pull-up resistor. But have a look at datasheet of micro to what amount pull-ups may be reduced. In any case, master is only allowed to read data coming from slave AFTER Port0 lines have stabilized!! Kai |
Topic | Author | Date |
Connection two mcus via the P0 port | 01/01/70 00:00 | |
RE: Connection two mcus via the P0 port | 01/01/70 00:00 | |
Wait... | 01/01/70 00:00 | |
RE: Connection two mcus via the P0 port | 01/01/70 00:00 | |
RE: Connection two mcus via the P0 port | 01/01/70 00:00 | |
RE: Connection two mcus via the P0 port | 01/01/70 00:00 | |
RE: Connection two mcus via the P0 port | 01/01/70 00:00 | |
RE: Connection two mcus via the P0 port | 01/01/70 00:00 | |
Could we help you, Marek? | 01/01/70 00:00 | |
RE: Could we help you, Marek?![]() | 01/01/70 00:00 |