Society of Robots - Robot Forum
Software => Software => Topic started by: Asellith on January 27, 2010, 08:52:50 PM
-
I'm trying to compile my code and I'm using an atmega32.
I included this line
#include "sys/atmega32.h"
however I get the following errors
D:\Documents and Settings\JB\My Documents\My Dropbox\OSCAR\Projects\ExModO\OSCAR_Distance\..\..\..\Code\webbotavrclib-1.12/sys/../device.h:196: error: 'TIMER0_COMPAREA' undeclared (first use in this function)
D:\Documents and Settings\JB\My Documents\My Dropbox\OSCAR\Projects\ExModO\OSCAR_Distance\..\..\..\Code\webbotavrclib-1.12/sys/../device.h:196: error: (Each undeclared identifier is reported only once
D:\Documents and Settings\JB\My Documents\My Dropbox\OSCAR\Projects\ExModO\OSCAR_Distance\..\..\..\Code\webbotavrclib-1.12/sys/../device.h:196: error: for each function it appears in.)
Any ideas?
-
You cannot access timer registers directly when using Webbot Lib. I found that out recently too,
http://www.societyofrobots.com/robotforum/index.php?topic=10073.0 (http://www.societyofrobots.com/robotforum/index.php?topic=10073.0)
edit: nm, i didn't read the filepath of the error
-
Aselith
No worries - you aren't trying to access the timer stuff directly (You would get other errors if you did). Perhaps its an ATMega32 issue I haven't found as its not a frequently used platform.
Can't remember off the top of my head whether the ATMega32 supports compare channels on Timer 0 - some AVR don't.
PM me with your code and I'll get back to you.
Webbot
-
Oops, i didn't see that the fault was coming from a device.h file, and not his main code.
-
Yeah - I generate those device files from the xml files from ATmel - but they are soooooo full of errors. I've kinda given up telling ATmel about them and now keep my own version (after all ATmel ain't gonna re-release the chip) with my own fixes. Not sure - but if these files are also used by AVRstudio for debugging then it probably explains why AVRstudio has some flakey debug errors (eg it doesn't honour breakpoints for Timer 5 on the Axon).
So this is probably an error I have inherited from ATmel and not found yet.
-
Well I decided to go a different route while troubleshooting last night and deleted all the previous code and start over with another base. Sorry webbot but your skills are way above mine and I don't have time to play catchup. I can barelly read your code let alone modify it. I still have no clue how you did all the things you did in that code. I decided to eliminate all your code for now and then try to insert my code into your frame work after i get the slave mode working.
I really want to use your sensor code but I need to get my code to work first before I try and use your code for the final phase.
Sorry I couldn't help you debug the code. I'll keep an eye on it after I try to compile the test when I reintroduce your code it might appear again.
-
Fond the bug - and zapped in next release (V1.14)
-
Webbot again you deliver. Thanks. I'm done for tonight but I think I have all the I2C code written and will be testing it tomorrow. I need to modify my master controllers code as well. That should take long. When I confirm I have my slave code working I will try to build your frame work around it and use your sensor code if not I may have more questions. Thanks for the help. I might actually be in this contest yet.