Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:22 29 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PIC16f1455 USB to Serial

     Page 2 of 3    
Author Message
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 10:19am 26 Aug 2015
Copy link to clipboard 
Print this post

  matherp said   On an F part if you connect Vusb to 3V3 then the chip gets very hot and stops working


It is a pity they didn't put an internal blocking diode on that pin to prevent that. I have found that it works fine with that pin floating but the datasheet specifically says a Ceramic Cap, I guess that is to prevent the internal regulator oscillating.

Cheers
Chris

http://caroper.blogspot.com/
 
SiNut
Newbie

Joined: 12/03/2015
Location: United States
Posts: 12
Posted: 06:31pm 26 Aug 2015
Copy link to clipboard 
Print this post

  Chris Roper said   There are so many VHDL or Verilog Netlists of the 8051 floating around both IP and Public that they probably used one of those.



Microchip acquired Silicon Storage Technology in 2010 and gained this technology and design expertise. SST was a very competitive supplier of 8051 based micro-controllers.

When NXP, formerly Philips Semiconductor, dropped their 8051 line of controllers Microchip stepped up to support those customers with pin-compatible devices. There are more details here:

http://www.microchip.com/pagehandler/en-us/family/8051legacy/


Cheers,
Singh

 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:54am 27 Aug 2015
Copy link to clipboard 
Print this post

This MCP2221 Datasheet has a topic about how to connect the chip in case of 5v VDD or 3.3v VDD.
On pages 16,17,18 it is described in detail and also has images to clarify.
It seems that the right way to do it is to have the bridges as i have in my schematic.
Am i reading this datasheet right?

Microblocks. Build with logic.
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 04:51am 27 Aug 2015
Copy link to clipboard 
Print this post

Phom kho thot TZ, in the absence of you showing a 3V3 power supply I mis-read your circuit labels, where you have jumpers I though you had power connections. Now I understand where you are coming from and I completely withdraw my remarks as directed to your circuit (on the proviso that VDD is 3V3 (not shown.)

On my boards I have Vusb wired up to the 3V3 supply and, not withstanding other remarks here, it works and as best I can tell it is correct.

Sorry about that. Edited by JTR0701 2015-08-28
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 04:59am 27 Aug 2015
Copy link to clipboard 
Print this post

But how do we know that the MCP2221 and the 16F1455 are identical Silicon?
Are you using the 16f part or the MCP part?

It worked perfectly for me driven by an external 3V3 regulator with Cap between Vbus and ground.

Additionally matherp says above that he destroyed a device by feeding Vusb.

I would say prototype it both ways and see what happens, but I am happy with mine as shown in the first Schematic I posted.

Cheers
Chris

EDIT:
JTR0701 posted simultaneously with the opposite answer, so I guess both ways work.
Only time will tell about reliability.
Edited by Chris Roper 2015-08-28
http://caroper.blogspot.com/
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 05:11am 27 Aug 2015
Copy link to clipboard 
Print this post

The same circuit is given for both the 16F145x and the MCP2221. I think it's quiet a reasonable assumption. I don't have a MCP2221 that I could read the DevID from but that would be one way of getting near 100% certainty...
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 06:02am 27 Aug 2015
Copy link to clipboard 
Print this post

Chris, Yes i use the F part with the internal LDO.

As i understand it there are two ways of connecting depending on the voltage on the VDD. The voltage on the VDD will also determine the voltage levels on the output pins.
For me it is important that it will work with a 5V and a 3v3 supply.

With 5v:
Connect 5v to VDD
connect vusb3v3 to GND with a Cap.

With 3v3:
Connect 3v3 to VDD
Connect vusb3v3 to VDD

I think i can only accomplish that with two solder bridges. One that connects vusb3v3 to VDD in case of a 3v3 supply.
And the other one that connects the vusb3v3 to gnd with a cap when 5v is on VDD.

Problem is that if someone closes both solder bridges there will be 5v on the vusb3v3 and that will probably kill the chip. I would like to prevent that situation if possible.

So my thought was to just connect the vusb3v3 to gnd with a cap.
And then apply 3v3 or 5v to VDD to choose which output levels i need.
But that seems not possible, or at least not recommended.

I looked at the MCP2221 because that should be the same chip. In that datasheet it is shown more clearly.


Edited by TZAdvantage 2015-08-28
Microblocks. Build with logic.
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 07:52am 27 Aug 2015
Copy link to clipboard 
Print this post

  TZAdvantage said  

I think i can only accomplish that with two solder bridges. One that connects vusb3v3 to VDD in case of a 3v3 supply.
And the other one that connects the vusb3v3 to gnd with a cap when 5v is on VDD.



The cap doesn't matter if you have Usb3V3 connected to 3V3 supply. Don't see why you need two jumpers. Just leave the cap hardwired. It will just act as an extra bypass cap and probably does some good. That is how I have done it and so far it is working without issue.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:00am 27 Aug 2015
Copy link to clipboard 
Print this post

Yes, that would be best.
I not received my chips yet, so i can no test it. If all goes well they arrive tomorrow.
When ordering from the Microchip factory (in Thailand) the packages always go on a trip to China then Singapore, China again and then back to Thailand.
For import/export reasons, but it is such a waste of time and resources.
Oh well, a few days more is not that bad.....

edit:
Thinking about it a bit more. The internal LDO would not function properly if it hasonly 3.3v at its input. It is a low drop, zo its output can never reach 3v3 that is required for operating the USB transceivers.
In the datasheet (page 353, 29.7) it is written that the minimum voltage for the internal LDO is 3.6v. Note 3 tells that vusb3v3 must be connected to the VDD when using 3v3 on VDD. It then bypasses the internal LDO and uses the 3v3 directly for the transceivers.

Datasheets, difficult to find the right info but at least know a lot more now. :)

