I just read the wiki about uarts. Altough interesting, I don’t quite see how this helps me. A uart will actually provide the frame around my data by adding a startbit and a stopbit. That was the reason I wanted to use a standard pin in the first place, because I did not want to use the uart.
You pointed me to the output compare functionality. Could you please explain how to send a byte at 1200 baud using this technique? I think I understand what needs to happen signalwise, now its time to learn how to achieve this.
What I tried was something like this:
Declare an array with 8 bits of data in it.
Use a for loop to itterate trough the array members
Make the outputpin equal to the value of the current array member
Make the thread sleep for 0.833 ms (100/ 1200 = 0.833)
I’m working on my iPad now, thats why I’m not providing actual code, but you get what I mean right?
This actually kind of works, but ofcourse the timing sucks. First of all, I could not get the sleep method to accept something smaller than 1ms. Second, even with one ms, I still see way to slow results on the scope. Don’t understand why, but its what I saw.
I also tried a similar setup with a timer, but sort of same result.
How could I leverage the output compare into sending my bytes at 1200 baud?
Thanks again for your help.