programming avr chip - progress but still not fixed - Page 1
Forum section: electronics / beginners

author: amateur_25
author_rank: Regular Contributor
timestamp: March 23, 2012, 07:37:15 pm
content: Hiin 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?

author: Bored@Work
author_rank: Super Contributor
timestamp: March 23, 2012, 08:07:42 pm
content: 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.

author: amateur_25
author_rank: Regular Contributor
timestamp: March 23, 2012, 09:03:14 pm
content: 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 erroravrdude: 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 checkI 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 itvcc -> 5v outputgnd-> GNDMosi -> mosiSck -> sckmiso-> misoreset-> reset with 1K pull up since the datsheet says it can't be higher than 4.7K otherwise the shortcircuit will trigger

author: TerminalJack505
author_rank: Super Contributor
timestamp: March 23, 2012, 10:31:02 pm
content: Are you sure it says the pull-up on RESET can't belargerthan 4.7k? I'm pretty sure they say it can't be smaller. I always use a 10k.

author: slateraptor
author_rank: Frequent Contributor
timestamp: March 23, 2012, 11:41:07 pm
content: Quote from: amateur_25 on March 23, 2012, 09:03:14 pmTerminalJack505 called it out appropriately. From the AVRISP mkII user's guide:Quote

author: metalphreak
author_rank: Frequent Contributor
timestamp: March 24, 2012, 02:46:09 pm
content: 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.

author: amateur_25
author_rank: Regular Contributor
timestamp: March 24, 2012, 08:02:14 pm
content: 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 failedavrdude: stk500v2_command(): unknown status 0xc9avrdude: stk500v2_program_enable(): cannot get connection statusavrdude: initialization failed, rc=-1Double check connections and try again, or use -F to overridethis 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.