My best bet now is that there is at least one jumper necessary and that is to connect the usb3v3 directly to VDD when using 3.3v. The connection with a cap to GND can be fixed.

Edited by TZAdvantage 2015-08-28
Microblocks. Build with logic.
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 08:55am 27 Aug 2015
Copy link to clipboard 
Print this post

  TZAdvantage said   Chris, Yes i use the F part with the internal LDO.
.....
So my thought was to just connect the vusb3v3 to gnd with a cap.
And then apply 3v3 or 5v to VDD to choose which output levels i need.
But that seems not possible, or at least not recommended.


Well that is the way I am doing it and the part has been running fine and communicating for well over a week like that. No heating, No USB drops and no communications errors.

I may well be wrong, I am not an electronics engineer, but that is how I read it and connected it up and it is working for me.

I interpreted the datasheet as saying only to tie Vusb to 3V3 on an LF part, and an F part it will internally bypass the regulator if fed 3V3 as Vdd.

That is why I say to try it both ways then decide.

Cheers
Chris

http://caroper.blogspot.com/
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:08am 27 Aug 2015
Copy link to clipboard 
Print this post

Oops i edited my message while you posted. I found some more info in the datasheet.

Microblocks. Build with logic.
 
SiNut
Newbie

Joined: 12/03/2015
Location: United States
Posts: 12
Posted: 05:35pm 27 Aug 2015
Copy link to clipboard 
Print this post

  JTR0701 said   The same circuit is given for both the 16F145x and the MCP2221. I think it's quiet a reasonable assumption. I don't have a MCP2221 that I could read the DevID from but that would be one way of getting near 100% certainty...


The Device ID of the MCP2221 reads 3021 - the same as that for the 16F1455.

-- Singh
 
JTR0701
Regular Member

Joined: 10/07/2013
Location: Australia
Posts: 71
Posted: 07:57pm 27 Aug 2015
Copy link to clipboard 
Print this post

Thanks for that. No real surprises there.
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 08:36pm 27 Aug 2015
Copy link to clipboard 
Print this post

  SiNut said  

