So some time has passed and I’ve had some success with different aspects of my robot.
I’m using a test bed based on an Arduino Duemilianova and Nerdkits display. I’ve hooked the display up as if it was a 3Pi or Orangutan SV-328 and am using Pololu libraries to write to it. Also, I’ve been working on the actual SVP based robot, so both of which are working well.
In testing freeRTOS I’ve been able to configure it based on a choice from some settings in the FreeRTOSConfig.h file to define 328p or not, and also in the make file (for each app) to determine whether 1284p Pololu or 328p Arduino is to be used.
328p is used for the Duemilianova and requires Timer0, which implies no motor library code.
1284p is used for the SVP and uses Timer3, which has no limitations on any known libraries.
//#define ARDUINO_328P // Define this to use the Arduino & Timer0
// Otherwise use Pololu & Timer3
# MCU name
#MCU = atmega328p # Arduino
MCU = atmega1284p # Pololu
#AVRDUDE_PROGRAMMER = stk500v1 # Arduino
AVRDUDE_PROGRAMMER = avrisp2 # Pololu
#AVRDUDE_PORT = /dev/ttyUSB0 # Arduino
AVRDUDE_PORT = /dev/ttyACM0 # Pololu
#AVRDUDE_SPEED = 57600 # Arduino
AVRDUDE_SPEED = 115200 # Pololu
Actually, it is pretty easy to get things working, and swap between the two systems. Currently I’m focussed on getting the i2c bus working to allow the SRT10 sonar and thermopile to work. Also I’ve done some work on the analog sensing. Both are working fine now. Next steps are a PID motor control with quadrature, and z-axis yaw sensor.
One of the nicest things about freeRTOS is not needing to care about timing. Using queues, it is possible to block processes (without tying up resources) until they should run, and using semaphores it is possible to control or limit access to resources (LCD, ADC, I2C Bus, etc) without having to go to critical code.
Some freeRTOS and application code attached, more as a “back up” than anything else.
[deleted as a new version available]
[ Added some more discussion here: DogBot - Post 5 post.ly/fSw6 ]
Phillip