Problems using programmer with Mega128

Alvin
 
Avatar
 
Subject:

Problems using programmer with Mega128

 · 
Posted: 18.07.2011 - 17:10  ·  #1
Hi,
Occasionally, when I try to program a Mega128 CPU with my new USB2 ISP-3 programmer, it fails with a flash verify error $0000. If I then use my old USB ISP programmer, it has no problem programming.
This only happens when you program the CPU for the first time and only when programming in SPI mode. Once the CPU has been programmed, I can use the USB2 ISP-3 programmer without fail.

Does anyone know why this happens, and how I can get the USB2 ISP-3 programmer to work when this happens again.

Thanks,

Alvin
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 18.07.2011 - 20:47  ·  #2
Hello Alvin,

because programming fails with a very new Mega128 in SPI Mode I think you selected a wrong (too high) SPI speed in your project.

rolf
Gunter
Administrator
Avatar
Gender:
Location: Frankfurt Main / Germany
Posts: 1697
Registered: 02 / 2003
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 18.07.2011 - 20:59  ·  #3
Hi Alvin @ Rolf,

@Rolf: Alvin wrote in 2009
Quote
I too upgraded to the new compiler


@Alvin
do you have these problems when calling the programmer
from inside the AVRco (PED32) ?
If yes:
do you use the "Define_Fuses" statement ?

Gunter
Alvin
 
Avatar
 
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 19.07.2011 - 09:57  ·  #4
@Gunther
I do not use DEFINE_FUSES in the project itself as I prefer to set the fuse bits using the programmer options in the Prommer. This problem manifests in both the external ProgBox and the Prommer called from the PED32 editor.
The previous problem you quoted is unrelated to this one, as the stated solution fixed that problem.

@Rolf
What confuses me is that this only occurs when you first program the CPU, as stated above. Once the CPU has been programmed, you can then use the ISP3 to reprogram.
I set the ProcClock to the speed of the crystal, which in my case is 7372800. According to the compiler manual the default SPI speed is set to ProcClock, but you can set the SPIClk to a different speed. I can try setting an optional SPIClk speed so it will work with the ISP3, but I'm unsure to what that speed should be as the only crystal onboard is that attached to the CPU.

Is there a difference between the ISP and ISP3 programmers when they attempt to communicate with a CPU with default factory settings, for example timeout settings, or SPI speed.

I'm wondering, since I'm still using Windows XP, could this be a Windows problem as the ISP3 is a USB2 device, whilst the ISP is a USB device.

Thanks

Alvin
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 19.07.2011 - 17:24  ·  #5
Hello Alvin,

there should be no essential differences between the programmer types.
One reason for the first failure could be that you didn't check the "program fuses" box in the programmer options dialog.

rolf
Alvin
 
Avatar
 
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 19.07.2011 - 17:48  ·  #6
Rolf,
Program fuses is definitely set. I can use the USB-ISP to program the CPU where the USB2-ISP3 fails without changing ANY programmer options at all. All I do is use Search Programmers to change between the two.

Is there a timeout difference between the 2 programmers in deciding when to fail if it has not received a response from the CPU within that specified time?

Thanks

Alvin
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 19.07.2011 - 20:42  ·  #7
Alvin,

the Mega128 is shipped with 1MHz internal RC-OSC. This should be taken in account by the programmer when accessing this AVR via SPI. It seems that this is not the case. Please set your SPI speed to 1MHz in programmers options. If this works now with new devices I have to check the ISP3 firmware. The JTAG mode is not concerned.

rolf
Alvin
 
Avatar
 
Subject:

Re: Problems using programmer with Mega128

 · 
Posted: 20.07.2011 - 10:45  ·  #8
Rolf,
I appreciate your help. Thank you. It works.

Alvin
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 14 · Cache Hits: 14   133   147 · Page-Gen-Time: 0.021316s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI