Our soon to be launched new family of 8-pin TC2040 cables and solutions will support SAM, AVR, and MIPS. For more information or to be added to our notification list please ...
Has anyone been able to get the CDC UART to work? Apparently, this is a feature that's available when the SNAP is in AVR mode. A serial port shows does up on my computer, but there are no data on pin 7 or 8 when I'm sending data from the serial monitor.
Posted by MCUdude: Wed. Dec 16, 2020 - 09:49 AM(Reply to #110)
1
2
3
4
5
Total votes: 0
Not that I'm aware of? I was currently using the Arduino serial monitor. I know it's "dumb", but it pretty much always works. Does the SNAP require handshaking to function as a USB-UART bridge?
Posted by mraardvark: Wed. Dec 16, 2020 - 10:42 AM
1
2
3
4
5
Total votes: 0
I think the same guidelines apply as for nEDBG/PKOB nano - the IO lines are tristate until a terminal connects and asserts DTR (user guide explains this). Some terminals do this, some have a checkbox that needs checking.
Of course also remember to connect VTG as reference for those level shifters.
Of course also remember to connect VTG as reference for those level shifters.
This was the issue, thank you!
I took the time to update the SNAP firmware too. Damn what a stupidly complicated process. I first had to download MPLAB X (Why isn't this possible in AS7), then (according to a writeup @jeruud did here a while ago), create a PIC project, Install XC8, and then press a circulating arrow symbol in GUI. What happened to atfw.exe?
The Virtual COM Port is a general-purpose USB serial bridge between a host PC and a target AVR device.
The AVR-mode CDC implementation on the MPLAB PICkit4/SNAP Virtual COM port supports:
·Baud rates in the range 1200 bps to 500kbps
·Only 8-bit character format
·No hardware flow control
·One or two stop-bits
IMPORTANT NOTE: Connecting to the Virtual COM port from a terminal emulator will enable pins 7 and 8 on the MPLAB PICkit4/Snap header as TX and RX pins. This functionality is independent of the debugger functionality. You must ensure that you do not useCDC at the same time as a debug interface which also needs those pins, for example JTAG or SWD.
Yes. Well, UPDI is both upload AND debug, for the chips that support it.
SPI - can't with snap? for command line programming
I would guess that "all" of the UPDI programmers are using the same JTAG2UPDI protocols as the JTAGICE3, so it's really easy to add such programmers to avrdude.conf, because you just alias some new USB ID to the JTAGICE3 protocols.
ISP may not be as easy :-( (although there is a "type = "jtagice3_isp";" used by the assorted XPlained Mini boards and such. Maybe someone just hasn't done it.)
- linux x32/64, older & new... :o)
- avrdude 6.3-2021.01.17
None of the avrdude.conf files I can find mention SNAP at all, including Arduino (which has patches) and the CVS sources for avrdude itself. Where did you get yours?
I bought MIcrochip PG164100 (MPLAB SNAP in-circuit debugger), I am unable to use it for a UPDI programmer for AVR controllers.
I removed the R48 from the board and added a pull-up resistor with 4.7 Kohm. I am using Atmel studio Ide, my controller is atmega328P, when I tried in ICSP mode it gave an error as Change PIC mode to AVR mode, How do I convert it? Please help.
Have you upgrade the FW? The FW on a new Snap must be upgraded to be able to use it in Studio. Currently the only way to do this is to try to use it in MPLAB X. For instructions see this: https://www.avrfreaks.net/commen...
i bought the mplab snap a couple of weeks ago. is it not updated?
I don't think you can make that assumption about ANY electronic device you buy. The distributor/retailer you bought it from may be selling you the last one from the back of the store room that has been sitting there for 3 years or whatever!
The distributor/retailer you bought it from may be selling you the last one from the back of the store room that has been sitting there for 3 years or whatever!
I created a simply atTiny95 project under MPLAB. No device is connected.
The program compiles and attempts to load
Data transmission failed. Error code -10121 returned while trying to receive USB data.
A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.
followed by
Refreshing debug tool status...
Refresh debug tool status could not be completed.
MPLAB prompts me to register the SNAP
Initialization failed: Failed while retrieving tool database (.snap) information
null
Failed to initialize Snap
Argh. This is not as easy as I had hoped.
I have followed the instruction as best as I can. My USB cable is less than a metre in length and works with an xplainedMin.
Posted by mraardvark: Wed. May 18, 2022 - 09:48 AM
1
2
3
4
5
Total votes: 0
A classic "fix" with fresh-from-fab Snaps is to try to debug a PIC first - this can help to shake the cobwebs out, and setup the dual-boot correctly for AVR mode to work correctly afterwards. Worth a shot.
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
I hope that the list of steps below is of assistance in understanding what I have done. I trued a different approach to what I did above....
I have removed and reinstalled MPLAB
I started IPE v6.0 and switched to advanced mode
selected device dsPIC30F2020
selected tool Snap xxxxx
hit program
there was no pic connected as i understood that was OK and the program would simply try and access the SNAP. The errors below appeared.
2022-05-18 21:12:22 +1000 - Programming...
*****************************************************
Data transmission failed. Error code -10121 returned while trying to receive USB data.
A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.
*****************************************************
Data transmission failed. Error code -10121 returned while trying to receive USB data.
A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.
I think these errors are to do with the device comms rather than the lack of a PIC attached.
At this point I would reach for the "emergency recovery procedure" via the MPLABX IDE.
It will put your Snap into an even-cleaner-than-factory-fresh mode (SAM-BA bootloader) and build it back up from there.
Thanks gents.... there is progress
I went through the emergency procedure and the device was then detected on a comport and a bootloader downloaded.
Then back to IPE and followed my procedure above with the result below.
Not sure why it mentions AT90CAN128 as I had selected a pic...
2022-05-18 22:13:18 +1000 - Programming...
*****************************************************
Now Downloading new Firmware for target device: AT90CAN128
Updating firmware application...
Connecting to MPLAB Snap
Currently loaded versions:
Application version...........1.10.249 (0x01.0x0a.0xf9)
Boot version..................1.0.0 (0x01.0x00.0x00)
Tool pack version ............1.11.759
Low target voltage detected (43 mV)
The configuration is set for the target board to supply its own power but no voltage has been detected on VDD. Please ensure you have your target powered up and try again.
Connection Failed.
Low target voltage detected (43 mV)
The configuration is set for the target board to supply its own power but no voltage has been detected on VDD. Please ensure you have your target powered up and try again.
*****************************************************
Connecting to MPLAB Snap
Currently loaded versions:
Application version...........1.10.249 (0x01.0x0a.0xf9)
Boot version..................1.0.0 (0x01.0x00.0x00)
Tool pack version ............1.11.759
Low target voltage detected (35 mV)
The configuration is set for the target board to supply its own power but no voltage has been detected on VDD. Please ensure you have your target powered up and try again.
Connection Failed.
Low target voltage detected (37 mV)
The configuration is set for the target board to supply its own power but no voltage has been detected on VDD. Please ensure you have your target powered up and try again.
There was no target connected which (I hope) accounts for the errors now.
The following memory area(s) will be read:
program memory: start address = 0x0, end address = 0x3fff
configuration memory
Data Flash memory
Read complete
2022-05-18 13:49:03 +0100 - Memory Updated: CRC32 checksum value is based on the loaded hex file.
Currently loaded versions:
Application version...........00.04.65
Boot version..................01.00.00
Script version................00.04.91
Script build number...........25982bebb1
Tool pack version ............1.10.701
MPLAB has detected that the low voltage configuration bit on the device is off. Because Snap can use only low voltage programming, this configuration bit must be turned on in order to use Snap. You will need to use a different, blank device, or use another debug tool to erase this device, before continuing with Snap.
Connection Failed.
Then I tried a PIC18F458. Which was rejected completely.
So I set back to ATmega328P and this behaved exactly as earlier.
Posted by david.prentice: Wed. May 18, 2022 - 01:22 PM
1
2
3
4
5
Total votes: 0
This was the first time that I have tried MPLABX IPE v6.00
It seems fairly straightforward.
I had previously only used IDE v6.00
which behaves in a similar way. Just has extra-long drop-downs.
I strongly recommend that you connect a real-life AVR chip. (it will give you confidence)
It is not strictly necessary. AS7.0 should work with SNAP now that you have updated the SNAP firmware.
David.
Edit. My apologies for being grumpy earlier. If you say which AVR you are using I can probably repeat the "Factory Reset SNAP, connect to your specific AVR" steps. e.g. with ATtiny85
I have now connected an atTiny85 to IDE/IPE and programmed OK.
I swapped to Studio and found that it did not know about the t85 for SNAP. i.e. when I selected SNAP as the debugging tool in project properties, t85 was not listed.
I downloaded the atTinyDfp pack in Tools->Device package manager and now t85 was listed.
I have now
- programmed a device,
- flashed a led,
- modified RAM using the debugger to change the LED flash rate
- stopped at a breakpoint
This is a good time to stop for the evening.
Thanks to all for your assistance to get this far.
If someone from Microchip is reading....
Despite having read the posts beforehand.... this was a pretty challenging start to use a new tool.
Having to plug into MPLAB was a bit klunky... but I understand the history.
The process from there was not fun.
It would be really great if Microchip could publish the definitive "getting started guide"
[if my experience is typical.... it might be a bit embarrassing to write the guide'
The current Microchip web site 404 offer :
via 404 | Microchip Technology
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
TopThe coupons SPOOKY68 and 404Discount are not cumulative! I wanted Snaps with 100% discount
- Log in or register to post comments
Topexpires 31-Dec'19
https://www.avrfreaks.net/forum/eoy2019dt#comment-2812531
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Top"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Topvia Dev Tool Deals | Microchip Technology
edit 2-Sep'20 :
edit 12-Sep'20 :
edit 14-Sep'20 :
edit 16-Sep'20 :
edit 22-Sep'20 :
edit 23-Sep'20 :
edit 25-Sep'20 :
edit 29-Sep'20 :
edit 30-Sep'20 :
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Topcurrently 8-pin SIL to 6-pin TC :
You searched for "PICkit 4" | Tag-Connect
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Topstock is low
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
TopHas anyone been able to get the CDC UART to work? Apparently, this is a feature that's available when the SNAP is in AVR mode. A serial port shows does up on my computer, but there are no data on pin 7 or 8 when I'm sending data from the serial monitor.
- Log in or register to post comments
TopAre you using the DTR signaling?
- Log in or register to post comments
TopNot that I'm aware of? I was currently using the Arduino serial monitor. I know it's "dumb", but it pretty much always works. Does the SNAP require handshaking to function as a USB-UART bridge?
- Log in or register to post comments
TopI think the same guidelines apply as for nEDBG/PKOB nano - the IO lines are tristate until a terminal connects and asserts DTR (user guide explains this). Some terminals do this, some have a checkbox that needs checking.
Of course also remember to connect VTG as reference for those level shifters.
- Log in or register to post comments
TopThis was the issue, thank you!
I took the time to update the SNAP firmware too. Damn what a stupidly complicated process. I first had to download MPLAB X (Why isn't this possible in AS7), then (according to a writeup @jeruud did here a while ago), create a PIC project, Install XC8, and then press a circulating arrow symbol in GUI. What happened to atfw.exe?
- Log in or register to post comments
TopTotally agree :/
- Log in or register to post comments
TopPinouts for Interfaces | MPLAB Snap In-Circuit Debugger User's Guide
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Topgood day!
cat from avrdude.conf
question's...
UPDI - the debug mode (yes/no?)
SPI - can't with snap? for command line programming
if I'm wrong, correct this and do not criticize :o)
- Log in or register to post comments
TopYes. Well, UPDI is both upload AND debug, for the chips that support it.
I would guess that "all" of the UPDI programmers are using the same JTAG2UPDI protocols as the JTAGICE3, so it's really easy to add such programmers to avrdude.conf, because you just alias some new USB ID to the JTAGICE3 protocols.
ISP may not be as easy :-( (although there is a "type = "jtagice3_isp";" used by the assorted XPlained Mini boards and such. Maybe someone just hasn't done it.)
None of the avrdude.conf files I can find mention SNAP at all, including Arduino (which has patches) and the CVS sources for avrdude itself. Where did you get yours?
- Log in or register to post comments
Topwork is in full swing: o)
facchinm/avrdude
+
i need to connect atmega328 ISP to SNAP through avrdude
apparently, it's impossible?
if I'm wrong, correct this and do not criticize :o)
- Log in or register to post comments
TopI've been using the SNAP and the PICkit4 as ISP programmers using this very fork of Avrdude. Works perfectly!
All you have to do is add the SNAP and PICkit4 to the avrdude.conf file, like I've done here: MiniCore avrdude.conf
- Log in or register to post comments
Topthank
if I'm wrong, correct this and do not criticize :o)
- Log in or register to post comments
Topedit : oops ... already in post #118
in GitHub - facchinm/avrdude: mainline avrdude imported from svn://svn.savannah.nongnu.org/avrdude/trunk
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Topmore enclosures :
"mplab snap"-things - Search - Thingiverse
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
Top"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
TopHi ,
I bought MIcrochip PG164100 (MPLAB SNAP in-circuit debugger), I am unable to use it for a UPDI programmer for AVR controllers.
I removed the R48 from the board and added a pull-up resistor with 4.7 Kohm. I am using Atmel studio Ide, my controller is atmega328P, when I tried in ICSP mode it gave an error as Change PIC mode to AVR mode, How do I convert it? Please help.
Regards.,
AMAR
amar.raghava@gmail.com
- Log in or register to post comments
TopHI,
I bought MPLAB SNAP in-circuit debugger. I am new to this.
My requirement is to use this one as a UPDI programmer for avr ICs (like ATMEGA328p, 1608,4808, etc).
I Removed the R48 and also did the modification also( i.e gave a pull-up to J4 pin4 with 4.7K).
I got the error " change pic mode to avr mode before you start."
Please help me with how to change the mode.
Regards.,
AMAR
amar.raghava@gmail.com
- Log in or register to post comments
TopHave you upgrade the FW? The FW on a new Snap must be upgraded to be able to use it in Studio. Currently the only way to do this is to try to use it in MPLAB X. For instructions see this: https://www.avrfreaks.net/commen...
- Log in or register to post comments
Topi bought the mplab snap a couple of weeks ago. is it not updated?
- Log in or register to post comments
Top- Log in or register to post comments
TopI don't think that I have ever bought an Atmel programmer that did not require updating. Especially if it was the first batch.
If an item is "update-able" the manufacturer seldom worries about the firmware installed at the factory.
They just assume that the User follows the instructions to upgrade firmware before use.
The Nano Every does not have an external pin for UPDI. Only a tiny test-point.
I suggest that you experiment with other UPDI boards first.
But first off you need to do the hardware mod on the SNAP.
David.
- Log in or register to post comments
Topwww.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.
- Log in or register to post comments
TopOK.... so I "splurged" on a SNAP. It is not yet delivered but I wonder if anyone can assist with this query.
iirc when entering debug mode with debugWire, it is necessary to cycle the power to the target device. The xplainedMini has circuitry to do that.
I understand that SNAP senses the target Vcc but does not feed it.
Does this mean that the target needs a manual power cycle when entering debug mode with the SNAP?
Thanks in advance
Greg
regards
Greg
- Log in or register to post comments
TopYes. Just like JTAGICE-2, JTAGICE-3, Dragon, ATMEL-ICE, PicKit4, ...
That is why AS4.x AS5.x, AS6.x, AS7.0, Microchip Studio 7.0 prompt you.
And why you should do what they ask.
David.
- Log in or register to post comments
TopSo my SNAP arrived!!
I created a simply atTiny95 project under MPLAB. No device is connected.
The program compiles and attempts to load
followed by
MPLAB prompts me to register the SNAP
Argh. This is not as easy as I had hoped.
I have followed the instruction as best as I can. My USB cable is less than a metre in length and works with an xplainedMin.
Any suggestions on obvious errors I am making?
Thanks
regards
Greg
- Log in or register to post comments
TopTry typing accurately.
We all make typos. But it does not inspire confidence when you ask a question.
David.
- Log in or register to post comments
TopAbsolutely correct. Apologies for that.
Any suggestions regarding the problem are much appreciated.
regards
Greg
- Log in or register to post comments
TopYes. Just write down each step that you take. Preferably with a number.
Then we can replicate each numbered step. And see where the problem occurs.
The hardware mod is not necessary for ISP / debugWIRE.
i.e. you just need USB cable and six wires to your 3x2 ISP header. (and power to the target)
David.
- Log in or register to post comments
TopA classic "fix" with fresh-from-fab Snaps is to try to debug a PIC first - this can help to shake the cobwebs out, and setup the dual-boot correctly for AVR mode to work correctly afterwards. Worth a shot.
- Log in or register to post comments
Top- Log in or register to post comments
TopSeriously. Just write down each step.
- Log in or register to post comments
TopOrdered over the weekend and delivered yesterday. And I only paid normal prices.
#1 Hardware Problem? https://www.avrfreaks.net/forum/...
#2 Hardware Problem? Read AVR042.
#3 All grounds are not created equal
#4 Have you proved your chip is running at xxMHz?
#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."
- Log in or register to post comments
TopWell you don't actually have to _have_ a PIC, just pretend. The Snap will be updated before MPLABX finds out you have no PIC at all :)
- Log in or register to post comments
TopI presume that I just have to power-up my SNAP with J3 closed. Then it will return to factory state.
So we just have to follow the OP's steps to replicate his problem.
It is not much good to just lay out the steps for the OP.
There is no guarantee that the OP would follow instructions.
If the OP writes his actual steps down we can see what he has done.
David.
- Log in or register to post comments
TopVery friendly this evening.
regards
Greg
- Log in or register to post comments
TopI hope that the list of steps below is of assistance in understanding what I have done. I trued a different approach to what I did above....
I think these errors are to do with the device comms rather than the lack of a PIC attached.
Any suggestions are very much appreciated.
regards
Greg
- Log in or register to post comments
TopAt this point I would reach for the "emergency recovery procedure" via the MPLABX IDE.
It will put your Snap into an even-cleaner-than-factory-fresh mode (SAM-BA bootloader) and build it back up from there.
- Log in or register to post comments
TopHow to Use the Hardware Tool Emergency Boot Firmware Recovery Utility | MPLAB® Snap In-Circuit Debugger User's Guide
"Dare to be naïve." - Buckminster Fuller
- Log in or register to post comments
TopThanks gents.... there is progress
I went through the emergency procedure and the device was then detected on a comport and a bootloader downloaded.
Then back to IPE and followed my procedure above with the result below.
Not sure why it mentions AT90CAN128 as I had selected a pic...
There was no target connected which (I hope) accounts for the errors now.
next step... connect a target.
regards
Greg
- Log in or register to post comments
TopI followed the Hardware Reset procedure. This downloaded default firmware via a SAMBA bootloader.
I ran your steps in #144.
Selected dsPIC30F2020
Selected SNAP
Of course I could not connect or program a nom-existent dsPIC30F2020
So I selected ATmega328P
Selected SNAP
Connected SNAP to Uno 3x2 (powered)
Then clicked [READ]
Which gave this report:
*****************************************************
Now Downloading new Firmware for target device: ATmega328P
Updating firmware application...
Connecting to MPLAB Snap
Currently loaded versions:
Application version...........1.10.249 (0x01.0x0a.0xf9)
Boot version..................1.0.0 (0x01.0x00.0x00)
Tool pack version ............1.10.701
Target voltage detected
*****************************************************
The following memory area(s) will be read:
program memory: start address = 0x0, end address = 0x3fff
configuration memory
Data Flash memory
Read complete
2022-05-18 13:49:03 +0100 - Memory Updated: CRC32 checksum value is based on the loaded hex file.
I then connected a PIC45K50.
*****************************************************
Connecting to MPLAB Snap
Currently loaded versions:
Application version...........00.04.65
Boot version..................01.00.00
Script version................00.04.91
Script build number...........25982bebb1
Tool pack version ............1.10.701
MPLAB has detected that the low voltage configuration bit on the device is off. Because Snap can use only low voltage programming, this configuration bit must be turned on in order to use Snap. You will need to use a different, blank device, or use another debug tool to erase this device, before continuing with Snap.
Connection Failed.
Then I tried a PIC18F458. Which was rejected completely.
So I set back to ATmega328P and this behaved exactly as earlier.
David.
- Log in or register to post comments
TopThis was the first time that I have tried MPLABX IPE v6.00
It seems fairly straightforward.
I had previously only used IDE v6.00
which behaves in a similar way. Just has extra-long drop-downs.
I strongly recommend that you connect a real-life AVR chip. (it will give you confidence)
It is not strictly necessary. AS7.0 should work with SNAP now that you have updated the SNAP firmware.
David.
Edit. My apologies for being grumpy earlier. If you say which AVR you are using I can probably repeat the "Factory Reset SNAP, connect to your specific AVR" steps. e.g. with ATtiny85
- Log in or register to post comments
TopI have now connected an atTiny85 to IDE/IPE and programmed OK.
I swapped to Studio and found that it did not know about the t85 for SNAP. i.e. when I selected SNAP as the debugging tool in project properties, t85 was not listed.
I downloaded the atTinyDfp pack in Tools->Device package manager and now t85 was listed.
I have now
- programmed a device,
- flashed a led,
- modified RAM using the debugger to change the LED flash rate
- stopped at a breakpoint
This is a good time to stop for the evening.
Thanks to all for your assistance to get this far.
If someone from Microchip is reading....
Despite having read the posts beforehand.... this was a pretty challenging start to use a new tool.
Having to plug into MPLAB was a bit klunky... but I understand the history.
The process from there was not fun.
It would be really great if Microchip could publish the definitive "getting started guide"
[if my experience is typical.... it might be a bit embarrassing to write the guide'
regards
Greg
- Log in or register to post comments
TopI agree. Life will be so much easier if and when SNAP can be updated via AS7.0
Incidentally, the PicKit4 could connect to a PIC18F458 in MPLABX IPE.
And then go straight to an ATmega328P in AS7.0 i.e. change from PIC mode to AVR mode
Mind you. I doubt if I will ever want to use either of the two PIC18F chips that I possess.
- Log in or register to post comments
TopPages