-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usbasp xmega pdi enhancement #1024
Comments
usbasp firmware patch from the first link:
avrdude patch from the first link: usbasp firmware hex build from the second link (only for ATmega8) avrdude mingw32 build from the second link (only for reference as it is using quite an old version of avrdude). |
usbasp patched firmware with hex files for ATmeag8/48/88 Associated avrdude 6.3 patches for the above. Modified usbasp HW -- FabPDI, ATmega8 FW image and patched avrdude-6.3 Windows binary |
I am not so sure if you are interested to integrate the improvement to your usbasp repo. |
I don't have a xmega avr but I'll order this week some atxmega16e5-au and I'll give it a try . |
Awesome! It makes much more sense to try to add USBasp Xmega support to Avrdude if there is up-to-date USBasp firmware that can easily be flashed to existing hardware. And the little hardware that the USBasp requires to deal with the PDI interface is something that could easily be made and sold online, on Tindie for instance. |
OT: The IC's ( I ordered 3 atxmega16e5 tqfp32 ) arrived yesterday but I cannot make them to work .... I soldered them to smt breakout pcb's, checked all the connections but my mplab snap cannot communicate with them ( using either Studio 7, MPLAB X IDE or avrdude ) . I read the mplab snap pinout for PDI from here https://onlinedocs.microchip.com/pr/GUID-CE8CBDF8-D51B-4BC5-8EF8-F01B7427113D-en-US-4/index.html?GUID-A03031A3-B98D-4579-BE3C-399B78B72D3A . Do you have any minimal setup for atxmega16e5 in case I missed something ? |
I haven't designed anything around an xmega before, so I don't have any known good reference designs. However, this website sells an ATxmega32e5 breakout board where they have the schematic in their user manual: https://botland.store/withdrawn-products/2839-xmega-exploree5-with-atxmega32e5-mod-26.html |
This one is another breakout board schematics. |
Personally I got the breakout board from MCUZone. The boards are also available from AliExpress. |
AFAIU, you have an MPLAB SNAP programmer. If so, is it possible to check if you can program your breakout board with it ? |
So far I use AVRISP mkii for the ATxmega breakout board. I will try SNAP tomorrow. |
If you have some boards based on ATmega32U4 (like Arduino Leonardo), you can build your own AVRISP mkII with the board. Example: |
FYI, I've been bitten from "Symptom: Programming and debugging fails with AVR microcontroller devices that use the UPDI/PDI/TPI interfaces. MPLAB SNAP, Assembly #2-10381-R1 requires an external pull-up resistor for AVR microcontroller devices that use these interfaces". Simple adding a pull-up 1K resistor to PGD pin ( PDI data ) fixed my SNAP issue . From MPLAB® SNAP AVR UPDI/PDI/TPI Interface Modification. |
Glad that your sorted out the issue. I had the same issue when I first tried SNAP. |
Huh! I wonder if that's why I could never make my SNAPs work. |
Very likely! I had to modify mine |
Same here, I had to modify mine as well. |
I just made an adapter with an 1K resistor and a jumper ... |
@dioannidis did you have time to look into this? It would be really cool to have the USBasp support Xmega programming! |
@MCUdude Resumed working on it yesterday ( came back from vacation a few days ago .... ) |
A very early USBasp with PDI support ( using szu's from http://szulat.blogspot.com/ code ) is at https://github.com/dioannidis/usbasp/tree/pdi_support branch Use make PDI=1 main.hex to build it. ( see commit dioannidis/usbasp@e944dd4 ) |
Great work! But does this means that you can't have ISP, TPI and PDI support at the same time? For me personally, this is more important than a support for a virtual serial port. BTW do you have an Avrdude fork where you've applied the USBasp PDI patch as well? I can use to test? |
I'm using the avrdude mingw32 from post #1024 (comment) for preliminary tests |
You can use TPI, PDI and HIDUART/SerialWrite at the same time . Also, if you don't specify HIDUART then the firmware is not a composite device . It's a WCID WINUSB device with MS 2.0 Descriptors ... |
You can find a very early manually patched non working avrdude main at https://github.com/dioannidis/avrdude/tree/pdi_support branch. |
Hi, after a few days fiddling with the firmware code, I assume that the ( relative new ... ) ATxmega16e5 I'm using, is not so forgiving with the hand crafted not stable clock and/or timing of this patches, as maybe older ATxmega is. I tried all the FW's from above ( and some others...) , the patched 6.3 avrdude and my patched main avrdude ( and various combination ) but no success .... As I don't have any other ATxmega, I decided to not spend any more time debugging and trying to fix the patch('s) and rewrite the PDI communication part using SPI . FYI
regards, |
Hi, AFAIU, the only way to connect SPI's MOSI and MISO together for PDI communication, is to tri-state the pins and enable them when they're needed ( Tx - MOSI, Rx - MISO ), as the PDI_DATA pin has an internal pull resistor when PDI physical is enabled. When the SPI is enabled in Master Mode, the input pin (MISO) is automatically configured, and, AFAIU, the only way to tri-state it, during SPI transmision ( which is happens all the time, for clock generation and sync purposes), is to use a buffer for provide HiZ ( i.e. one port of a 74HCT125N ). FYI, I succeeded to implement transmit and receive PDI messages using SPI ( abusing it a lot ....;) ) see: https://github.com/dioannidis/usbasp/tree/pdi_support, but it was more difficult than I anticipated ( for me anyway ... ). This was one of the reasons that it took me so long to reach at this point ( not too much free time is another one ... ). I'll start to add the missing functionality, now that the Tx/Rx part is finished ( need more testing ... ), so I would like to ask if there is still interest for this .
The add-on hardware needed for my implementation needs a buffer to provide high input impendence for MISO and two current limiting resistors . Do you think that will be a problem ? regards, |
Hi, hmm, no response. Anyway, I'll continue working to finish this. Using the following circuit, I can read the signature of the ATXmega16E5 using avrdude ( https://github.com/dioannidis/avrdude/tree/pdi_support ) and usbasp ( https://github.com/dioannidis/usbasp/tree/pdi_support ) ;) .
regards, |
@dioannidis sorry for not responding! I've been busy, but that's no excuse. I'll see if I can re-flash my USBasp and see if I can get it working this weekend. |
@dioannidis |
Just wondering if you have any updates here. Thanks. |
It seems to me that you are saying HW modification is needed to use USBASP with xmega parts, right? Have you been able to program PDI xmega part in the end, other than reading the signature? |
Apologies for the late response ( day work and family life sometimes happens and totally missed this comment ) . I was waiting for @MCUdude to do some test and unfortunately I forgot about it and didn't finished it . To answer your questions, I didn't test anything else except reading the signature :( ( with HW modification or not ) ... I'll take a look again ... |
From here
http://szulat.blogspot.com/2012/08/atxmega-programmer-for-050.html
and here:
https://ketturi.kapsi.fi/2013/05/programming-xmega-with-usbasp-avrdude/
There are patched usbasp FW and patched avrdude version to support PDI using usbasp (arguably the most popular DIY USB AVR programmer).
It would be good to integrate the patch in avrdude.
The text was updated successfully, but these errors were encountered: