Re: ICD and USB UART device
Quote:
Has anyone been able to use a USB UART device to use ICD in Microcode Studio? Or any RS232 device for that matter?
never in a reliable way , ever
apita making a separate model to suit every different osc and config variation for every chip i use .
and after all that effort to be met errors or a stubborn refusal to connect or it only works for a few minutes , then you need to recompile to continue, just junk imo a total waste of time.
xc8 mplabx , wonderful, better than arduino ide for debugging too
Re: ICD and USB UART device
Did you check the USB-UART if it works with a serial output from PIC to PC?
Ioannis
Re: ICD and USB UART device
Quote:
Originally Posted by
Ioannis
Did you check the USB-UART if it works with a serial output from PIC to PC?
Ioannis
I haven't done any serious test except plugging it on day 1 and trying it using ICD and MCS+5, like a kid on Christmas morning.
The circuit has CTS, RTS, RXD, TXD, GND and VCC; that leads me to believe it's capable of the same communication as our old MAX232 ICs. It might even be faster for all I know; I have no docs on this device.
It seems to be the new thing for UART communication over USB, but these boards all seem to love the FT232RL IC. Even Sparkfun likes it:
https://learn.sparkfun.com/tutorials...et-the-ft232rl
But you're right; I have no clue how this affects the serial component of USART comms. At this point, I mistrust myself as much as this new components (I've been out of the loop for so long).
I was hoping one of us had used these with success. If all else fails, I'll do like before and resort to LEDs and LCDs to debug my project. :) I do remember something about USB and interrupts in general not liking ICD - or something of the sort, which sucks cause my project is mainly USB.
My old 16F877 support both USART and UART comm, so does the SAM E70 in a PICKIT4. I don't see why this would be a problem, unless Microcode Studio absolutely needs serial, but again, I don't see why, since it's seeing the new COM4 from the PICKIT4.
I'll try some basic serial exchanges with MCS once I get my LCD wired up. Right now I'm up to my eyeballs learning C++ and VB.NET using Visual Studio 2022.
Re: ICD and USB UART device
Quote:
Originally Posted by
Ioannis
Did you check the USB-UART if it works with a serial output from PIC to PC?
Ioannis
I might be doing a lot more testing on that UART device real soon. I was researching C++ code for Microsoft Flight Simulator 2020 and found this little gem.
https://forums.flightsimulator.com/t...s2022/514651/2
I can't believe I had never thought of using the UART device as my main commmunication device for my project, I was only planning on using it for ICD.
Turns out I may not even have to bother with the whole generate-USB-code problem (MCS generates VB5, I'm using VB.NET - I don't even know yet how much code modifications that would require).
I remember testing USART at relatively high speeds with decent success.
Re: ICD and USB UART device
I have not done anything yet with simulators but I think the data required is not that much. So Serial communication is enough for your needs.
I do use regularly a small FTDI232 board that has Tx, Rx, GND and +5V as outputs with great success on Laptops that lack real serial ports. These little boards do not support other serial control lines though (CTS, RTS etc) and are made by a friend of mine here in Greece.
In general I remember only one USB-2-Serial device that had problems. Can't remember what brand it was, but for sure it was a driver issue.
I do not see why the MCS will not work. Just be sure that your adapter works with a simple test.
I am glad you are delving into C++ and Visual Studio, something I always wanted to do but never had the nerve to.
Ioannis
Re: ICD and USB UART device
You mention learning C++ then reference VB v5 and VB.net. Are you learning a couple? I started with the PC programming using Visual Basic v2015. I don't use it that often, and must consult the 5 books I bought when I dove in trying to learn.
Re: ICD and USB UART device
I'm forced to use whatever example code I can find for my purpose.
So far C++ seems the top candidate.
2 Attachment(s)
Re: ICD and USB UART device
I've put aside my UART device, and finished my programming cable for my Lab X1 board (parts finally came in). It was getting annoying switching the PIC from ZIF to Lab X1 all the time.
Attachment 9363
The cable connections for the MeLabs 40-pin ZIF board are different than their Lab X1. At least I incorporated the pull-up resistor in the connector so my circuits can be programmed by another device if the need ever arrizes.
Re: ICD and USB UART device
Quote:
At least I incorporated the pull-up resistor
What "pull-up resistor" is that? Is there something missing from the X1 board?
1 Attachment(s)
Re: ICD and USB UART device
The instructions seem a little vague, saying it can be configured for both ICSP and ICD. But it only mentions the pull-up in the ICD section.
"The debugger system can be configured to use standard ICSP communication for both
programming and debugging functions."
So I hid one in the hotglue and the ICSP seems to run fine. The hotglue is not elegant, but it keeps all the fine wires separated and adds A LOT of strength to the connector.
Attachment 9373
2 Attachment(s)
Re: ICD and USB UART device
Quote:
Originally Posted by
tumbleweed
What "pull-up resistor" is that? Is there something missing from the X1 board?
The pull-up on the Lab X1 is only 1K, the PK4 wants 10-50K. So I slapped in something in the 20K range; whichever one I had the most.
The 1K probably might have been enough, but I'm getting enough pesky problems without creating more of my own. :)
Attachment 9374
Example of pesky problem: trying to get example code taken from the MSFS SDK docs to work. Except, the example code is missing a parameter.
Took me a while to track down the problem. The DEVs were really helpful though. Had a few of these pesky problems since I started this project.
Attachment 9375
Re: ICD and USB UART device
Quote:
The instructions seem a little vague, saying it can be configured for both ICSP and ICD. But it only mentions the pull-up in the ICD section.
The PIC ICSP and debug connections are the same. In Table B-5, ignore the "debug" column (that's not for a PIC device) and just use the ICSP column connections.
Whatever you add externally to the VPP/MCLR is just going to go in parallel with the 1K on the X1 board (lowering the R), so I'd remove it.
Do you have the JP1 jumper installed? If you tell the PK to use target power then it must be connected as it uses the target VDD connection to power the output drivers of the ICSP lines.
Re: ICD and USB UART device
Quote:
Originally Posted by
tumbleweed
The PIC ICSP and debug connections are the same. In Table B-5, ignore the "debug" column (that's not for a PIC device) and just use the ICSP column connections.
Yeah, I realized that after I posted that pic and started googling those acronyms. :)
Quote:
Originally Posted by tumbleweed
Whatever you add externally to the VPP/MCLR is just going to go in parallel with the 1K on the X1 board (lowering the R), so I'd remove it.
Having 1K in parallel with 20K shouldn<t have an impact when the allowable range is 10-50K, I would think.
Quote:
Originally Posted by tumbleweed
Do you have the JP1 jumper installed? If you tell the PK to use target power then it must be connected as it uses the target VDD connection to power the output drivers of the ICSP lines.
Yup, JP1 is ON, I use an external power supply for the Lab X1. I have a fear of overloading USB ports on my PCs, practically a phobia. :)
I'm taking a mental break from trying to get ICD working on my PK4. I still haven't investigated that other "ICD" command line that I found (although part of me is afraid that only works from MPLABX).
I'm in the process of finishing up a tutorial on adding a COM port in Visual Studio to a basic GUI using C++. I have some MCP2221A-I/P coming in from Newark, so I'm going to investigate using UART. These USB ICs gets recognized as an ordinary serial port in Windows.
I got frustrated with the pains of MCS+5 generating obsolete USB code in C++ version6 (that's like 25 years old). Despite DT's efforts to simplify matters in PBP, I just find the whole USB connectivity thing cumbersome.
Re: ICD and USB UART device
Quote:
Having 1K in parallel with 20K shouldn<t have an impact when the allowable range is 10-50K, I would think.
You might want to rethink that. What's 1K in parallel with 20K?
Although to be honest, I've used 1K before without too many issues.
Re: ICD and USB UART device
Get rid off the 1K resistor. LABX1 was on a very safe side with this value and with 20K in parallel you are now less than 1K.
Are you trying to have ICD with Basic?
Ioannis
Re: ICD and USB UART device
Wouldn't it be better to just change the 1K to a 10K on the X1 and get rid of the extra resistor in the cable?
That way you still have the MCLR pullup on the board.
Re: ICD and USB UART device
Robert said he had 20k in parallel with 1K. So a 20K I think is just fine.
Ioannis
Re: ICD and USB UART device
Thanks for the ideas:
I've made a new cable without any built-in resistors.
I've also put aside my X1 for now, I'll change that 1K pull-up "soonday". :D
For now, I'm sticking with breadboards for USART testing.
Robert
1 Attachment(s)
Re: ICD and USB UART device
Quote:
Originally Posted by
Demon
I've put aside my UART device, and finished my programming cable for my Lab X1 board (parts finally came in). It was getting annoying switching the PIC from ZIF to Lab X1 all the time.
Attachment 9363
...
Guess what happens when you scroll to the very next page of the PK4 documentation? :D
Attachment 9380
Re: ICD and USB UART device
Well, seems you are hit by the RTFM thing! :smile:
Ioannis