dbasberg wrote:I searched for rates people are using without errors. Most posts are about failures of their program to communicate properly. So, I ask what rates of serial comm have been used successfully between RPI and ATmega (on the GertBoard)? The examples are all at 9600 baud with display on minicom. In my project, this serial comm will be watched on both ends by a command line interpreter routine. The ATM will be slaved to the RPI. The systems overall response time will be dependent on serial comm speed, so higher rates will help alot. Has anyone used 38.4K or higher successfully? Of course, when I get my initial code running, I need to try rates in my particular setup. I will report my results then.
On a second note, I will need a periodic interrupt to schedule tasks and read I/O. The nice assortment of example code for the ATmega does not have any interrupt examples except for external pin interrupts. A nice periodic timer interrupt example would help a lot of people I think. I can create this myself because I have done commercial software with other processors which gives me experience. Is it a good idea to have a periodic interrupt example in the Arduino IDE file set?
I did a lot of testing at 115200 baud. Seemed to work OK, but my tests were only exchanging short messags (< 100 bytes) at a time. However I was initially programming the ATmegas via serial at 115200 baud and that went OK.
If you want to put a timer in your ATmega code, then there are plenty of examples, but be aware that the timers are currently setup by default to drive the PWM pins on the Atmega if you're using the Arduino wiring libraries. (ie. if you chang them, then the PWM might stop working)
I have an alternative that provides a task scheduller, but I've not had time to package it up for anyone other than me to use yet )-: