Go Down

Topic: Can I use an Arduino Nano as i2c slave and still use all three timers (Read 350 times) previous topic - next topic

einsofa

I am building a device which receives some input and produces some output, the latter via 3 devices:
  • an RGB LED
  • a passive buzzer
  • a 16x2 LCD display

I would like to split up the construction in a way that one Adruino Nano is solely responsible for the output (thus I'm calling it „output controller" henceforth) and controls the LED, the buzzer and the display, the other Arduino Nano, the „main controller", reads input and instructs the other Arduino to produce an according output.

Now, I would like the main controller to send instructions via i2c to the output controller (so naturally main controller will be master, output controller slave). However, I am not sure if I run into a problem because the output controller needs all timers for its output:

  • The RGB LED needs 3 PWM signals, i.e. 2 timers required (in my current Setup, I use pins D3, D5 and D6 to send a signal to the LED, so they use timers 0 and 2
  • For the buzzer, I use the NewTone library which uses timer 1

Does that interfere with using i2c? I remember reading somewhere (can't find it anymore though) that i2c does not use any of the timers but might still interfere with PWM output or tone output or something along those lines.

So is my idea doomed? :D Wouldn't be terrible, I could e.g. move the buzzer control to the main controller - I just found the idea of having a dedicated output controller rather intriguing.

Thanks in advance and I'm sorry if this is the wrong subforum to ask!

Go Up