Page 1 of 1

Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Thu Oct 18, 2012 7:22 am
by widarr
Hello!

I got my HV Rescue Shield 2.1 yesterday (Thank You :) ) and soldered it together.

However I have a problem getting it to work. Like mentioned in the title I want top reset the fuses of a ATMEGA88P (the host board is a Arduino Mega 2560), but the Arduino Board keeps reading in some random Numbers and writes nothing (I rechecked with a working 88P).
I also tried to recompile the sketch with hardcoded fusevalues but that also didn't the trick.

Can you please help me?

best regards,
widarr

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Thu Oct 18, 2012 10:37 pm
by mightyohm
I haven't tested the Rescue Shield with the Mega 2560. Do you have an Arduino Uno or Mega 1280 that you can try?

Another thing to check - make sure the IC is inserted with pin 1 on the left (right side up).

Are the fuse values really random, or do they consistently come back as 0xFF or some other number?

It might be helpful if you could paste a screenshot or log of the serial terminal showing the problem.

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Fri Nov 02, 2012 4:40 am
by widarr
Hi
I have now ordered an Arduino uno. I had not much time the last two weeks but ill try out this one.
The values seemed to vary each time I tried to read the fuses, but sometimes they stayed a few times.
I'll make a screenshot as soon as I come back home.

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Sun Nov 04, 2012 4:08 pm
by mightyohm
Ok, please let me know the result and I can help you troubleshoot further if necessary.

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Mon Nov 05, 2012 10:44 am
by widarr
I have now tested the Shield wit the Arduino Uno Rev 3 without success, here is the result:

http://www.freeimagehosting.net/y7vak

and this is how I put the Shield on the board:

http://www.freeimagehosting.net/sac8i

(is it normal that there are 2 slots free on the left side?)

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Tue Nov 06, 2012 12:37 am
by mightyohm
Do you have another device you can test with (another 88P, or a 168 or 328P)? Do you know if the device you're trying to flash is alive? What fuse bytes are you trying to change?

It's normal for those pins to be exposed on the left on the Uno R3. The Rescue Shield should be inserted so that the rightmost pins are plugged into the rightmost sockets on the Arduino (Digital pin 0 and Analog A5).

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Wed Nov 07, 2012 2:32 pm
by widarr
I tested the shield with 3 misfused atmega 88ps and I tested to write high and low, and then just low.
All with the same result.

I have before also tested to oszillate the misfused 88p with another 88p where i set the fuse to let it output its clock signal on pin 14 (checked with oscilloscope) but it wont work...

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Thu Nov 08, 2012 1:03 am
by mightyohm
What fuses are you trying to set? (so that I can duplicate them here)

If you use a digital multimeter to measure from TP1 to ground (the USB connector on the Arduino is a good ground) when the red light is on, what voltage do you see?

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Sun Nov 11, 2012 3:06 am
by widarr
I checked the Testpoint with my oscilloscope and yes it gives 12V for about 250ms.
These are my configurations I made to the sketch:

Code: Select all

// User defined settings
#define  MEGA         0       // Set this to 1 if you are using an Arduino Mega (default = 0)
#define  DEFAULTMODE  ATMEGA  // If running in non-interactive mode, you need to set this to ATMEGA, TINY2313, or HVSP.
#define  ASKMODE      1       // Set this to 1 to enable mode question at startup
#define  INTERACTIVE  0       // Set this to 0 to disable interactive (serial) mode
#define  BURN_EFUSE   1       // Set this to 1 to enable burning extended fuse byte
#define  BAUD         9600    // Serial port rate at which to talk to PC

// If interactive mode is off, these fuse settings are used instead of user prompted values
#define  LFUSE        0x22  // default for ATmega168 = 0x62
#define  HFUSE        0xDF  // default for ATmega168 = 0xDF
#define  EFUSE        0x01  // default for ATmega168 = 0xF9
edit:
Hey! Now it seems to work! It needed a few tries but now I can read the fuse values with my serial programmer again :) I don't know what I did different

Re: Trouble programming a ATMEGA88P with Arduino Mega 2560

Posted: Mon Nov 12, 2012 11:10 pm
by mightyohm
Strange. What were the starting fuse values - which fuse values were in the 88P before you changed them the ones shown above? I'll try to replicate what you were seeing here.