0
\$\begingroup\$

I'm trying to make two atmel AT89C2051's communicate with each other serially but the serial ports on either won't be available because one serial port on one chip connects to the computer and the other one on the other chip connects to a radio unit.

So my thought is to connect an output port (like P1.5) on one microcontroller to P3.2 on the second one to act as a clock, and connect an output port (like P1.4) to P3.7 on the second one to act as data.

I use P3.2 as clock input since its supposed to trigger interrupt 0.

My question is will an external pull-up resistor be required even though I'm not using P1.0 or P1.1? and if so, what is the maximum value the resistor should be?

\$\endgroup\$
  • \$\begingroup\$ Some things to be aware of: 1. Make sure output high/low voltages of "master" and input high/low voltages of "slave" are compatible. But since you will be using the same micro, this already might not be an issue. 2. Rather than a pull-up resistor, I would consider using a series resistor in between in order to avoid shorting problems. \$\endgroup\$ – Durmus Sep 8 '16 at 5:43
  • \$\begingroup\$ I am using a master/slave setup. Each microcontroller will send and receive data and clock signals on unique ports. No two signals will use the same port. \$\endgroup\$ – user116345 Sep 8 '16 at 15:18
2
\$\begingroup\$

P1.2 to P1.7 and P3.0 to P3.5 have internal pullups, so you don't need external resistors unless the rise time is too slow (long cable + high bit rate?).

P1.0 and P1.1 don't have internal pullups, but as you aren't using them you can just set them to output low so they don't don't 'float'.

Unlike more modern MCUs the 8051's port pins are not actively driven high, so you don't need series resistors to prevent damage if they are short circuited to Ground or another output.

\$\endgroup\$
  • \$\begingroup\$ Each micro I'm using is driven by a 20Mhz crystal. What should I limit my data rate to before resistors are required? And I'm running the two micros next to each other on the same circuit board so I don't think ill need to worry about cable resistance. \$\endgroup\$ – user116345 Sep 8 '16 at 15:23
  • \$\begingroup\$ A long cable could have enough capacitance to skew the timing, but the 8051 is pretty slow (most instructions take 12 or 24 clock cycles) so even at 20MHz the data rate will be slow enough if the chips are right next to each other. \$\endgroup\$ – Bruce Abbott Sep 8 '16 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy