This is a simple implementation of a serial comunication protocol, based on RS-232, on Arduino, for Computer Networks class.
- Guilherme Ramos Costa Paixão - 11796079
- Adrio Oliveira Alves - 11796830
- Eduardo Vinicius Barbosa Rossi - 10716887
This code was made for Arduino UNO. For other Arduinos versions, you may have to change it's registers.
If you use Arduino's IDE, you can just open the project on it aaand run!
If you prefer to use some other IDE or Text Editor, you have this power too!
- Add your user to UUCP group (you may use sudo for this)
usermod -aG uucp YOUR-USER
- Restart your system
- Check if cdc_acm module is already activated in your system:
lsmod | grep cdc_acm
- If nothing is returned, than you need to activate it (you may need sudo):
modprobe cdc_acm
- If you wish to load this module automaticaly each time your system boots, if your're using systemd: (you may use sudo)
echo "cdc_acm" > /etc/modules-load.d/cdc_acm.conf
yea, I don't like it too...
- Install arduino-cli
- Create the configuration file:
arduino-cli config init
- Install your arduino core drivers. This code was made for Arduino UNO, so:
arduino-cli core update-index
arduino-cli core install arduino:avr
- Now you can compile and upload to your board using the Makefile.
- OBS: You must
make configure
every time you plug your rduino in.
- To get arduino's output just execute
./listen
and to send an input,./send YOUR-INPUT
This protocol specifies the transmission for each byte and it bit parity
- Emissor sets RTS to 1 and waits for CTS signal
- When receiving RTS signal, Receptor sets CTS to 1
- Emissor, then, begins the transmission with the clock
- For each clock transition (0 to 1), receptor reads data from TX port
- In the end of the reception, the emissor stops the clock and clean RTS to 0
- When receptor stops receiving RTS signal, it verifies the bit parity
- If the parity is right, it prints the data.
- The receptor, then, puts the CTS to 0.