The Device ID of the MCP2221 reads 3021 - the same as that for the 16F1455.

-- Singh


Thanks, Good to know as the MCP2221 datasheet has info not in the 16F1455 datasheet.

Cheers
Chris

http://caroper.blogspot.com/
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 01:04am 03 Sep 2015
Copy link to clipboard 
Print this post

I am close to get this little module made.
I have bread boarded it with a DIP version of the chip to confirm it works.
The software is the one Chris Roper linked to on the first page of this topic.

This pcb is 18x18mm. I think the smallest USB-Serial with 5v/3v3 ever. :)

It uses the PIC16F1455. All of it pins are available so it can also be used
as a breakout board for other projects.
The special thing is that it this design has some real power output.
With 500ma available this can drive more then only an tiny mcu.
No more external power needed!
Compared with others that have only 50-60ma this makes all the difference.

This is the pcb (3D rendering):

Here the schematics:


Comments welcome!
Edited by TZAdvantage 2015-09-04
Microblocks. Build with logic.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:44pm 06 Sep 2015
Copy link to clipboard 
Print this post

Had success testing the PIC16F1455 as a USB to Serial module.
It went smooth.
Downloaded the code Chris referred to, compiled it and burned it into the PIC.
Worked first time.
Here it is connected to a MUP that is used to test my code for the keyboard that Grogster is working on. I breadboard a 'row' of keys to decode it row by row.


Top left with the USB cable connected is a USB mini breakout, that goes into the breadboarded USB-Serial. Black and red is 5v from the USB. Yellow and Blue are D+ and D-.
On the USB-Serialbreadboard there is just a power led direcdtly on VDD, small 3.3v power supply on the right bottom. Four wires go to the MUP. Brown = GND, Red = 3.3v, Yellow = TX and Orange = RX.
The MUP is used as a Matrix decoder, here it does one row.I just change the wires to test the next row.

I am running this on a Windows 10 Surface Pro 3. The driver is from Microchip. It loaded so quick that i first thought it did not work. Checking the devices it was already loaded. Could not be easier.

I am now going to use it as my main USB-Serial to see how it holds up.

Edited by TZAdvantage 2015-09-08
Microblocks. Build with logic.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:19pm 09 Sep 2015
Copy link to clipboard 
Print this post

I am happy to say that leaving everything working until now (about 2 full days) everything still works good.
Loaded the uMite with a program that just counts and print the result while teraterm stayed connected.
Not a single bit went missing. I would say the code in the PIC16F1455 is stable.


Microblocks. Build with logic.
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 09:34pm 09 Sep 2015
Copy link to clipboard 
Print this post

Have you had a chance to try the DTR, CTS and RTS signals?
I was planing on testing them against the Arduino Bootloader but my stock of ATMegas appear to have all died, they don't even work in a genuine arduino board

They appear to be a lot less robust than Micrichip Devices and may have been killed by static.
http://caroper.blogspot.com/
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:41pm 09 Sep 2015
Copy link to clipboard 
Print this post

I tested it with MMEdit. It has a menu choice to puls the DTR (output) and that worked. Used it to reset the uMite.

I did not test CTS (input) and RTS (output) yet.
How would that work with an Arduino as those signals are more for flow control of data.
Or is RTS also used for reset purposes.



Microblocks. Build with logic.
 
Chris Roper
Senior Member

Joined: 19/05/2015
Location: South Africa
Posts: 280
Posted: 11:23pm 09 Sep 2015
Copy link to clipboard 
Print this post

I think arduino only uses DTR for reset, So I am not sure how I would test RTS and CTS.

I could try with two 1455's between the PC and the Laptop with Hardware handshaking on.

Time for me to get it off the Breadboard and onto a PCB I guess Edited by Chris Roper 2015-09-11
http://caroper.blogspot.com/
 
     Page 2 of 3    
Print this page
© JAQ Software 2024