News:

;) This forum is the property of Proton software developers

Main Menu

PIC18F's USB module current consumption?

Started by trastikata, Dec 02, 2023, 07:22 PM

Previous topic - Next topic

trastikata

Hello all,

I could not find any information about how much current does the USB module in a PIC18F MCU consume?

The reason for my question is an interesting observation. I have a board with a temperature sensor 5mm away from PIC18F14K50. The board has memory and some data recording occurs, including board temperature. Here's what I observed when the PIC is working at 48MHz:

- with USB module turned off - I measure (log into memory) about 0.2 degrees difference from environmental temperature
- with the USB connected and transferring data the board temperature raises to 10 degrees above environment

So my guess is the USB module draws quite a lot of current. Normally I'd measure the current with an ammeter but the board has integrated USB power supply which is OR-ed with the battery when the USB is connected (which is far away from the temperature sensor) and I can't cut it to measure the current.

I will try digging out old battery only powered boards with USB connection but I've decided to ask if someone might have that info. Thanks



david

Hi,
Like yourself I couldn't spot anything in the specifications but they give a calculation for estimating the USB transceiver current. (~5mA)
This doesn't seem to relate to your measured performance where with the micro running at 48MHz it could be drawing 11-15mA yet only produces a 0.2C rise but with the USB running (additional 5mA?) it climbs to 10C above ambient.
When you talk about the change relative to ambient I assume you mean initial short term measurement vs a longer term, steady state measurement, all using the on-board sensor.
Even the micro alone if drawing worst case 15mA at 5V produces 75mW of heat and I'm surprised a sensor only 5mm away barely responds to this but it will depend on the amount of copper between the micro and the sensor.
The hike you're seeing would seem to imply large amounts of capacitance on fast clocking signals.

Best regards,
David


david

Are the memory writes more frantic when the USB is running?  Can you inhibit memory writes and leave the USB running?  Just trying to isolate the high current demand.

David

Stephen Moss

A 10 degree rise sounds like a lot, surely the PIC would also be getting rather warm to transfer that much heat into the surrounding area.
Do you have an external thermometer to confirm that heat rise as if the temperature sensor is close to the USB maybe noise from the USB data transfers are affecting the sensor somehow causing it to read incorrectly.

If you cannot find any direct data on the current consumption could you infer it? i.e. work out the power required to heat the air/PCB substrate (as applicable) by 10 degrees, convert to Watts, then divide by the supply voltage. 

trastikata

#4
Thank you for your comments. I made some measurements and it really seems that the USB module draws significant current when there's a USB transfer.

The PCB is tiny 10x10x1.2mm as shown in the picture and the heat dissipation depends quite a lot on the board position. With the MCU upwards, and the USB running, the temperature rise is about 3.5 degrees, with the MCU face down the rise is about 10 degrees.

Just for comparison I show measurements with the MCU at 48MHz facing upwards for about 20 minutes (1200 seconds):
 1 - USB module disabled completely - no change, except some spikes when there's draft from movement     
 2 - USB module enabled, no active USB connection 1.2 degree increase
 3 - USB module enabled, active USB connection - 3 degrees increase

So I guess there's really nothing else that I can do besides to disable the USB and wait for the temperature to stabilize when I take active measurements.

david

Do you think most of the heat transfer is conducted or radiated?  If conducted, you may get a modest improvement by maximising the thermal resistance between micro and temp sensor and minimising it between sensor and ambient.  Not too many options on a board that size but you may be able to reduce the copper connecting the two.  A tiny, routed slot could do wonders or even attach a small mass to the temp sensor

Too bad the micro doesn't appear to have an internal temp sensor - you might have been able to apply a fudge factor offset to your external  temp sensor.

David

John Lawton

Do you have a board schematic, showing how your board is powered, via a voltage source or via the USB or both?

Could these two sources be competing or conflicting due to slight voltage inbalances, this might cause some power loss in some components.

Just a possibility.

JonW

#7
It doesn't surprise me that you see a 10C rise on such a small PCB.  As you have noted, the only way to get an accurate measurement is by disabling as many power sources as possible. Can you drop VDD at all?  Another possibility would be to create as much thermal mass in the MCU portion of the PCB by increasing layers or plating thickness and then try to thermally isolate the temp sensors' connection to the rest of the PCB with little or no ground planes and slots or un-plated vias as a thermal barrier.  Depending on the sampling rate or response time of the sensor you could also try adding heatsinking to the MCU and a separate one to the sensor so one lags the other etc
A better solution would be to use a flex PCB or add another board and form a stack

Edit, See David has said similar. 

trastikata

Thank you all for the suggestions. Unfortunately the boards are already made and it is a panel of 100 such small boards. There's a second, remote board with battery and voltage regulator that makes sure the small boards with the sensors receive 3v.The small holes at every corner serve for power distribution when soldered with jumpers.

Anyway, there's nothing more to do with those PCBs I already have but to disable for a while all unnecessary peripherals before measuring temperature.

I was simply surprised by the amount of heat generated by the USB module in PIC18F which seems to be several times more than the MCU itself. 

tumbleweed

I haven't used a 14K50 in a long time, but something just doesn't sound right.
Looking at the pkg thermal data it looks like you'd have to be pulling something like 60-90mA out of the USB regulator to get that kind of rise.

Are you sure you've got it connected correctly? How is VUSB connected?

tumbleweed

For comparison, the MCP2200 USB to UART converter (which is just a pre-programmed 18F14K50) lists the max supply current as 15mA @ 5V, and I don't see how you'd get a 10deg rise out of that... maybe 2-3 degC.






trastikata

Hello tumbleweed,

To Vusb has connected 1uF cap to ground. I checked the datasheet after my OP, there's a formula to calculate the USB current and it seems that it can really draw up to 60mA, however for HID communication as in my case calculations show about 8mA.

I think david is onto something here, the formula show current dependency on cable length but in reality it is the capacitance which is important. My desktop case has USB front panel which I am using and I think this might add significant capacitance.

The high board temperature raise, I suppose, is mostly because of the small PCB dimensions.