AS6 / STK500 / ATMega328

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Studio 6 SP2

Select tools|Device Programming
Select STK500 in Tool dropdown
No ATMega328 or any 328 variant in Device dropdown :(

What am I doing stupidly wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the STK500 powered up and running BEFORE you start the programmer? Have you used it before? Are you using a real RS232 port or a USB to RS232 dongle?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's a bit rubbish, but thanks for confirming I'm not (completely) stupid. Why not support probably the most common ATMega with AS6/STK500?

A 10 minute download of Studio 4.19 Build 730, a 2 minute install, and all is well in the Atmega328/STK500 world...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably can make studio support it.

Look under /tools/STK500/xml and take a xml file for a device that resembles the 328, copy it to the name it should have (the file structure is fairly regular) and open it. Change the device to the name you want and save (need admin privilegies). Restart studio and the new device should appear.

Note that as it is not official support, strange things may happen...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AS far as I can see, you just have to copy any similar XML file e.g. tools/STK500/xml/ATmega324P_stk500.xml to tools/STK500/xml/ATmega328P_stk500.xml

Then edit the line:

    

Note that you could equally well copy
tools/STK500/xml/ATmega328P_AVRDragon.xml to tools/STK500/xml/ATmega328P_stk500.xml

Then edit the line instead.
(but this requires more editing)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

That's a bit rubbish, but thanks for confirming I'm not (completely) stupid. Why not support probably the most common ATMega with AS6/STK500?

How odd that the 168/168A/168P/168PA all show "yes" ni the STK500 column yet none of the 328's do. They are so similar I wonder why this apparently arbitrary choice was made? To be honest I just assumed the STK500 and AS6 would support all DIP packaged AVRs as Studio has always done.

Can this be raised as a "bug" against AS6 or is there some technical reason why 328 support is not possible?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as I can remember, one of the Tiny25/45/85 family was missing. I reported it at the time, and they duly added the XML file in a subsequent release of AS6.

I suppose that I should really have reported every single device in the /devices directory.

I am surprised that I had not encountered the mega328 + STK500 anomaly. I must have only used Dragon or mkII with the mega328 !

Anyway, I would have thought that all these .XML , .H , .INC files would be machine-generated from a script. Then the Atmel support team just has to concentrate on the 'correctness' of the script(s).

And we would not get mis-spelled VECTORs or all of the other strangeness.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the device itself is supported (which is the case for the mega328) and the STK500 used to support it then the lack of AS6 support most probably comes from the lack of rigorus testing for that tool/device combo.

Other tools are automatically tested (the robot seen in some of the marketing mumbo-jumbo videos on youtube) but the stk500 needs to be manually tested, and there are a subset of devices that this has been done for.

I remember adding the tiny (85 if my memory servers me right) so by all means, post a bug at the tracker with a request to add them so that we can track the request.

Also the activity on the bugzilla may be a bit low atm, but it is read through on a irregular basis...

The bugzilla is located at http://asf.atmel.com/bugzilla/bu...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like I need a ASF Bugzilla account to raise a bug - all too complicated :(

But I'd appreciate it if someone could raise it - it does seem an arbitrary decision seeing that 168x are supported and the AS6 Device Programmer UI is far nicer to use than that in AS4 :)

I might try to create a 328 xml file to see if I can force AS6 to work, but that would be a hack..

TIA, Martin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Martin,

You don't need anything technical. My AS6 already has the main 328 and 328P XML files in /devices

The /devices/ATmegaXXX.xml files are the main description and typically 68kB long.
The /tools/STK500/xml/ATmegaXXX_stk500.xml files are typically 390 bytes long.

Just inspect them on disk in the /Program Files/Atmel/Atmel Studio 6.0 path

As I said earlier, I am surprised that these files are not machine-generated. After all, the STK500 can do ISP programming for all ISP-SPI devices. i.e. every mega and all non-TPI tinys.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The other day Farnell (Element14) I think it was had a link on their front page showing the top 50 pieces of silicon they sell (not just micros but everything). Guess which Atmel device was listed there. ;-)

The popularity of the Arduino is almost bound to mean that the 328 is perhaps the most widely used mega there is at this time. So

Quote:

the lack of rigorus testing for that tool/device combo.

seems odd - why not drop testing of old, unused, esoteric AVRs (mega162?) and bump the 328 to the top of the list as it's the one everyone seems to be using right now. Also isn't the 168 similar enough that if it passes you can just put a tick in the 328 box too?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

seems odd - why not drop testing of old, unused, esoteric AVRs (mega162?) and bump the 328 to the top of the list as it's the one everyone seems to be using right now. Also isn't the 168 similar enough that if it passes you can just put a tick in the 328 box too?

Well, odd is why we live :)

I'll raise an internal bug regarding the 328++

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh, and if you find it difficult, rename the attached file to from txt to xml an plop it in you tools/STK500/xml folder and the mapping should be created

Attachment(s): 

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

As I said earlier, I am surprised that these files are not machine-generated. After all, the STK500 can do ISP programming for all ISP-SPI devices. i.e. every mega and all non-TPI tinys.

They are, but the machine will only generate combinations that are either robot or human tested first.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
rename the attached file to from txt to xml an plop it in you tools/STK500/xml folder
Can we have one for the 328p please? :-)

I put the file in the folder and the STK500 now shows the 328 however the signature (and some more bits??) are not the same as the 328 and I get a signature mismatch.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John,

Wot Morten sent to you:



  
    
      
        
      
    
  

Wot is needed for a ATmega328P:



  
    
      
        
      
    
  

Can you not spot the difference?

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Can you not spot the difference?

Is it the P in the device name?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And why would the 328p have a different signature if that was the ONLY difference? :) nothing else that could prevent correct programming?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now, well that is a bit outside my knowledge. For consistency would be my first guess

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seemed to work with the 328P. Only tried once.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Copy-paste this to a .BAT file e.g. as6_stk500info.bat

set TOOL=stk500
if NOT /%1/==// set TOOL=%1
REM set AS6="C:\Program Files (x86)\Atmel\Atmel Studio 6.0"
set AS6="C:\Program Files\Atmel\Atmel Studio 6.0"
pushd %AS6%
@for %%F in (devices\AT90*.xml devices\ATmega*.xml devices\ATtiny*.xml) do @(
	@if exist tools\%TOOL%\xml\%%~nF"_"%TOOL%.xml (
@REM		@echo %%~nF supported by %TOOL%
	) else (
		@echo %%~nF unsupported by %TOOL%
	)
)
@popd

You need to change the AS6 variable for 64-bit o.s.

You can also try :

as6_stk500info AVRDragon

This should report the Dragon unsupported list.

Note that I have made no effort to investigate why a device is in the unsupported list. e.g. you check the ATtiny40 data sheet to see that it uses TPI.

As an exercise for Italian readers, you can add support for any device in the devices directory.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
Oh, and if you find it difficult, rename the attached file to from txt to xml an plop it in you tools/STK500/xml folder and the mapping should be created
Excellent - works perfectly. Thanks :)

(can't see how it knows the device signature when it's not in the .xml file, but hey-ho)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

(can't see how it knows the device signature when it's not in the .xml file, but hey-ho)

The tool XML files maps a tool to a device, where the device is defined elsewhere as a separate XML file.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This mapping should be available from 6.1 beta and onwards

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.