ATmega3216p programming error

Moderator: Benj

Post Reply
hyawge
Posts: 4
Joined: Mon Feb 04, 2013 10:05 pm
Contact:

ATmega3216p programming error

Post by hyawge »

Hi

I am using a EBR019 AVR board fitted with a ATMEGA3216P microcontroller and a home copy of flowcode v5, I am experiencing problems programming the chip via a AVRISPMKII. I have used ATMEGA32 as the target as there isn't a 16P version listed and I get the following error whilst trying to compile a EB004 test program to the chip:


avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x1e9502
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "eb004-14-2.hex"
avrdude.exe: input file eb004-14-2.hex auto detected as Intel Hex
avrdude.exe: writing flash (606 bytes):

Writing | ##########avrdude.exe: stk500v2_command(): unknown status 0x80
avrdude.exe: stk500v2_paged_write: write command failed
######################################## | 100% 1.38s

avrdude.exe: failed to write flash memory, rc=-1

avrdude.exe: safemode: Fuses OK

avrdude.exe done. Thank you.


Error returned from [avrdude]
Return code = 1
Flowcode was unable to transfer the flowchart to the microcontroller. Check the programmer options and physical connections.


FINISHED

The only way I have been able to program the device is via AVR studio on another PC and the program ran as expected. I haven't tried AVR studio on my current PC as I don't want to create a driver conflict. I am running windows 8, I don't know if that could be affecting anything. Any help would be appreciated.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ATmega3216p programming error

Post by Benj »

Hello,

I have had a quick look and the compiler does not currently support this device so It looks like we cannot support this chip at this moment in time. Also there is not currently a specific definition file for this device so we cannot be sure that peripherals etc will be setup correctly if you do compile to C and use AVR studio.

Is it possible for you to use one of the supported devices instead?

hyawge
Posts: 4
Joined: Mon Feb 04, 2013 10:05 pm
Contact:

Re: ATmega3216p programming error

Post by hyawge »

Hi

Thanks for the response. The ATmega3216p was the device supplied with the EBR019 board purchased direcly from Matrix Multimedia a few years ago. Ive had a thought ,the device label has ATMEGA32 written on the top line and 16P is the first few letters of the second line, does this mean the 16P is the suffix of the part number or could it be the start of the date code?

I have also tried using a ATTINY2313 and couldnt get it to program succesfully either.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ATmega3216p programming error

Post by Benj »

Hello,

Aha ok the ATMEGA32 should work fine as should the up to date replacement the ATMEGA324P. I'm guessing the 16P is some kind of suffix.

Maybe try opening the Compiler options window via the Build menu and then in the programmer tab change the work stk500v2 to avrisp.

Let me know how you get on.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ATmega3216p programming error

Post by dazz »

Hi
The 16P is as follows 16 (speed in mhz) P ( pdip packaging)
Can you post your fcf file
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

hyawge
Posts: 4
Joined: Mon Feb 04, 2013 10:05 pm
Contact:

Re: ATmega3216p programming error

Post by hyawge »

BenJ

I cannot find any mention of stk500v2, the options are as follows:

Location: C:\Program Files (x86)\Flowcode(AVR)\v5\Tools\MX_bats\avrc.bat
Parameters: AVRDUDE %a %t "%D\%f.hex" "%f.hex" %cfg %c0 %c1 %c2 %c3
"Use external program to set configuration options" is ticked
Location: C:\Program Files (x86)\Flowcode(AVR)\v5\Tools\PPP\PPPv3.exe
Parameters: -cs 2 -chip %p -config

Dazz

I have attached a copy of the file below, thanks for offering to take a look.
Attachments
4. Reading a switch and outputting to a LED.fcf_avr
(17 KiB) Downloaded 348 times

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ATmega3216p programming error

Post by dazz »

Hi
have you got a pdf file for your board yoou can post as i cant fins instructions for that board]online
Regards
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ATmega3216p programming error

Post by dazz »

Hi
Can you goto your flowcode Flowcode(AVR)\v5\Tools\AVRDUDEusb rename adrdude.conf to avrdude.bk, once done can you copy the attached avrdude.conf file (unzip it first)attached into the folder and try to program again
let us know if it works

Regards
Dazz
avrdude.zip
(19.94 KiB) Downloaded 304 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

hyawge
Posts: 4
Joined: Mon Feb 04, 2013 10:05 pm
Contact:

Re: ATmega3216p programming error

Post by hyawge »

Dazz

Yes that works, cheers for the help. What was the difference between the two files?

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ATmega3216p programming error

Post by dazz »

Hi
If you open the conf and the back up in note pad find the atmega32 bit, then look for the eprom and flash parts you will see I changed the delays from 6 to 10 and from 10 to 20, as some avrs are fussy about the programming speeds
Glad it worked

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Post Reply