Coding Command Module IRobot Create with MAC

by raulzito234

I’m trying to program the Irobot Create with my MAC and I had some difficulties to make it run.

create

First of all I installed the CMStart1 package to try it out. You can download it here

https://sites.google.com/site/irobotcreate2/home/files/CMStart1.zip?attredirects=0

(IF you want to read a little bit more about the project go to: https://sites.google.com/site/irobotcreate2/commandmodue )

Then you need to install all the libraries for avr. You can download them directly from here:

http://www.obdev.at/products/crosspack/index.html

Follow the instructions on the website and don’t forget to restart the terminal window.

After installing it you will need to compile the code.

run the following command:

>> make

The compiler will probably complain, because SIG_OUTPUT_COMPARE1A is poisoned and it is going to be deprecated in the future. So there is a need to change the code to make it  work. A possible solution is to maybe try adding a:

-D__AVR_LIBC_DEPRECATED_ENABLE__

to the pre-processor options if you insist on trying to maintain code with the poisoned SIG_OUTPUT_COMPARE1A. This solution has been posted int he forum: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=128496

Another possible solution is to change the deprecated SIG_OUTPUT_COMPARE1A for a new one depending on the device that is being used. The complete table of symbols can be found at http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html

Since the IRobot Create comes with an AVR ATMega168, it needs to be substituted to:

TIMER1_COMPA_vect

After substituting it, you will be able to run:

>> make

After this it’s necessary to upload the command module I’m doing it through a USB cable. I need to first find the name of the port that this USB is connected, thus I look into the folder /dev using the commands:

>> cd /dev/

>> ls

Then you should look for the tty.usb. In my case the USB port is /dev/tty.usbserial-A9005Qaa. Press the reset button and then  use the following command:

>> avrdude -p ATMega168 -c stk500v1 -P /dev/tty.usbserial-A9005Qaa -U flash:w:cmstart1.hex

There is a tutorial on how to use the command above here: http://www.ladyada.net/learn/avr/avrdude.html if you need more help.

Advertisements