go_away

Author Topic: Help needed in adpating iRobot code to run with ATmeg16  (Read 1072 times)

0 Members and 1 Guest are viewing this topic.

Offline shanzhereTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Help needed in adpating iRobot code to run with ATmeg16
« on: July 15, 2011, 01:30:42 AM »
Hey people,
i am new to this site..
and i was using the robot tutorial for the $50 bot..
thou i decided to do it wid a slight difference...
making use of an ATmega16..
i intend makin the robot coapable of addaptive mappin and found the iRobot code great for that purpose..
Now i need some help in adapting the code for the ATmega16..
any help wud be welcome..
thanx
regards,
shanil

Offline shanzhereTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Help needed in adpating iRobot code to run with ATmeg16
« Reply #1 on: July 19, 2011, 12:51:55 AM »
well i managed to get it to compile all rit and stf...
but the hex file generated is lik 21 or so kb and the atmega16 has 16kb mem...
lso i noticed the same code is used with the atmega168 which lso has 16 kb...
is it possible to upload a 21kb hex file into the atmega 16???
please reply at the earliest
regards,
Shanil

Offline corrado33

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
Re: Help needed in adpating iRobot code to run with ATmeg16
« Reply #2 on: July 19, 2011, 04:01:11 AM »
No, you'll have to trim some code out.  Do you have optimization turned on?

Offline voyager2

  • Supreme Robot
  • *****
  • Posts: 459
  • Helpful? 6
  • Behold! The Impossible Triangle of robotics!
Re: Help needed in adpating iRobot code to run with ATmeg16
« Reply #3 on: July 19, 2011, 06:14:39 AM »
Hi Shanzhere,
Welcome to the forum!

[...]
but the hex file generated is lik 21 or so kb and the atmega16 has 16kb mem...
[...]
is it possible to upload a 21kb hex file into the atmega 16???
Often times the hex file is larger on a PC than on the micro; dunno why, it just is,
read your code, optimize optimize optimize!!!
Best bet would be to flash the program, and if you get errors, trim!

 
 Voyager

And Admin said "Let there be robots!"
And it was good.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: Help needed in adpating iRobot code to run with ATmeg16
« Reply #4 on: July 19, 2011, 06:44:56 AM »
The HEX file contains more than just the code that goes into the ATmega. It has addresses and checksums as well as other information than the Programming tools use.
Have you tried to load the ATmega with that Hex file?
What is the code size reported by the compiler? This is what you use to determine if the code will fit.

Offline shanzhereTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: Help needed in adpating iRobot code to run with ATmeg16
« Reply #5 on: July 26, 2011, 11:27:49 PM »
hey thanx for the advice guys...
i did trim the code to optimise the code size...it did have a lot of over head and after trimming i got the hex file to be small enough to be runnin on my atmega16...so well my $50 bot with addaptive mapping will be up and running soon....
thanx for all the help..

 


Get Your Ad Here