A USB serial converter some may find useful

A USB serial converter some may find useful

Postby Tight Yorky » Sun Jul 26, 2015 12:06 am

Hello,
I have attached here a Hex file for a USB serial converter that somebody may find useful.
It is based on the PIC24FJ64GB002 using a minimum of components. This allows direct connection of a PIC USART to a PC.
I have also attached the circuit sketch. I put this together because I got tired of adding a level shifter to work with my USB/Serial converter.

I have some more info associated with the build, which I will post later. Feel free to use it. Post any questions and I will try and answer them.

T Yorky
Attachments
01_CircuitSketch.jpg
Circuit Sketch
01_CircuitSketch.jpg (134.07 KiB) Viewed 5211 times
CDC_PIC24.hex
CDC Code
(40.24 KiB) Downloaded 499 times
Tight Yorky
 
Posts: 22
Joined: Thu Jun 19, 2014 10:32 pm
PIC experience: Professional 2-5 years with MCHP products

Re: A USB serial converter some may find useful

Postby Tight Yorky » Sun Jul 26, 2015 7:35 am

I had some spare time last Friday afternoon so put this quick project together and a step by step build.
The serial converter uses a piece of vero board and a 'Tic Tac' box. See '02':

02_Box_VeroBoard.jpg
02_Box_VeroBoard.jpg (112.23 KiB) Viewed 5207 times


Next step to sketch out the vero board layout on a grid. Note that where a line has a dot along it, this is where two link wires pass through a hole.
As a hint, if you save the wire trimmings of resistors/capacitors, these are of a small enough gauge that two will pass through a vero board hole.
I find the numbering along the sides helps transferring the sketch to the board.
See '03':

03_Vero_Layout.jpg
03_Vero_Layout.jpg (107.96 KiB) Viewed 5207 times
Tight Yorky
 
Posts: 22
Joined: Thu Jun 19, 2014 10:32 pm
PIC experience: Professional 2-5 years with MCHP products

Re: A USB serial converter some may find useful

Postby Tight Yorky » Sun Jul 26, 2015 7:49 am

Next step is to mark up the vero board with the locations for cutting the tracks.
As a hint, I place the board over a piece of paper on which the row/column numbers are marked.
Note how the numbers are reversed on the sketch which allows for working on the underside. See 04:

04_VeroMarkUp.jpg
04_VeroMarkUp.jpg (85.35 KiB) Viewed 5206 times


After transferring the cutting points with a marker. A double check, then cut them. See 05:

05_VeroTracksCut.jpg
05_VeroTracksCut.jpg (124.03 KiB) Viewed 5206 times


Next step is clean up the old vero board and cut to size. See 06:

06_CleanedUpCut.jpg
06_CleanedUpCut.jpg (117.01 KiB) Viewed 5206 times


Next tin the tracks for soldering. See 07:

07_VeroTinned.jpg
07_VeroTinned.jpg (112.85 KiB) Viewed 5206 times
Tight Yorky
 
Posts: 22
Joined: Thu Jun 19, 2014 10:32 pm
PIC experience: Professional 2-5 years with MCHP products

Re: A USB serial converter some may find useful

Postby Tight Yorky » Sun Jul 26, 2015 8:09 am

Next step is to start soldering links and components.
As a hint, I find it easier to place links on first. Remember some holes have two wires passing through.
This is the case for the 3.3V LDO regulator, the LEDs and a resistor. A small capacitor shares a couple of the LDO holes.

The PIC chip goes on last. Again I find the sketch makes it easier to work on the board without the PIC IC as a reference.

I was going to use my spring loaded program lead adaptor on this. But I couldn't get it to work well with the vero board so I soldered a header on later.
Note that some links are under the PIC IC. See 08:

08_LinksComponents.jpg
08_LinksComponents.jpg (118.92 KiB) Viewed 5206 times


Next power the board prior to placing the PIC on. Check voltages are what the're expected and there are no errors. Then solder the PIC on. See 09:

09_PIC_Fitted.jpg
09_PIC_Fitted.jpg (95.33 KiB) Viewed 5206 times


A connector has also been added for the UART signals. What can't be seen in this photo is that later I used tippex correcting fluid to paint the header and write the 0v/Rx/Tx on the side.

The converter was flashed by a PICkit3 with the HEX file shown in the first post. Note rather than a USB connector I have used a flying lead.
The one shown is from an old mouse where the cable became frayed at the entry point. A knot in it stops it being pulled through. See 10:

10_USB_Lead.jpg
10_USB_Lead.jpg (130.1 KiB) Viewed 5206 times
Last edited by Tight Yorky on Sun Jul 26, 2015 9:08 am, edited 1 time in total.
Tight Yorky
 
Posts: 22
Joined: Thu Jun 19, 2014 10:32 pm
PIC experience: Professional 2-5 years with MCHP products

Re: A USB serial converter some may find useful

Postby Tight Yorky » Sun Jul 26, 2015 8:42 am

Just a note on how it works. It is based on MChips CDC emulator from their library (approx. 2011/12) with some changes.
Differences are that it has a flip-flop buffer for the receive which allows characters to be received while waiting for the USB to be serviced by the Host. MChips could cause an overrun at high BAUD.
Transmission uses the full 4 char buffer and allows the USB to be serviced while transmission continues.
It also notifies errors via the Interrupt endpoint. Rx errors are shown on the Yellow LED which is lit for half a second.
Transmission is shown on Green LED. Both LEDs are lit on power up but this does not mean successful USB enumeration.

I do use the MChip driver that is shipped with the MAL and the USB IDs use MChips serial numbers to ensure there are no problems getting the two to work together.
I would be interested to hear if anybody gets this working with Microsoft's standard serial driver.

Hope you find this useful. :)

Regards
T Yorky

<Edit> Thanks to Ric for the Forum. It would have taken hours (and a lot of swearing) to use MChip forum.
Tight Yorky
 
Posts: 22
Joined: Thu Jun 19, 2014 10:32 pm
PIC experience: Professional 2-5 years with MCHP products


Return to USB

Who is online

Users browsing this forum: No registered users and 2 guests

cron