Author Topic: programming avr chip - progress but still not fixed  (Read 3484 times)

0 Members and 1 Guest are viewing this topic.

Offline amateur_25Topic starter

  • Regular Contributor
  • *
  • Posts: 106
programming avr chip - progress but still not fixed
« on: March 23, 2012, 07:37:15 pm »
Hi
in the datasheet of many avr chip it says that it has an in system programming boot program.
If you flashed the arduino bootloader onto a 328p, does that mean you loose the in system programming boot program?
« Last Edit: March 24, 2012, 08:02:39 pm by amateur_25 »
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: programming avr chip
« Reply #1 on: March 23, 2012, 08:07:42 pm »
No, ISP (in system programming) is a hardware feature. There is no in system boot program.

On some AVRs it is possible to change the fuses in a way so no further ISP programming is possible. ISP needs the reset pin, and when activating normal I/O on the reset pin it no longer function as reset pin, and therefore ISP no longer works. If the particular AVR has no other programming means (JTAG, bootloader, HV programming) no other program can ever be written into it.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline amateur_25Topic starter

  • Regular Contributor
  • *
  • Posts: 106
Re: programming avr chip
« Reply #2 on: March 23, 2012, 09:03:14 pm »
I've actually now found out the chip doesn't seem to have the arduino bootloader installed as the diecimila bootloader isn't pulsing the led I connected to sck pin. I thought iI did install it.
Any idea why I can't program my chip using avrdude on ubuntu oneiric? It works on a different chip. It comes up with the following error

avrdude: stk500v2_command(): command failed avrdude: stk500v2_command(): unknown status 0xc9 avrdude: stk500v2_program_enable(): cannot get connection status avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check

I have tried both on my target board and on a breadboard but I get the same error. I'm using avrispmkII when that error  comes up the red status led flashes which means there a short according to the datasheet. However there isn't one because everything is still working.

How I connected it
vcc -> 5v output
gnd-> GND
Mosi -> mosi
Sck -> sck
miso-> miso
reset-> reset with 1K pull up since the datsheet says it can't be higher than 4.7K otherwise the shortcircuit will trigger
« Last Edit: March 23, 2012, 09:06:35 pm by amateur_25 »
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: programming avr chip
« Reply #3 on: March 23, 2012, 10:31:02 pm »
Are you sure it says the pull-up on RESET can't be larger than 4.7k?  I'm pretty sure they say it can't be smaller.  I always use a 10k.
 

Offline slateraptor

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: us
Re: programming avr chip
« Reply #4 on: March 23, 2012, 11:41:07 pm »
reset-> reset with 1K pull up since the datsheet says it can't be higher than 4.7K otherwise the shortcircuit will trigger

TerminalJack505 called it out appropriately. From the AVRISP mkII user's guide:

Quote
The Reset line should not have a stronger pull up than 4.7k ohm. Any de-coupling capacitor should not be larger than 10uF.
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: programming avr chip
« Reply #5 on: March 24, 2012, 02:46:09 pm »
FYI: by stronger they mean lower resistance (less resistance -> more current flow -> stronger pull up to the voltage)

So in this case a weaker pull up means a higher resistance.

The wording can be a bit confusing for new people. Slapteraptor and TerminalJack505 are correct in that you should use a 4.7k or higher resistor.

Offline amateur_25Topic starter

  • Regular Contributor
  • *
  • Posts: 106
Re: programming avr chip
« Reply #6 on: March 24, 2012, 08:02:14 pm »
Thanks alot metafreak. No wonder every design I look at uses 10K pull up on the reset line. However am still getting the same issue.
I originally had a 4.7K on the target board but then I changed it to 1K. After you telling me stronger = lower then I changed it to a 10K.
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
OK I have preprogrammed this chip before to get it to use the 16MHZ crystal. I know this because the chip doesn't oscillate at all without the crystal.
It's still triggering the output protection i.e. flashing red status led. Ok I tried a different chip an attiny2313 and it works perfectly fine. I could program it. This proves I wired my programmer correctly and that it's functional.
« Last Edit: March 24, 2012, 09:23:48 pm by amateur_25 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf