News:

;) This forum is the property of Proton software developers

Main Menu

Pickit 3 as serial output

Started by Yves, Apr 23, 2023, 06:52 AM

Previous topic - Next topic

Yves

Hello all,

I'm using Pickit 3 for all my my project application. In some finished projects I add a din plug in order to be able to do a quick update or calibration and not to have to open the box. Often I need to monitor the data by RS235 on and excel and apply some changes. I know Pickit 3 has a inbuild  logic tool  to watch various  states in a dedicate pins. Could I send data from the pic via the PGC or PGD a  RS235 signal to a virtual com port via Pickit 3? It will have the advantage of not to have to plug or unplug my Pickit 3. The pic will only send and not receive.

Yves   
Yves

tumbleweed

The PK2 can do that, but I don't think the UART tool firmware was ever implemented for the PK3.

Yves

Thank you tumbleweed,
 
You said "you don't think...", Can you tell me how you use to do that with the Pickit 2?

Yves
Yves

rick.curl

Hi Yves-
Look here: PicKit Serial documentation
As far as I can tell, the serial analyzer is just a Pickit 2 with different firmware.  you can download the firmware from the link above.

-Rick

rick.curl

#4
Quote from: Yves on Apr 23, 2023, 04:19 PMCan you tell me how you use to do that with the Pickit 2?
I just noticed that in the Pickit2+ software you can go to "Tools>UART tool" to do this.  Note that in the Pickit3+ software there is no UART option- there's only a "logic tool".

-Rick

tumbleweed

The PK2 uart tool is documented in the pickit2 users guide DS51553E
PK2 uses different firmware from the PK3, so the serial analyzer code won't work with it.

As I said, I don't recall the uart tool ever being available for the PK3.


jaka

I have recently modified PICkit3 firmware and GUI software to add UART tool support. I haven't yet released it, but I can release if someone wants to test.

Yves

Hello Jaka,

Yes I will be glad to test it as long I can revert back to the original GUI if something goes  wrong

Yves
Yves

jaka

OK, I will release it later today (don't have access to files right now). It is possible to revert back to original PICkit3 GUI and firmware.

jaka

#9
You can download the PK3 uart tool test version from link below. It doesn't need to be installed, just extract the files to a directory and run from there. First you need to update the firmware (Tools menu, download PICkit operating system), and choose PK3OSV020007.hex

After firmware update, you should be able to use the UART Tool from Tools menu.

The original PICkit3 software should work with this new firmware. But if you need/want to revert back, you can upload PK3OSV020005.hex which is supplied with the original PK3 software.

https://ihme.org/~jaka/PK3_uart_tool_preview.zip

Yves

Thank you Jaka, I will have a go at it.

Yves
Yves

Yves

Hi Jaka,
It works fines the only thing it doesn't understand 13 or CR end of line. I think Microchip didn't include it to sale their serial dongle.
I wish the data could be conveyed through the the Pickit  USB as virtual port but maybe it is too much to ask. lol
Many thanks.

Yves



Yves

jaka

Hi Yves,

Thank you for confirming it works for you.

Adding support for the different combinations of LF, CR LF and CR is good idea and should be easy to implement.

A virtual COM port would be nice also, but more difficult to implement. I remember that someone implemented such behavior with PICkit2, by modifying the GUI software AND using separate COM port virtualisation software.

Yves

Hello Jaka,

If you find the modified GUI that allows virtual com port it will will be great. I don't understand how Microchip don't think about something like that in the first place. Maybe it is to protect the sale of their other expensive tools or a complete lag of imagination.

Yves
Yves

jaka

Hi Yves,

Sorry for the delay. I found the forum message where the modified tool was discussed, but it wasn't possible to download it https://sonsivri.to/forum/index.php?topic=20262.0

So I tried to add this feature to PICkitminus. I have done some testing with it, and it seems to work as expected.

First, you need to install software which creates 'virtual null modem cable'. It will basically create two virtual COM ports which are linked together. I have done my tests using com0com. Another possibility is Eterlogic VSPE, but I haven't tried that.
https://sourceforge.net/projects/com0com/
https://eterlogic.com/Products.VSPE.html

Then you must set up the above software to have at least one virtual port pair. In com0com, you need to check 'use Ports class', so the port names are COMxx and not CNCxx. Other settings can be left to default.

Then open the software you want to use for communication with your target (e.g. terminal). Open connection to one of the virtual ports.

Now, fire up PICkitminus and go to UART tool. Connect to PICkit with desired baud rate as before. Then select the other virtual port and connect. The traffic from PICkit with be forwarded to that COM port. It could probably also be a real COM port instead of virtual, but I haven't tried.

https://www.ihme.org/~jaka/PK3_uart_tool_preview_v2.zip

I have also added support for LF and CR newlines. They affect sending and receiving when using UART Tool GUI for communications. For port forwarding using com0com, it doesn't have effect. The newline type must be set in terminal software used. Could you report if this feature works as you would expect?

jaka

A small bug fix update
- Fix behavior of different newline types if local echo is enabled
- Limit baud rates based on connected tool (Original PICkit2 supports up to 38400 baud. PICkit3 and PK2M support continuous rates up to 115200, on short bursts up to 400000 baud)

https://www.ihme.org/~jaka/PK3_uart_tool_preview_v3.zip

Yves

Many thanks Jaka,

I will definitely try it.

Yves
Yves