Show Posts
Pages: [1] 2
1  Using Arduino / Microcontrollers / Re: High Voltage Fuse Reset on ATMega2560 on: April 07, 2013, 07:45:19 pm
...
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.

Yes, if it's a rev3 board there is a diode installed between the reset pin and +5vdc that would have to be removed before you could safely apply +12vdc to the reset pin.
Lefty

To clarify, I have a custom board that is "bricked". And I have a normal Arduino Mega to use for the HV programming..

I found the answer myself, different MCUs may use different pins for HV programming. The specifics can be found under the chapter "Memory Programming -> Parallel Programming Parameters, Pin Mapping, and Commands" in each MCU documentation.

And to make the setup simpler the HV sketch needs to me modified slightly.

Cheers
2  Using Arduino / Microcontrollers / Re: High Voltage Fuse Reset on ATMega2560 on: April 07, 2013, 08:23:29 am
...
I read that HV programming is not that hard to do for a standalone chip.
This has some information, http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/
For a Arduino board, you must make changes to the pcb, to be able to set 12V to the reset pin.
...

Yes, I've been reading that too as I wrote previously and the main question is how to hook it up on another MCU then the one he uses.

Is it still port B,D and C that is used to HV program my ATMega2560?

Cheers
3  Using Arduino / Microcontrollers / Re: High Voltage Fuse Reset on ATMega2560 on: April 07, 2013, 06:20:57 am
...
Are you sure you need HV programming ?
...
I'm pretty sure because I disabled ISP on the Mega, but do you have any suggestions besides HV programming the resets the fuses?

Cheers
4  Using Arduino / Microcontrollers / High Voltage Fuse Reset on ATMega2560 on: April 06, 2013, 10:35:53 pm
Hi, for a few months ago I set some fuses wrong and ended up with a ATMega2560 prototype board that was of no use. I knew from the beginning that it could be "saved" through HV programming but put it to the side because I had more boards to work with...It's now time to save this one.

I have had a read through this tutorials of how to do it:
http://www.societyofrobots.com/member_tutorials/node/239

and the original one that the above is based on:
http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/

The first questions I have is regarding using a ATMega2560 as a programmer instead of the smaller boards they use in the tutorials, do I use the same ports (PD,PC,PA..etc) as in the tutorial or the same arduino pins? Do I have to change the sketch?

Second question, what pins should I use on the bricked MCU for HV programming? Same ports (PA,PB,PC..etc) or different pins from the smaller MCUs?

Cheers!
5  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: April 06, 2013, 04:35:45 am
Problem solved!

The problem was that Arduino sets the fuse "Boot Reset vector Enabled" which makes the MCU look for the firmware at another place then the start of the memory. When setting the "Boot Reset vector Enabled" to "Unprogrammed" the MCU starts it's execution at 0x000000 and everything works great!

Thanks again for all your help!

Cheers
6  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: April 06, 2013, 04:02:47 am
If the sketch doesn't start, it may be because the auto-reset needed.  Did you try a manual reset?  Do you have a reset button?
...
I will be away for work until late this week so I'll give your reset idea a try then.
...

Hi again, I have tried out the reset idea you had but nothing changes.

I had a look whats in the flash in the two different situations and when uploading a sketch directly the same code can be found at four positions in the flash memory, at 0x000000, 0x010000, 0x020000 and 0x030000. When I upload the bootloader the flash gets emptied and all bytes are 0xFF. The only difference I notice is that when the bootloader is uploaded the lockbits set "Boot Loader Protection Mode 3: LPM and SPM prohibited in Boot Loader Section" while programming directly via programmer sets the fuse to "Boot Loader Protection Mode 1: No lock on LPM and SPM in Boot Loader Section".

Conclusion from before is that the hardware can't be the problem because the bootloader works and I can get code to run if I just program it through the bootloader.

Have anybody uploaded a sketch directly to the Mega2560 via programmer and got it to work? Why is it for instance working with my ATMega644PA board without problems...

Thanks for all the help so far, Cheers!
7  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 31, 2013, 08:38:26 pm
If the sketch doesn't start, it may be because the auto-reset needed.  Did you try a manual reset?  Do you have a reset button?

I've tried to reset through power cycle but not through Reset, is there a difference? I don`t have a reset button on my board but I will put one in as soon as possible.

I will be away for work until late this week so I'll give your reset idea a try then.


Thank you again, cheers!
8  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 31, 2013, 04:05:11 am
You need to connect the reset pin on the mega2560 to a capacitor to the DTR or RTS pin on the USB serial adapter.

What kind of serial interface are you using?
Simple, I should have thought about that, Thank you! I use a basic USB-TTL adapter so I have to put in a wire directly to the chip the get the signal out, DTR or RTS doesn't matter?

About the main issue, what can be the problem that firmware or sketches uploaded directly with a programmer won't run?
It most be a simple mistake from my side, maybe something that needs to be set. Disable bootloader maybe?
Do the uploading of the bootloader set something that needs to be changes when not using a bootloader?

I can switch between bootloader and direct programming on my other platforms without changing anything.

Cheers
9  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 31, 2013, 02:59:16 am
Yes.
Thank you hiduino for all your help so far! The programmer is now updated and I have run through some more tests to pinpoint what the original problem is. Here's a summary so far:

Solved problems:
  • Verification error when uploading bootloader
  • USBasp programmer updated, "set sck" warning gone

Still a problem:
  • Direct uploaded sketches (via programmer) don't run
  • Uploaded sketches via bootloader works only first time then timeout from board, sketch runs fine until chip erase


Uploading of sketches via Bootloader
After the bootloader have been uploaded (now with 100% success rate) I can upload a skech via the serial link to the bootloader one time. This can be directly after the bootloader have been uploaded or after everything have been disconnected and reconnected. One time and then the following attempts receive this timeout message.
Code:
....
         Using Port                    : \\.\COM14
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
....
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done.  Thank you.
Reading the end of the verbose makes you think it is the programmer which in this case is the board/bootloader that is the problem right?

Direct uploading of sketches
So far no attempts have been successful, I have tried the following:
  • Upload via programmer after chip erase (Empty flash)
  • Upload via programmer after Bootloader successfully uploaded
  • Arduino HEX file uploaded via (3th party software) "eXtreme Burner - AVR"
  • Simple blink firmware written in AVR studio


So far It seems like it is not the actual hardware that causes problem, programming in a certain sequence always works out, but it may have to do with how the MCU boots up?

What really makes no sense is that even simple firmware written in AVRStudio won't run but a bootloader will, any ideas?

Cheers!
10  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 30, 2013, 09:24:43 am
i'm using a Mega board instead of a Uno, the sketch tells the different pins but it may be something else I need to change?

Yes, then use this for avrdude instead.
Code:
avrdude -c stk500v1 -PCOM6 -b19200 -p atmega8 -v -U flash:w:usbasp.atmega8.2011-05-28.hex


So still same configuration with the Mega as a AdruinoISP and my programmer hooked up to it the way you described before?
But run with the command line you just wrote?

Cheers
11  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 30, 2013, 07:27:16 am
If I gave it the path to the one in arduino (I only have AVRdude through Arduino) it stood for a few second and than gave me the error "stk500_getsync(): not in sync: resp=0x00". What am I doing wrong here?


Looks like you may have specified the wrong COM# port.  It should be whatever your Uno show up under in the IDE Tools->Serial Port menu.

No, Both Serial port and board model are correct smiley I just recently read about 20 threads around the net all advising to check the correct port  hehe
There is only on port present and thats the one I'm using.

i'm using a Mega board instead of a Uno, the sketch tells the different pins but it may be something else I need to change?

Cheers
12  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 30, 2013, 06:50:55 am
The best way for me was to use the sketch from Gammon. Give it a try smiley

http://www.gammon.com.au/forum/?id=11635

Thanks, I'll try that later. Is that a sketch that you put on one adruino board to program a bootloader to another board? Specifically made for ATMega2560 it looks like?

Cheers
13  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 30, 2013, 01:21:42 am
Hi, so far I've tried the command line you wrote above which made it complain that it couldn't find the "wide configuration file".
If I gave it the path to the one in arduino (I only have AVRdude through Arduino) it stood for a few second and than gave me the error "stk500_getsync(): not in sync: resp=0x00". What am I doing wrong here?

Thanks for your help so far!

Cheers
14  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 29, 2013, 05:33:51 am
Hi.
Your problem seems like one I recently had too:

http://arduino.cc/forum/index.php/topic,156818.0.html

Thanks for your feedback, did your firmwares run on the platform even though you got the verification fail error?

Cheers
15  Using Arduino / Microcontrollers / Re: ATmega2560 custom board problem on: March 29, 2013, 05:32:10 am
I tested the same USBasp programmer LCsoft Studio on my Arduino Mega2560 and sure enough it also fail verification.  It appears the firmware on your USBasp programmer doesn't properly support the larger memory space on the 2560.

I did have another LCsoft Studio programmer that I upgrade to the 2011-05-28 firmware and it was successful on the verification test.  So this works!  An added benefit is that it also programs almost twice as fast.

Sound great, is the programmer that worked an identical USBasp programmer? Should I configure one of my arduino boards to update my USBasp programmer immediately or do I have to buy another model of programmer?

Could you run the sketches or bootloader with the first one who fail the verification? I have tried to upload through another software, a small firmware i wrote in AVRStudio and it gives a verification error even though the code is less than 20 rows, it seems to fail verification even though I doesn't use a lot of memory?

Cheers
Pages: [1] 2