18f4550 clock settings to get usb running?

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

Moderator: Benj

Post Reply
EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

18f4550 clock settings to get usb running?

Post by EtsDriver »

When i try to develop anything on the 18f4550 it seems that almost all times my computer feels that the "usb device connected did not report correct header"...
Im using the 19.999MHZ clock, tried 4MHZ and 8MHz, 12Mhz and 16Mhz... No luck here.

When im looking at the clock settings of datasheet and then the flowcode, i feel like im kid in candyshop, i cannot decide settings that SHOULD work. And when im done, the "send config now" button is gray all times not depending on the "download config on program load" thing..

Could anyone explain those settings or even make some kind FC6 wiki article on it? Simple explained flowcode files are too welcome!

The USB macro wiki is almost all times depending on ECIO or something other "ready to run" , not real MCU:s have been used to explain anything.

Been trying to play with CAN bus and USB together, but seems like this is never gonna work at the moment.
Ill just keep the good work up!

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: 18f4550 clock settings to get usb running?

Post by Benj »

Hello,
the "send config now" button is gray all times
This button is for AVR devices only. With PIC and 16-bit PIC the config is added to the C code and compiled into the hex file that is sent to the device during the compile to chip process.

These would be the settings for a 20MHz crystal though I'm told a 19.6608MHz crystal should also work with these settings.
ss1.jpg
ss1.jpg (45.45 KiB) Viewed 4966 times
ss2.jpg
(294.33 KiB) Downloaded 1028 times
Should you want to try a different crystal value then simply change the "OSC Select" configuration setting to match your crystal speed. All other settings should remain the same.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: 18f4550 clock settings to get usb running?

Post by EtsDriver »

Could you take a look? Using now 18F4550 and 19.66MHz clock.

Windows reports following to me:
Device was stopped because it reported error. (Code 43)
"A request for the USB device descriptor failed."
Device configured - error wrote: Device USB\VID_0000&PID_0002\5&2b3e9b3c&0&10 was configured.

Driver Name: usb.inf
Class Guid: {36FC9E60-C465-11CF-8056-444553540000}
Driver Date: 06/21/2006
Driver Version: 6.3.9600.17238
Driver Provider: Microsoft
Driver Section: BADDEVICE.Dev.NT
Driver Rank: 0xFF0000
Matching Device Id: USB\DEVICE_DESCRIPTOR_FAILURE
Outranked Drivers: usb.inf:USB\DEVICE_DESCRIPTOR_FAILURE:00FF2000
Device Updated: false
Device failed to start wrote:Device USB\VID_0000&PID_0002\5&2b3e9b3c&0&10 had a problem starting.

Driver Name: usb.inf
Class Guid: {36FC9E60-C465-11CF-8056-444553540000}
Service:
Lower Filters:
Upper Filters:
Problem: 0x2B
Status: 0x0
Attachments
18f4550 - usbtoserial.fcfx
Tried changing VID to "OPEN" in numbers to see if the VID is reported right... No luck there.
(4.81 KiB) Downloaded 281 times
Ill just keep the good work up!

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: 18f4550 clock settings to get usb running?

Post by Benj »

Hello,

In your config settings the "CPU Sys CLK Select" option is setup incorrectly. This should be set to "OSC/1 or PLL/2".

Hopefully this should solve the issue :D

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: 18f4550 clock settings to get usb running?

Post by EtsDriver »

Finally got it to work!

The problem was the Low voltage programming mode, when i disabled it, this thing is now running! :D

Now i can sell my arduinos and wait for the V7 of flowcode and new flowcode usb components ;)
Ill just keep the good work up!

Post Reply