USB to serial converter buffer overflow with windows 7 power saving

Status
Not open for further replies.
May 11, 2008
19,577
1,195
126
I hope someone has a solution for this.

I am programming a small microcontroller and it transfers debug output over the serial port to a prolific usb to serial converter. For the last few hours i noticed that i have missing characters or just whole sentences missing. After debugging my mcu code and being sure it is not in the code, well...

After some thinking and trying out, i traced the problem to windows 7 clocking down the cpu and other hardware as a means of power saving. Whenever i start my VLC player with a song or a movie, the problem disappears. As soon as i close down vlc player, w7 starts power saving with maximum effort and the missing characters/ serial buffer overflows start to happen again.

Does anybody know how to solve this without keeping vlc player running all the time ? It is a power saving issue with windows 7 in combination with my AMD hardware.
I do not even have to play a song or a movie, just have VLC running to solve the problem.
 
Last edited:

serpretetsky

Senior member
Jan 7, 2012
642
26
101
Serial as in rs232? I have only programmed basic UART blocks on PSOC5 boards, so I dont know if what Im giong to suggest is applicable. Does rs232 offer some sort of flow control to let the transmitter know that the receiver is not ready to receive data? This would allow your machine to tell the board (when it downclocks) to stop sending data if its about to overflow the buffer.

something like:
http://us.brainboxes.com/faq/items/what-is-rts--cts-hardware-flow-control-

Again, i haven't really used rs232, so I don't really know the details, good luck.
 
May 11, 2008
19,577
1,195
126
It is a uart rs 232. I do not have hardware flow control. It is just RXD and TXD and GND for simplicity. I got it to function by keeping vlc player present. Even while vlc player is not playing back music or video, i assume it prevents my pc from going into power saving mode. Must have something to do with cool and quiet i think. To prevent jitter in playback, vlc probably keep the cpu running and not halted or something like that. Other programs do not seem to keep my system awake.
I checked with cpu-z my cpu clock speed but it remains at 1800MHz. Must be some power saving issue inside windows 7-64 together with the drivers from prolific. The prolific usb to serial converter uses drivers from prolific. Perhaps those drivers have some issues when the whole system is in some power saving mode. Alas, i will just start vlc player to solve the issue.
 

sm625

Diamond Member
May 6, 2011
8,172
137
106
Usually two adjacent usb ports share the same root hub. Try placing your prolific usb to rs232 converter on the same hub as your mouse. If that fixes the problem then look in the power management options for your usb controllers. Actually... you might want to look in there anyway.

Also, try setting every possible power option (Power Options -> Advanced settings) to maximum performance. And disable usb selective suspend. That's in power options.
 
May 11, 2008
19,577
1,195
126
Usually two adjacent usb ports share the same root hub. Try placing your prolific usb to rs232 converter on the same hub as your mouse. If that fixes the problem then look in the power management options for your usb controllers. Actually... you might want to look in there anyway.

Also, try setting every possible power option (Power Options -> Advanced settings) to maximum performance. And disable usb selective suspend. That's in power options.

Now that you mention it, i have my prolific usb to serial converter on a separate usb root hub. It (or the driver) crashed when doing my cdc experiments while being on the same root hub. Usb port power management... :hmm: I will have a look at that. thank you.
 
May 11, 2008
19,577
1,195
126
Well, as it turns out my prolific usb to serial was already on the same (internal) usb hub as my usb hid mouse. Turning of power management results in the prolific converter not receiving or transmitting uart data anymore. As soon as i enable power management it functions. When i try the same experiment on another (internal) usb hub, where the prolific adapter is the only usb device, there is no problem. I am going to try it with an FTDI based cable and see if it is a driver issue. For now keeping VLC running solves the problem, so i do not have to turn off all power saving features of my system.
 
May 11, 2008
19,577
1,195
126
Tested it with an FTDI chipset based (and ftdi drivers) cable and no problems. No missing characters. It seems the prolific usb to serial (PL2303) driver for windows 7 needs some work. To solve the issue with the PL2303, i just have to run VLC. I suspect this has some thing to do with the powersaving features of W7-64 in combination with my AMD system in combination with not so good drivers from prolific. I am going to buy an FTDI based usb to serial cable to prevent these issues.
 

balsa model

Junior Member
Aug 24, 2012
9
0
66
Me too I had unexplained experiences with Prolific USB-to-serial dongles. I tried 2 types: single and a dual variety. IIRC, besides large file uploads being unreliable, they also didn't handle disconnects / reconnects gracefully, loosing their COM port # in the process. Especially painful when you have to juggle several COM dongles.
I stumbled onto FTDI by chance and never looked back. Their drivers even have extra tweaking options when you want to max out the throughput. I end up running mine at 460,800 baud most of the time. Solid. They can go 1 Mbaud but my serial h/w risetimes don't keep up.
Typically a bit more pricey but you get it back by saving on frustrations.
Anyhow, my two cents.
bm (I wish I saw your post earlier; I don't come here that often)
 
May 11, 2008
19,577
1,195
126
Most of the time, i have TTL level uart signals because i am playing with microcontrollers. Now i use a separate RS232 level converter IC such as for example the st232 (5V) or the st3232 to convert to RS232 level signals.

But with this cable(see below) and a handful of electronic components(2 series resistors and a 3V3 zenerdiode), i can use TTL level signals of 3V3 and 5V. The cable costs as much as the prolific converter but it has no RS232 level converter and is a FTDI chipset based cable.

The :
FTDI - TTL-232R-5V-WE - CABLE, USB-TTL SER CONV 5V, WIRE END
At Farnell for about 16 euro.
http://uk.farnell.com/ftdi/ttl-232r-5v-we/cable-usb-ttl-ser-conv-5v-wire/dp/1740364?Ntt=1740364
I have to order this one next week.
 

balsa model

Junior Member
Aug 24, 2012
9
0
66
Often, I find myself quite dependent on the ability to print gobbles-n-gobbles of debug info. I call it "system debug bandwidth". And it hinges on RS232 bandwidth. Hence, I use either USB-to-DB9 dongles that I attach directly to my equipment, or same but with an included USB cable extension.
When you run any length of RS232 cabling, your maximum data rate will suffer.
Extending the link at its USB side had practically no adverse effect.
Like this 5m connection:
http://uk.futureelectronics.com/en/...485-cables/Pages/1003699-UT232R-500.aspx?IM=0
 
Status
Not open for further replies.