Society of Robots - Robot Forum

Software => Software => Topic started by: Crunchy Theory on January 10, 2011, 11:48:36 PM

Title: Webbotlib + Atmega8 @ 8MHz
Post by: Crunchy Theory on January 10, 2011, 11:48:36 PM
Has anyone used webbotlib for the $50 robot that was upgraded to run at 8MHz?

I had already completed the $50 robot with Sharp IR and UART upgrades (which required 8MHz operation) using SoR utils. Now I'm trying to move the code over into webbotlib and I'm having trouble figuring out if or where I need to tell webbotlib that it's running at 8MHz.

I am using dunk's makefile (from his tutorial) to build my projects from command line, and I've set already set the CPU speed to 8MHz in there. Is that all I should need to do?
Title: Re: Webbotlib + Atmega8 @ 8MHz
Post by: Webbot on January 11, 2011, 07:36:36 AM
When you start a new project in Project Designer you have to select a board. Most boards like the Axon have a fixed clock speed as there is an on-board crystal. But for the $50 stuff then you will see it lists various options each with a different processor speed.

For an existing project then Project Designer shows you the selected options in the top left corner.

Note the Project Designer only shows $50 boards based on the ATMega168 and ATMega328 - since the ATMega8 doesn't have much program space.
But you could change the makefile to use the ATMega8 - but just make sure that it is linking in the ATMega8 library. Yes you can change the cpu speed in the makefile.

Note that the latest version of Project Designer creates a makefile for you - note that it creates this file every time you generate the code ie it will overwrite the file.