Please pretend I’m a newbie and give lots of details (because I am when it comes to this subject).
actually this can be quite the beginner project depending on how fancy you want to get. iirc it took less than an hour to get a first version running yet proved to be of practical use for many applications over the years. the key is “walk before you run” approach aka “progressive iteration”:
using standard arduino uno or promini setup make sure you can send a single serial byte from the arduino monitor and have it output to digital pins. the led comes in handy here and should make this a tit job.
implement two byte scheme prefacing the id byte described earlier. initially a hard coded number in master and slave. then maybe add the read from port and send back to master function. still just one slave with fixed address hanging off a pc making it easy to work out these parts of the protocol.
go to multi-slave arrangement maybe try putting the id in ee at this point too instead of hard coded. also a good time to try hooking up more than one slave and get that running.
if like somedude you want to go arduino-to-arduino instead of pc then throw together a program for a master chip. this is trivial compared to slave program because all you are doing is sending out bytes and complexity really depends on the application. remember kiss and “walk before you run” and it should be a cinch.
for instant gratification ive attached a hex file using protocol similar to that in post #7. originally created for mega8 it uses pb1 for rx and puts up the byte received on portb. at 16mhz the baud is 57kbps and at 8mhz (no xtl) 28.8kbps. a newly flashed chip will have ff in the last ee location so any id will work. for example entering any key then ‘c’ turns pb5 led on and any key then ctl-c turns off.
this same file works on tiny13, t25, t85, t24, t46/461, mega8515, and probably dozens of other avr that have “classic” io map.
even though the program is only a couple dozen bytes in size its been used for applications ranging from holiday lights to industrial wire factory installation. there is a mega328 version floating around here somewhere and i will try to find if theres interest. m8 is my goto chip so was easy for me to read one and post.
multi802.hex.txt (284 Bytes)