Page 1 of 1

IDE CPU Utilization Spike

Posted: 07 July 2011, 7:10 AM
by everest
Hey Don,

I've noticed that under the following conditions, the Zbasic IDE CPU utilization on my PC spikes to 100%:

1) I have a USB serial adapter connected to my laptop
2) The Zbasic IDE is running and the adapter is "Connected"
3) I remove the USB serial adapter from my laptop

At this point, the CPU utilization immediately spikes up to 100%. I can fix the problem by simply closing the COM port, or shutting down the IDE. But sometimes I just forget and wind up killing my battery with all that CPU utilization.

I can't tell if this is an issue with the serial drive, or the IDE specifically, but *if* it's the IDE, it would be great if it could detect and resolve this condition.

-Jeff

Re: IDE CPU Utilization Spike

Posted: 07 July 2011, 7:52 AM
by dkinzer
everest wrote:I can't tell if this is an issue with the serial drive, or the IDE specifically, but *if* it's the IDE, it would be great if it could detect and resolve this condition.
The IDE doesn't know anything about the existence of the USB device. Rather, it interacts with the driver that presents a virtual serial port interface.

I suspect that this is an issue within the FT232 driver and that it could only be resolved there. It would be interesting to conduct the same experiment replacing the IDE with some other application that opens the virtual serial port, e.g. a terminal emulator like TeraTerm, and see if the result is the same.

Posted: 07 July 2011, 8:04 AM
by everest
Yup, I just tested and as you suspected it's a driver issue, not specific to the IDE. Other terminal programs have the same issue. Annoying!

-Jeff

Posted: 07 July 2011, 9:26 AM
by dlh
Which USB serial adapter? It might be worth trying one with a different chipset and thus different driver. FTDI, Silicon Labs and Prolific are the chips commonly used in these adapters. Each has it's own drivers.

Posted: 07 July 2011, 9:48 AM
by everest
It is a very simple FTDI adapter sold by Parallax for around $15. It's consistently been the most solid adapter I've ever used, but in this case has a bit of an annoying habit!

-Jeff

IDE CPU Utilization Spike

Posted: 07 July 2011, 9:58 AM
by GTBecker
You say you're removing the hardware while the application port is
open? How would you have the OS handle that circumstance?


Tom

Posted: 07 July 2011, 11:12 AM
by dlh
everest wrote:It is a very simple FTDI adapter sold by Parallax for around $15.
I've used several of these under Windows/Linux/OSX...which has a Prolific chipset. I've never tested your scenario but it might be worth $10 to see if its driver handles this.

These are even cheaper...The one on the left uses Prolific, the one in the middlet is Silicon Labs.