Author Topic: Programming on a Mac (2). What am I doing wrong?  (Read 1907 times)

0 Members and 1 Guest are viewing this topic.

Offline ishkaTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
Programming on a Mac (2). What am I doing wrong?
« on: June 20, 2008, 05:00:04 AM »
Hi all.
First I would thank all those who helped me to gather all the piece for the 50$ robot, and those who helped me to find software to program the robot.
So I solder all this morning, and now I'm trying to program the microcontroller.
It's the atm168 recommended in tutorial Bonus! Microcontroller Upgrade
I solder my board following this schematic just put a switch between linked board ground and linked batteries ground.
I quintupled check all the connections : no short, all ground connected together, things that should be connected are and those who shouldn't aren't.
I'm using USBtinyISP programmer.
I'm using AVR MAcPack latest version.
I'm using powerbook G4 with Mac OS 10.5.2.
Ok now that you know all material I'm using, let's go the what happens.
USBtiny is made to power supply the microcontroller by itself. So i plugged  the cable and the green led turn on.
Now i check the voltage between VCC and ground, so i know if the micro is powered. It says 4.98V, so i guess it's ok. Anyway, I tried also with 9V battery in ( and so I was able to check if the programmer cable and the connexion where right, as the 9V successfully powered the USBtiny ( the green led light on even while not conected to the USB port)
So now i go into the terminal and try to send hold_servo.hex to the micro.
Here's what I write and what I get :

avrdude -c usbtiny -p m168 -U flash:w:hold_servo.hex

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

While it do that, the red led from USBtiny light on, so I suppose the programmer is ok. But why can't I connect to atm168?

When i override this step ( wich so does only a simulation of writing if I'm right) I got this

avrdude -c usbtiny -p m168 -F -U flash:w:test_leds.hex

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "test_leds.hex"
avrdude: input file test_leds.hex auto detected as Intel Hex
avrdude: writing flash (260 bytes):

Writing | ################################################## | 100% 0.41s



avrdude: 260 bytes of flash written
avrdude: verifying flash memory against test_leds.hex:
avrdude: load data flash data from input file test_leds.hex:
avrdude: input file test_leds.hex auto detected as Intel Hex
avrdude: input file test_leds.hex contains 260 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.28s



avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x12 != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

I must admit I'm quite lost. All seems to be alright except I can't connect to the chip ( wich is quite hard to override :P)

Thx all for reading.

May the Achtuche be with you...

Offline ishkaTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
Re: Programming on a Mac (2). What am I doing wrong?
« Reply #1 on: June 21, 2008, 02:28:49 AM »
Well, I got an more expensive problem as it seems that all my trouble comes from ... my computer. :o
I tried to do the same as above on my father's G5 and it works without any problem, I flashed the prog to the chip in 5 sec.
Well, now I need to get it working on my laptop.

Ty
May the Achtuche be with you...

Offline TheStone

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Programming on a Mac (2). What am I doing wrong?
« Reply #2 on: April 11, 2010, 02:53:18 AM »
Hi

Did you figure it out?
I think I have the same problem.

PS: Sorry for posting in an old topic.

 


Get Your Ad Here