Mega1284P Xplained - very frustrating

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

I'm wondering if there is some "magic" to Mega128P-Xplained that I must be missing?

 

I've got a box full of goodies that Atmel has sent me at various times and I was just rummaging through to see if there was anything that would meet a requirement I had. I came across a brand new, boxed Mega1284P-Xplained and because it's got a lot of IO and appears to be designed to work at 3V3 I thought it would fit the bill. But can I get the bloody thing to talk?

 

This is a very old Xplained design - it does not have a debugger on board - just a UC3 acting as a USB-serial bridge. The actual programming is via a bootloader already in the 1284P. It apparently has an AVR911 bootloader installed.

 

The original book talks about using Atmel's AVROSP programming tool to drive it at the PC end but from what I can gather in the source code it appears to need XML ParDescriptionFiles from an AS4 installation (I said it was old!) and I don't want to have to install AS4 simply to get the XMLs.

 

So next thought was to try avrdude. It is supposed to support "-p avr911" to speak the language of the 1284 bootloader.

 

But I just cannot get the two things to chat.

 

Before I give in and blast the bootloader with an Atmel ICE (thanks again Atmel and the "goodie box"!) does anyone know if there is some magic to getting this thing to talk?

 

(and yeah I have messed around with "mode com6 baud=57600" and all the other magic they suggest - but none of that helped so far.)

 

(Frustrated!).

Last Edited: Tue. Oct 27, 2020 - 03:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2


OK so I wasn't expecting this - the Atmel ICE I just opened (as I have temporarily mislaid my other one) has been in a box of goodies that the efficiency fairy had squirreled away some time ago.

 

Bit surprised to find it looks like:

 

 

So I'm guessing there aren't many of these - in gold and signed by Vegard Wollan (one of the AVR two co-designers).

 

Kind of makes up for earlier frustration - wonder what other goodies might be lurking in this box?

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

clawson wrote:
a very old Xplained design - it does not have a debugger on board - just a UC3 acting as a USB-serial bridge. The actual programming is via a bootloader already in the 1284P

Wasn't there a thread about this not so long ago?

 

Can't remember if it was resolved, or just replaced with something up-to-date ...

 

EDIT: I think this is what I was thinking of: https://www.avrfreaks.net/forum/split-starting-avr

 

clawson wrote:
give in and blast the bootloader with an Atmel ICE

I think that's what I'd do!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Oct 27, 2020 - 04:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I don't like being beaten by technology though.

 

If I simply connect to it in bootloader mode and type "S" (which is the AVR911 command to get signature) it responds "AVRBOOT" as expected. If I then let avrdude have a talk to it I see:

Connecting to programmer: .avrdude.exe: Send: . [1b]
avrdude.exe: Send: S [53]
avrdude.exe: Recv: A [41]

avrdude.exe: Recv: V [56] R [52] B [42] O [4f] O [4f] T [54]
avrdude.exe: Send: V [56]
avrdude.exe: Recv: 1 [31] 5 [35]
avrdude.exe: Send: v [76]
avrdude.exe: Recv: ? [3f]
avrdude.exe: Send: p [70]
avrdude.exe: Recv: S [53]
Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 1.5; No Hardware Version given.
avrdude.exe: Send: a [61]
avrdude.exe: Recv: Y [59]
Programmer supports auto addr increment.
avrdude.exe: Send: b [62]
avrdude.exe: Recv: Y [59]
avrdude.exe: Recv: . [01]
avrdude.exe: Recv: . [00]
Programmer supports buffered memory access with buffersize=256 bytes.
avrdude.exe: Send: t [74]

Programmer supports the following devices:
avrdude.exe: Recv: . [00]

avrdude.exe: Send: T [54] . [00]
avrdude.exe: Recv: . [00]
avrdude.exe: error: programmer did not respond to command: select device
avrdude.exe: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.

avrdude.exe: Send: L [4c]
avrdude.exe: Recv: . [0d]
avrdude.exe: Send: E [45]
avrdude.exe: Recv: . [0d]

avrdude.exe done.  Thank you.

which also shows avrdude sending the 'S' command and getting "AVRBOOT" back. It then sends 'V' for version and gets "15" which is interpreted as V1.5. Looking at AVR109:

 

then it seems the command sequence sent is:

 

S> (return software identifier)

<AVRBOOT

V> (return software version)

<15

v> 

<? (possibly not surprising as 'v' does not appear in the list??)

p> (return programmer type)

<S (which apparently means "Serial")

a> (auto increment address)

<Y (Yes, it does autoincrement)

b> (check block support)

<Y[01][00] (yes, 0x100 block size)

t> (return supported device codes)

<[00] (we don't list partcodes)

T[00]> Select device type [00]

<[00]

 

And this is where it all seems to break down. I'm guessing the problem starts when the 't' command just returned [00]

 

Some AVR109 source I found has:

            // Return supported device codes.
            else if(val=='t')
            {
#if PARTCODE+0 > 0
                sendchar( PARTCODE ); // Supports only this device, of course.
#endif /* PARTCODE */
                sendchar( 0 ); // Send list terminator.
            }
            
            
            // Set LED, clear LED and set device type.
            else if((val=='x')||(val=='y')||(val=='T'))
            {
                recchar(); // Ignore the command and it's parameter.
                sendchar('\r'); // Send OK back.
            }

and also:

/* definitions for device recognition */					
#define	PARTCODE	0			
#define	SIGNATURE_BYTE_1	0x1E			
#define	SIGNATURE_BYTE_2	0x95			
#define	SIGNATURE_BYTE_3	0x16			

so it seems like having PARTCODE 0 is a valid thing to do yet avrdude does not seem to want to accept this.

 

Oh well, I probably will give in and simply blast it.

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

atfw?

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

I'm guessing there aren't many of these

Maybe around 15? The serial number on mine is 2/15.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Ah OK ;-)

 

(and I actually used a Dragon, not the ICE to blow away the 1284P code - didn't want to risk damaging the Atmel-ICE !)

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

So how do you get all these goodies out of Atmel/Microchip??????

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

Look at Cliff’s post count. We should call him ‘Pope Cliff’ as he is our earthly connection to the AVR gods!
Thus the golden chalices.

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

Plus many years of AVR use and moderating work. wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly