go_away

Author Topic: Problems programming the $50 robot  (Read 3143 times)

0 Members and 1 Guest are viewing this topic.

Offline pocoffeyTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Problems programming the $50 robot
« on: August 21, 2008, 09:48:40 PM »
Hello,
     I'm building the $50 robot, and I've build the circuit and tested it with a multimeter so I think that's good. The problem is when I try to write the program to the ATMega8. So to start I have the AVR usb programmer and when I connect the power I have 2 green leds on the programmer itself. Inside of AVR studio in the AVRISP MK II window, under the program tab, I have ATMega8 (my chip says on it ATMega8-16PU) selected under device. Under Fuses I have 3 selected:
Boot flash section size=1024 words Boot start address=$0C00
Brown out detection level at VCC=2.7V
Int RC Osc. 1 Mhz; Startup time: 6ck + 64ms

Under the Lockbits tab I have the following selected:
   Mode 1: Number memory lock features enabled.
   Application protection mode 1:...
   Boot loader protection mode 1:...
in the output box it says:
   Setting mode and device parameters.. OK!
   Entering programming mode.. OK!
   Reading lockbits .. 0xFF .. OK!
   Leaving programming mode.. OK!

Under the Advanced tab I can hit the read button next to the signature box and I get this code:
0x1C 0x91 0x05
Warning: Signature does not match selected device
Also, the Calibrate for frequency drop down is set for 1Mhz, the lowest setting.
in the output box it says:
Setting mode and device parameters.. OK!
   Entering programming mode.. OK!
   Reading signature .. 0x1C, 0x91, 0x05 .. OK!
   Leaving programming mode.. OK!

Under the board tab, I have the VTarget set to 5.4(I can't change it anyway so it probably doesn't matter) and the ISP frequency set to 125Khz.

All that said, back under the program tab, I select the photovore program under the flash section. All I did was compile the program, I made no changes. When I hit program, the ouput box says:
   Setting mode and device parameters.. OK!
   Entering programming mode.. OK!
   Erasing device.. OK!
   Programming Flash.. FAILED!
   Leaving programming mode.. OK!
And for the life of me I have no idea why. Some searching on the forums lead me to set the ISP frequency to 125khz, but that hasn't fixed it. Anyone got any ideas? Google seems pretty sparse on solutions that I can understand, although a number of people have had that warning about signature not matching their device, but they usually get all 0's for a signature. Btw if you haven't guessed I'm new to this, so please forgive my ignorance.

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Problems programming the $50 robot
« Reply #1 on: August 22, 2008, 10:12:08 AM »
try erasing/resetting your atmega8

you should not need any lock bits or boot lock bits set.

if you're not using a bootloader then you should unprogram the bootrst fuse.

unprogram/disable brown out detection

1MHz 6ck + 64ms is perfect.


Can you expand the window where you select all the fuses and take a screen shot for us and then attach to a post using the additional options link below.
« Last Edit: August 22, 2008, 10:13:19 AM by pomprocker »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Problems programming the $50 robot
« Reply #2 on: August 22, 2008, 12:21:37 PM »
What happens when you push 'Read Signature'?

Offline pocoffeyTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Problems programming the $50 robot
« Reply #3 on: August 22, 2008, 07:29:53 PM »
Hey guys thanks for your responses. I tried unselecting the fuses and lockbits, but it won't let me. And as far as reading the signature, check out the screen shots. I was curious that when I clicked verify for the flash program that it said the flash byte address is wrong, see the second screen shot. Any other suggestions?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Problems programming the $50 robot
« Reply #4 on: August 22, 2008, 10:10:00 PM »
First, reduce the Oscillator Calibration byte to something much smaller, like 115.2kHz.

Also, try the newest version of AVR Studio:
http://www.atmel.com/dyn/resources/prod_documents/aStudio4b589.exe

I've never seen this error before, try copy/pasting it in google and see what you find . . .

Are you sure you are using ATmega8? (sorry, but I'm running out of ideas!)

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: Problems programming the $50 robot
« Reply #5 on: August 22, 2008, 10:49:32 PM »
Hey guys thanks for your responses. I tried unselecting the fuses and lockbits, but it won't let me. And as far as reading the signature, check out the screen shots. I was curious that when I clicked verify for the flash program that it said the flash byte address is wrong, see the second screen shot. Any other suggestions?


you can't deselect a lock bit. you have to erase/reset the chip to clear them.

Offline pocoffeyTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Problems programming the $50 robot
« Reply #6 on: August 25, 2008, 06:47:58 AM »
Hey Guys, sorry for the late reply but work has been keeping me busy. Anyway so when I get home I'm going to try the latest version of AVR studio, but I'm running 4.13 and I think the latest is 4.14 so I don;t hold out much hope that will solve the problem. As far as the oscillator speed, that was a pull down menu and the lowest I could set it was 1 MHz, and the chip says ATMega8 on it. Is there another way to set the oscillator speed? Also when I get home I'll try poking around to see how to reset the chip, and see if that clears the lockbits. Could this be caused by a bad micro controller? Any suggestions would be helpful :-D

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Problems programming the $50 robot
« Reply #7 on: August 25, 2008, 07:39:02 AM »
Quote
As far as the oscillator speed, that was a pull down menu and the lowest I could set it was 1 MHz
This isn't correct. Are you sure you are setting the Oscillator Calibration byte and NOT an oscillator fuse in the fuses menu?

Offline pocoffeyTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Problems programming the $50 robot
« Reply #8 on: August 25, 2008, 10:25:11 AM »
I'm pretty sure, the first screen shot I posted above was the Advanced tab. You can see in the Oscillator Calibration Byte section, that the frequency is a pull down menu. And the lowest value in the menu is 1Mhz.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Problems programming the $50 robot
« Reply #9 on: August 25, 2008, 05:20:46 PM »
oops sorry I'm being dumb :-X

what I *meant* to say was change 'ISP Frequency', not oscillation calibration byte . . .

sorry!

Offline pocoffeyTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Problems programming the $50 robot
« Reply #10 on: August 27, 2008, 07:33:10 PM »
okay I double checked and the ISP Frequency is 125 KHz. And I've upgraded to version 4.14. Still doesn't work, I took a screen shot of what happens when I try to verify, about the wrong flash address. What does that mean?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Problems programming the $50 robot
« Reply #11 on: August 27, 2008, 07:53:08 PM »
What does it say in the Main tab when you click Read Signature?

Offline pocoffeyTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Problems programming the $50 robot
« Reply #12 on: August 27, 2008, 09:24:36 PM »
it gives 3 hex numbers and says Warning signature does not match selected device. I've attached a screen shot.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Problems programming the $50 robot
« Reply #13 on: August 27, 2008, 09:34:57 PM »
Hmmmmm try a few other ISP Frequencies, but it still probably won't work.

I have three theories:
bad wiring
low voltage on batteries
fried chip

If the other two check out, you'll just have to buy another one . . . might as well get an ATmega168 while you're at it ;D

Offline Novice1

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 0
Re: Problems programming the $50 robot
« Reply #14 on: August 06, 2009, 09:22:52 AM »
Try Studio 4.16, anyways, the ISP frequency should be lower than 1/5 the target CPU frequency. You probably do not have a fried chip because the only way for that to happen is if you soldered with it on the circuit which is very unlikelly because even then it takes a while

 


Get Your Ad Here

data_list