Author Topic: Controlling one microcontroller with a second microcontroller  (Read 808 times)

0 Members and 1 Guest are viewing this topic.

Offline Dave WaveTopic starter

  • Contributor
  • Posts: 42
I am working on a project with an ESP8266 microcontroller. One of the digital pins is held high with a pull up to 3.3v. When a switch is closed, the line goes to ground, it triggers an interrupt in the ESP8266, which then logs the event.

This part works fine.

What I want to do is to get rid of the switch and ground, and drive the line low with at Attiny85.

With a pull-up resistor and 3.3V source tied to the pin on the ESP8266, can I connect that line one of the digital pins on the Attiny85, and use that to pull the line low (digitalWrite(Pin, LOW))?

Both chips are powered from the same power supply.

Will this work? Do I need to change the value of the pull up resistor (220 ohm )?

Thanks

-Dave
 

Offline a59d1

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
Re: Controlling one microcontroller with a second microcontroller
« Reply #1 on: June 30, 2018, 03:29:54 am »
The pull-up value doesn't really matter - a dead short would be fine instead if you never needed to pull the line low - but most people go for a larger value around 1K to reduce the current wasted when the pulled-up line is pulled down by a uC. No need to burn 15mA just for an interrupt signal!
 

Offline bson

  • Supporter
  • ****
  • Posts: 2270
  • Country: us
Re: Controlling one microcontroller with a second microcontroller
« Reply #2 on: June 30, 2018, 02:03:49 pm »
You don't strictly need a pullup at all if you connect it to a GPIO output.  Keep the output high and momentarily strobe it low to log an event. When used like this you want a pullup mainly so the signal has a known state during power up or if the controlling CPU resets.  In this case you want a weak pullup, with around 10k-47k being typical.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Controlling one microcontroller with a second microcontroller
« Reply #3 on: June 30, 2018, 07:56:24 pm »
I prefer to add a 330 Ohm resistor to all IO pins but I would just use one where the signal is pin-to-pin.  The value is low enough that it doesn't alter timing but it does prevent a short circuit - like when both pins are configured as outputs and set to opposing logic levels.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf