USB Serial Driver?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

USB Serial Driver?

Post by Dave Squibb »

Hello,
I have compiled the example USB_Serial example program after clicking on Generate Driver. The Driver file is saved to a folder. After programming the PIC18F2550 I connect the USB to the PC and I get the message "One of the USB devices connected to the computer has malfunctioned and windows does not recognise it. In device Manager it says Windows has stopped this device because it has reported problems. (Code 43). Googling Code 43 points to driver problems.
I am not asked to install a driver when I plug the device in. How should I do this? (Windows 7 pro 64 bit)
Thanks,
Dave.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: USB Serial Driver?

Post by Benj »

Hi Dave,

It is likely that the problem your having is because the hardware is mis-configured and running at an incorrect speed.

Can you post your program so we can look at your config settings and also can you let us know what crystal frequency your using.

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: USB Serial Driver?

Post by Dave Squibb »

Hi Benj,
Crystal is 4MHz
USB_Serial.fcfx
(7.3 KiB) Downloaded 217 times
Thanks,

Dave.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: USB Serial Driver?

Post by Benj »

Hi Dave,

Thanks that's great.

Please can you try compiling this to the chip and hopefully the USB should then start working correctly.
USB_Serial-2.fcfx
(7.3 KiB) Downloaded 242 times

Dave Squibb
Flowcode v5 User
Posts: 104
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: USB Serial Driver?

Post by Dave Squibb »

Well that works Benj. Why is the clock set to 48MHZ and not 4?
Apart from that is it just the Config that was wrong?
Thanks, Dave.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: USB Serial Driver?

Post by Benj »

Hi Dave,

Yep just config and clock speed settings.

Full speed USB runs at 12M bits per second, a PIC has a speed of 1 instruction cycle per 4 clock cycles so to get USB to work the device needs to be running at 48MHz.

The onboard PLL (phase locked loop) built into the oscillator circuit takes your 4MHz input and multiplies up to 48MHz for you to allow the USB to function.

Post Reply