[clug] Serial communications between Atmel processors
paulway at mabula.net
Sat Nov 15 16:52:11 MST 2014
-----BEGIN PGP SIGNED MESSAGE-----
A quick update to say that I now have two ATTinys communicating with each
other and turning their LEDs on and off in the required manner. The key
1) I had 'pin 5' as the second LED in the code but the LED was connected to
pin 3, which is why I never saw the second LED change.
2) I was using digitalWrite to write analogue values, so I never saw the
Realising fact 1 was an amusing process. After determining that both LEDs
were actually working, I thought maybe "pin 5" couldn't drive enough current
to light up the LED. So I was going to change it to the unused pin 2 (on
the other side of the board from pin 4), which led me to count the pins
again and made me realise I'd skipped one...
Pretty much everyone who responded to my email, on and off list, said to
simplify it down and check the basics first. That is the most reliable way
of debugging, and the best way of building - start with what you know, and
work from there. And, amusingly, when I tried the simple signaller, I got
to the same problem - 'pin 5' wasn't turning on LED 3.
The complication for me was that I had already looked at writing my own
serial interface using the techniques described and people had said "why are
you doing that, just use the SoftwareSerial library!" Sometimes there's a
quantum of difficulty that you have to step up in order to make progress -
while taking small steps can sometimes reduce the gap size, it can't
eliminate it entirely.
Anyway, now to find out how fast they can communicate, and how many I can
have talking in a string...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
-----END PGP SIGNATURE-----
More information about the linux