1

On my Uno, I set up the HoodLoader2 (link below) so I can program both the ATMega16u2 and the ATmega328P. I can communicate between the two using the serial port. However, I need the serial port to communicate between the Uno and the PC. Can I communicate between the 328 and 16u2 using a common digital pin? All I need to communicate is a simple yes/no state, preferably in both directions. In other words: can I connect a digital pin (say 12) on the Uno to, say, PB1 pin on the 16u2's ICSP header, set pin 12 value to HIGH on the 328P, then read that state on the 16u2 via PB1? And vice versa, via another pair of pins? There's a Q that's close to what I want (link below) and the user there (@jsotola) seems to have the knowledge, but I can't comment under his comment, as I don't have 50 reputation.

HoodLoader2

Accessing digital pins from the ATMega16u2

1 Answer 1

3

You could use from PB1 to PB3 from 16u2 (SCK, MOSI, MISO) wich are exposed to its ICSP. Add a wire from one of them to your atmega328 :)

4
  • Thanks. What does "PB" stand for? Is this a "normal", digital pin, with HIGH and LOW states?
    – MrSparkly
    Commented Aug 15, 2018 at 7:05
  • It means port B (PB1 physical pin 15 to PB3 pin 17). Don’t Know how hoddler name the pins :) here you’ll fins the uno schematic arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
    – Bouc
    Commented Aug 15, 2018 at 7:09
  • This is the original ATmega pin naming and stands for Port B, pin 1. all the pins are separated into banks (ports) of 8 pins each. For pin functions, refer to the relevant datasheet: ww1.microchip.com/downloads/en/DeviceDoc/…
    – mystery
    Commented Aug 15, 2018 at 8:54
  • It seems that SCK MOSI and MISO correspond to D1, D2 and D3 (github.com/NicoHood/HoodLoader2/wiki/…) on the 16u2. And yes they are digital « normal ;) » pins
    – Bouc
    Commented Aug 15, 2018 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.