AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
js
PostPosted: Nov 19, 2009 - 04:14 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

So I zapped the 1287 with the 1287 firmware provided with the Xplain docs using the Dragon, but it seesm to be just the bootloader code so the existinng application for the USART bridge has now disappeared.

Where do I find it? Looked around the Atmel site but could not find any info.

I should be able to program it back in using FLIP, correct?

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly


Last edited by js on Nov 25, 2009 - 08:03 PM; edited 2 times in total
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
j0n90
PostPosted: Nov 19, 2009 - 09:56 AM
Wannabe


Joined: Aug 01, 2007
Posts: 80


Hey what revision hardware do you have? Mine is revision 1 and I modded the hardware to get the xmega bootloader working through the USB port.
 
 View user's profile Send private message  
Reply with quote Back to top
abcminiuser
PostPosted: Nov 19, 2009 - 12:13 PM
Moderator


Joined: Jan 23, 2004
Posts: 7014
Location: Melbourne, Victoria, Australia

How does the 1287 interface with the XMEGA? I could modify my LUFA USBtoSerial demo in a few minutes to solve that problem everyone's been having with the board...

- Dean Twisted Evil

_________________

 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
david.prentice
PostPosted: Nov 19, 2009 - 12:50 PM
Raving lunatic


Joined: Feb 12, 2005
Posts: 7696
Location: Cratfield, England

Dean,

The Xplain uses a soft UART in the 1287 to interface to the xmega.

I wrote a suitable soft UART and adapted the LUFA code. But then ran into problems with Windows... ? and generally got fed up and gave up.

The Xplain board obviously comes with a 1287 application that provides the CDC comms to the PC for the xmega UART. It is also supposed to interface to a xmega bootloader as the communication device.

Read the Xplain app note for a better explanation.

The 1287 DFU bootloader is available on the Atmel website. But if you install this, you lose the magic 1287 app that provides the UART bridge. An of course there is no replacement binary for the 1287 app on the Atmel website.

I have asked a couple of times for someone to READ the 1287 app into a hexfile, so that you can re-install. But no-one has chosen to oblige. I presume that they have all done the same as John and me. --- installed the DFU and erased the chip in the process.

The idea behind a single board which can just connect to a PC via one USB cable is brilliant. BUT ONLY IF IT WORKS. You can investigate most of the xmega features with the Xplain and it would be an excellent evaluation tool.

However if you compare this with evaluation boards from other manufacturers, it falls far behind. However good the xmega is, it can hardly compete with the available silicon + functional devkits from other vendors.

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
j0n90
PostPosted: Nov 19, 2009 - 02:35 PM
Wannabe


Joined: Aug 01, 2007
Posts: 80


Quote:
How does the 1287 interface with the XMEGA?


The XMega connects to PD0(XMega TX) and PD1(XMega RX) of the 1287 chip. I'm sure a software uart should be possible. I don't seem to remember a com port being discovered by the pc with the old firmware though. The USB may have been designed as a debug port as the pdi port is connected to the 1287 too.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Nov 19, 2009 - 10:02 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Dean, I was thinking of using LUFA for a replacement but it may all be well beyond me... Smile If you are preared to mess around with it I'll try...nothing more to lose!

Reading the 1287 would be ok IF the chip is not locked.

Anyway I only zapped the code because I was under the false understanding that the code provided was the entire code and not just the bootloader. Yep, the old ASS_U_ME.

Atmel should supply the code, surely it is not top secret, well maybe they think that someone will make a few bucks by using a 1287 as a PDI progammer??

The board is version 2 by the way.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
j0n90
PostPosted: Nov 20, 2009 - 04:48 PM
Wannabe


Joined: Aug 01, 2007
Posts: 80


I've replaced the hardware uart with an asm software uart i wrote last night in the CDC example that is on the atmel website. The xmega bootloader also available on the atmel website is working fine with the AVROSP utility.
I'll upload the code when i've tidied it up.
If anyone wants the binaries in the meantime.....
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Nov 20, 2009 - 08:43 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Quote:
I've replaced the hardware uart with an asm software uart
I'm confused, there is no hardware uart from the 1287 to the Xmega, just a bit banged version.

The harware USART1 is used for PDI programming by the looks of things.
Quote:
The xmega bootloader
You mean there WAS one in the Xplain's Xmega chip? Laughing that would have been obliterated within the first few minutes after I got the board and proceeded to plug in the Dragon with it's new found powers.

All I need is basically a USB to TTL converter out of the 1287, nothing else for now. There is some USART code already available that works with USARTC0 in CVAVR. (of coure I have plenty of RS232 to TTL boards around if I need to use other USARTs)

Anyway I have posted a ticket for the above with Atmel.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
alancarr
PostPosted: Nov 21, 2009 - 04:07 AM
Rookie


Joined: May 27, 2007
Posts: 39
Location: Portland, OR

I don't know if any of you still need it, but attached is a hex file read from the 1287 on my Xplain board.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Nov 21, 2009 - 04:42 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Alan that seems to be the whole chip, application and bootloader, correct?

Is that for a version 1 or version 2 board? The bootloader section seems different than the one supplied with AVR1907 for version 2 board.

I'll give it a try anyway.

oops goofed, there is no [bootloader programmed in the] 1287 in version 1 board it seems. Embarassed

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly


Last edited by js on Nov 21, 2009 - 05:10 AM; edited 1 time in total
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
js
PostPosted: Nov 21, 2009 - 04:57 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

We have lift off!! Com 50 comes back on when I plug in the USB lead. Bootloader seems OK too as FLIP can see it if I power up with the bootloader jumper in place.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
js
PostPosted: Nov 21, 2009 - 08:18 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

And to round things off this is the (messed up) USART bridge at work. I have used the CVAVR code for the STK600 as the Xmega USART C0 is already prewired to the 1287 bridge.

Also used PDI for "debugging" ie single stepping through the code. Who knows where the problem lies, most likely with the bridge and soft UART??

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
j0n90
PostPosted: Nov 24, 2009 - 11:20 AM
Wannabe


Joined: Aug 01, 2007
Posts: 80


Sorry, I think some wires got crossed with software/hardware on my previous post. Also forgot to attach the binarys to it!!

I've got this working reliably if you want to try it out. It basically provides a 9600 baud serial bridge out of the 1287 to the xmega chip USARTC0.

The bootloader application for the xmega is also in there too.


Last edited by j0n90 on Nov 24, 2009 - 06:39 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Nov 24, 2009 - 01:08 PM
Raving lunatic


Joined: Feb 12, 2005
Posts: 7696
Location: Cratfield, England

The 1287 Bridge hex file successfully installs a COM port.

It then repeatedly sends "Select Pressed !" to the Terminal.
You can get your xmega application to send text out through this "port" but is a little unreadable since the screen fills completely with the "Select Pressed !" text.

Since the 1287 has no user accessible pins, how can you stop this?

Incidentally the Atmel 1287 HEX file posted a few days ago provides a 9600baud soft UART but it loses characters like they are going out of fashion.

It looks as if this soft UART is more robust. But I suspect that you have to pull a 1287 pin high or low for this "text" to stop.

Has anyone got this working?

David.

Edit. I think that I have found the problem. I was using the DataFlash on the Xplain board. I suspect that the 1287 bridge code is reading the SS pin. (which is of course being used by when you access the DataFlash)
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
j0n90
PostPosted: Nov 24, 2009 - 09:17 PM
Wannabe


Joined: Aug 01, 2007
Posts: 80


At the risk of offence, most likely to Dean after unashamedly hijacking his fantastic USBtoSerial demo for his LUFA project (sorry). Here is the source for anyone who is interested.

Think the makefile could do with some attention as I've never used them before!

Cheers.

John.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Nov 24, 2009 - 09:27 PM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Of course it would be nice if Atmel addressed this problem, I put in a ticket but nothing more than an automated response so far.

I'm getting into the hacking mood to disconnect the 1287 from the Xmega, remove the 2 resistors from the USART1 pins and use that for the bridge as I don't really care about possible PDI programming via the 1287. In fact there is no need to cut tracks as the pins now used for soft uart can just be made inputs.

But I'll need to come to grips with Dean's LUFA (or whatever the new name is) code I guess. Smile

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
abcminiuser
PostPosted: Nov 25, 2009 - 12:06 AM
Moderator


Joined: Jan 23, 2004
Posts: 7014
Location: Melbourne, Victoria, Australia

Quote:

At the risk of offence, most likely to Dean after unashamedly hijacking his fantastic USBtoSerial demo for his LUFA project (sorry). Here is the source for anyone who is interested.

Think the makefile could do with some attention as I've never used them before!

Cheers.

John.


John,

That codes based off MyUSB 1.5.3, which is at *least* a year old. Do you mind if I convert it over to the latest LUFA framework? Also, can I have your permission to use your soft USART code in the code, which will be used as an official LUFA project?

- Dean Twisted Evil

_________________

 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
valusoft
PostPosted: Nov 25, 2009 - 01:12 AM
Raving lunatic


Joined: Jul 02, 2005
Posts: 2632
Location: Melbourne, Australia

abcminiuser wrote:
- Dean Twisted Evil
ahh, look who has new "sunnies" ...

_________________
Ross McKenzie
ValuSoft
Melbourne Australia
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Nov 25, 2009 - 02:39 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 13030
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

Ohh THAT John...

Anyway I think you should make the program flexible enough so that either a soft USART code or the real USART1 could be used... with a little hack, with a little hack

oh that's a Beatle's song.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
abcminiuser
PostPosted: Nov 25, 2009 - 04:24 AM
Moderator


Joined: Jan 23, 2004
Posts: 7014
Location: Melbourne, Victoria, Australia

Well, I'm still pending John's approval for his code (yes, it's MIT licensed, but I'd rather have explicit permission when I can) but I've managed to knock up a first revision:

http://code.google.com/p/lufa-lib/sourc ... INBridge.c

See how much better it all is with the new framework? Very Happy

I haven't got a XPLAIN board yet to test it with, but it should be functionally identical to John's version based on the ancient MyUSB distribution.



John - I really need to dig up the schematics. Are you saying that the XMEGA's USART is connected to USART1 of the AT90USB1287? If so, I might as well remove the software USART and switch over to hardware.

- Dean Twisted Evil

_________________

 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits