Upon the utter failure of the previous attempt, I decided to try and look into something that was “premade” and optimized more than anything I could have done with my own blocks. This led me to explore asynchronous transmission.
Asynchronous transmission allows a receiver to decode the transmitter’s data without needing the help of clock recovery or some sort of external clock line like i2c or SPI. This made it a very very attractive alternative to other transmission schemes as I would only need to use one LED for the transmitter. The reason this can be done is because the baud rate (bits per second transmitted) has to be agreed on which can be hard coded or chosen by a person.
While this is an attractive solution, by incorporating both start, stop, and gap bits, the bandwidth required to transmit the same amount of data is much higher. However, I was willing to make that trade off for the advantage of using only one data line.
In addition to this one of the reasons I chose to use asynchronous transmission is because the Arduino already has a serial transmission library built in. This also applied for Arduino’s Simulink library. The blocks included are as follows.
The advantage of these two blocks are that I do not have to design my own scheme for the number of gap bits, nor do I have to define what is a stop/start bit. Serial transmit receives a 8 bit unsigned integer (0-255) and transmits it. Serial receive receives the data (0-1023) and status is high when data is received and 0 when the block fails to receive data. One thing of note (and the thing that took me a while to learn to abuse) is that if your receiver is working correctly, it will only produce a high upon the first received piece of data.
This will serve as the trigger to activate the receiver allowing us to start and stop the receiver whenever we desire without any data loss. This also accounts for when transmission randomly stops due to interference. As a proof of concept I returned to my original design for the transmitter and receiver using the serial transmit and receive blocks.