Welcome, Guest

Author Topic: AVR-ISP-MK2 - ATmega88 Vs ATmega88p  (Read 1256 times)

SJB66

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« on: November 16, 2017, 01:58:29 PM »
I have an AVR-ISP-MK2 and Im connecting to AVR's using Olimex prototype boards via AVRDude.

I can connect to a ATmega88 but not to a ATmega88p

What am I dong wrong ?

Apologies if this has been covered elsewhere on the forum. I had a look but couldn't find anything.

SB

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1752
  • Karma: +46/-2
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #1 on: November 16, 2017, 04:29:11 PM »
I believe there was some problem in avrdude with this atmega88p. Not sure if it is still the same bug or what version of avrdude you are using.

Refer to the following:

http://www.avrfreaks.net/forum/atmega88p-programmed-atmega88-avrdude
http://savannah.nongnu.org/bugs/?21941
Technical support and documentation manager at Olimex

SJB66

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #2 on: November 17, 2017, 01:55:31 PM »
I don't think it's a problem with the avrdude.conf file.

I'm using avrdude 5_11 which has m88 & m88p in the config file.

I also have avrdude 6_3 but as far as I understand this doesn't work with the Olimex AVR-ISP-MK2 firmware !

The avrdude config files for both 5_11 and 6_3 don't show any significant differences between the m88 and m88p.

The error I get with the 88p is "bad AVRISPmkII connection status : Unknown Status 0x00". the m88 connects without any problems.

I get the same error with atmega32-16PU

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1752
  • Karma: +46/-2
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #3 on: November 17, 2017, 02:45:54 PM »
I thought it is somehow related to the software since the hardware differences between ATmega88 and ATmega88p are minor: http://www.atmel.com/Images/doc8035.pdf - but it can be also something in the schematic or the connections. Can you upload a picture of your setup? If it is not clear can you also shows us a schematic or diagram between AVR-ISP-MK2 and the ATmega88p and ATmega32 boards?

What is the package of the ATmega88p chip? It seems the ATmega32 is in 40p6 package which is not as popular as the 44 pin package... Are you sure about the pinout and the orientation of the 40-pin package?

<<< I also have avrdude 6_3 but as far as I understand this doesn't work with the Olimex AVR-ISP-MK2 firmware !

I've used avrdude 6.3 successfully. The picture on page 11 of the manual shows the usage of avrdude 6.2.
Technical support and documentation manager at Olimex

SJB66

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #4 on: November 17, 2017, 08:49:29 PM »
Photo showing setup with AVRISPMKII and Olimex board :



https://www.dropbox.com/s/gih6uxbzjqgt3tk/DSC_0154.JPG?dl=0

I've tried different jumper settings on the AVRISPMkII and noticed that even with the target power jumper set to "off" I can still communicate with the m88 on the Olimex board without any other power supplied (but not with avrdude 6_1 or 6_3)

I had another look at the manual and it doesn't mention any reason why avrdude 5_11 would work but not 6_1 or 6_3.

The drivers and firmware seem to be correct.


Looking at the txt file saved with the firmware update files it says :

"The firmware had been tested and confirmed working with AVRDUDE 5.11 and ARDUINO IDE 1.5.7.

Note that in order to use AVR-ISP-MK2 with AVRDUDE version 6 or newer
(or ARDUINO IDE newer than 1.5.7, which incorporates AVRDUDE 6.0.1) you
would need to apply a patch to the AVRDUDE source and re-compile it."


Which is probably where I got the idea about the avrdude 5_11 limit.

Its not clear to me what "patch" is required or better still where I can find a version of avrdude already patched and compiled ?

 
SB
« Last Edit: November 17, 2017, 08:51:25 PM by SJB66 »

JohnS

  • Hero Member
  • *****
  • Posts: 1674
  • Karma: +33/-45
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #5 on: November 17, 2017, 10:05:54 PM »

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1752
  • Karma: +46/-2
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #6 on: November 20, 2017, 09:57:35 AM »
The connection seems alright, the chip should work with AVR-P28-8Mhz. The jumpers need to be configured properly, if you are going to power the board from the AVR-ISP-MK2, try with both 3.3V or 5V power supply. It is very important to disable the powering (set the jumper to off position) if you are going to power the board from another source - else a short circuit would probably appear. Use this picture to set the jumper properly: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/isp-mk2-layout-connectors.png

Overall I'd recommend testing with another version of avrdude or another piece of programming software if possible (atmel studio) to determine if it is a problem with that specific version of avrdude. Then you can try another version of the firmware (but notice that different versions of firmware would probably require different drivers, which might lead to unexpected hard times).

When I tested the newer versions of avrdude I used the latest firmware: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/AVR456-studio-AVRISP-MKII.zip - these drivers: https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/DRIVER-MK2-AS-6-7-W10.zip I downloaded the pre-compiled avrdude for Windows from here (didn't need to apply the patch): http://download.savannah.gnu.org/releases/avrdude/ I used Windows 10 x64.

<<< I get the same error with atmega32-16PU

Are you sure that ATmega32 has in-serial programming interface available? I think it can be programmed only via SPI/JTAG, at least looking at the datasheet. My suspicion is somehow confirmed by our AVR-GSM design that has only JTAG exposed.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

SJB66

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: AVR-ISP-MK2 - ATmega88 Vs ATmega88p
« Reply #7 on: November 20, 2017, 11:25:58 AM »
I've been discussing this problem on another forum and now have a better idea of what the problem is.

AVrdude 5_11 will communicate with the Olimex AVRisp interface

Any AVRdude version higher than 5_11 will not communicate with the Olimex AVRisp interface without the "Patch" being applied.

Versions of AVRdude 6-1 upwards compiled for windows with the patch applied do not seem to be available for download anywhere (I don't have the time to go through the complicated windows compilation process myself).

The difference between the 88 and 88p seems to be the fuse settings for the clock. On the 88p the default fuse settings are for the low speed internal clock.

Using a different AVRisp interface to change the fuses to run the clock in low power mode from the external crystal on the Olimex board allows AVRdude 5_11 to communicate with the 88p via the Olimex interface with standard command line switches.

Alternatively setting the AVRDude Bitclock command to -B5 allows AVRdude 5_11 to communicate with the 88p via the Olimex interface with the default fuse settings.

Thanks
SB