go_away

Author Topic: WebbotLib servos.h prob. with Atmega8  (Read 2094 times)

0 Members and 1 Guest are viewing this topic.

Offline PierreTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Helpful? 0
WebbotLib servos.h prob. with Atmega8
« on: November 08, 2009, 08:47:32 AM »
Hi,

     I am giving a try testing the Webbot library 1.12 on servos.h using the ATmega8

     Using servos.h code from the manual I get many errors and the first is:

     error 'D1' undeclared here (not in function);

     SERVO left = MAKE_SERVO(FALSE, D1, 1500, 500);

     This tells me the iopin D1 is not recognised I am missing a library right?  

     I have put these library:
  
          libm.a;
          libc.a; and
          libWebbot-ATMega8.a

     Greatly appreciated for any helps

Going to pay my respect to Veterans for Memorial day.  Cheers
« Last Edit: November 08, 2009, 08:49:51 AM by Pierre »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: WebbotLib servos.h prob. with Atmega8
« Reply #1 on: November 08, 2009, 10:31:53 PM »
Put the libraries in this order:

libWebbot-ATMega8.a
libm.a
libc.a

Its a 'feature' in AVR Studio that took me forever to figure out. If you still get errors, just copy/paste a few of them.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: WebbotLib servos.h prob. with Atmega8
« Reply #2 on: November 09, 2009, 06:52:54 PM »
I presume you also added the following to the start of your own program
Code: [Select]
#include "sys/ATMega8.h"
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline PierreTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Helpful? 0
Re: WebbotLib servos.h prob. with Atmega8
« Reply #3 on: November 10, 2009, 04:57:05 PM »
Admin:   :)  Good to know.  I keep in mind

Webbot:   :)  Thank you.  Did it.  Although  I got errors on these three(3) below:

    
Quote
    Timer.h: 198: undefined reference to 'pgm_Timers'
     timer.c: 782: undefined reference to ' NUMBER_OF_TIMERS'
     core.c: (.text+0x8c): undefined reference to 'appInitSoftware'
    It is similar with 'sysInitHardware'

I am sure I am forgetting something simple.  I go out the box, relax, drink coffee then think, do some test but no luck.

      Before I learned about webbotLib, I was reading your tutorial on servos.  This is great knowledge but not easy to get it work but I love it.  Right now I am playing with webbotLib so I could test it and hope to use in the futur.

Thank you.  I really appreciated the support.   :)    
« Last Edit: November 10, 2009, 05:00:45 PM by Pierre »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: WebbotLib servos.h prob. with Atmega8
« Reply #4 on: November 10, 2009, 06:26:06 PM »
Send me your source files - ie PM/email me. There's obviously something simple that you've  got wrong - but its hard to tell without sight of the source code.

Also - how are you compiling your program? Are you using AVRStudio or have you written your own command line makefile?
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline PierreTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Helpful? 0
Re: WebbotLib servos.h prob. with Atmega8
« Reply #5 on: November 11, 2009, 03:02:50 PM »
Yes.  Webbot, I am using AVR Studio with AVRISP mkII

'Waitout'  I have probably failed to setup my environment correctly.
 
     I have wrote your "My first program" Hello world from the pdf file and came up with 25 errors.

     Taking no chance removing and reinstalling both AVRStudio and WinAVR.   

     

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: WebbotLib servos.h prob. with Atmega8
« Reply #6 on: November 11, 2009, 03:13:04 PM »
Quote
I have wrote your "My first program" Hello world from the pdf file and came up with 25 errors.
Verify what you copied/pasted is the same as in the pdf file.

Just post your code here, we can help.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: WebbotLib servos.h prob. with Atmega8
« Reply #7 on: November 11, 2009, 06:23:11 PM »
You have sent me your files and your errors are because you haven't told AVRstudio the correct location of your WebbotLib library files - hence all the errors.

Re-installing AVRStrudio and WinAVR will NOT fix this!!  You need to configure the project correctly as described in the getting started section of the manual.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline PierreTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Helpful? 0
Re: WebbotLib servos.h prob. with Atmega8
« Reply #8 on: November 12, 2009, 09:53:05 PM »
Thank you for the help

     Three(3) errors left from "My first program" from page 10 of the PDF WebbotLib file.

     The three errors are from the same line.  I am including two printscreen picture of what I think my be the cause.  Could it be the this

     From the  function in the "rprintf.h"
    
Quote
Writer rprintfInit(Writer writer)
     The function looks odd to me

     I include two printscreen to help.

Thanks again.  It is like babies.  Before walking, they need to know how to start properly then there is no stopping.  I'll get there and one day I will be worthy to buy an Axon.
« Last Edit: November 12, 2009, 10:12:28 PM by Pierre »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 109
Re: WebbotLib servos.h prob. with Atmega8
« Reply #9 on: November 12, 2009, 11:42:29 PM »
Ok, its an error that has snuck in for the ATMega8 - but I'm not sure its worth fixing.

As per this post:
http://www.societyofrobots.com/robotforum/index.php?topic=7787.msg71646#msg71646

The ATMega8 is not really supported anymore as it doesn't have enough memory - so even if I fixed this error then you would get a new one saying the program is too big for the ATmega8.

So I would definitely recommend that you upgrade to an ATmega168 which can just plug in instead of the ATMega8 - ie no hardware changes. The ATMega168 IS currently supported by WebbotLib and is worth the price (couple of bucks). It gives 16k of program.

Alternatively: the ATMega328P is another plug-in replacement but allows 32k of program.

See http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml


Sorry - if that has caused you
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline PierreTopic starter

  • Jr. Member
  • **
  • Posts: 47
  • Helpful? 0
Re: WebbotLib servos.h prob. with Atmega8
« Reply #10 on: November 14, 2009, 06:32:49 AM »
Totally right Webbot

     WebbotLib is too big for the ATmega8 as I was getting this line.
     
Quote
c:\program files\winavr\bin\..\lib\gcc\avr\4.1.1\..\..\..\..\avr\bin\ld.exe: region text is full


     I will adopt the ATMega168.  It will work on the $50 robot board.
     
     For the ATMega328P  I believe I need to do some modification with the $50 robot board. 

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: WebbotLib servos.h prob. with Atmega8
« Reply #11 on: November 14, 2009, 09:34:50 AM »
Quote
For the ATMega328P  I believe I need to do some modification with the $50 robot board.
No mod required, it'll plug right in.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: WebbotLib servos.h prob. with Atmega8
« Reply #12 on: November 14, 2009, 04:38:27 PM »
For the ATMega328P  I believe I need to do some modification with the $50 robot board. 
Nope, the only modifications are for the code, the pinout on the 8, 168 and 328 are all compatible.
So, its a straight drop in.
Howdy

 


Get Your Ad Here

data_list