USB conection to PIC18F4550

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
st9905
Flowcode V4 User
Posts: 16
Joined: Tue Oct 24, 2006 5:41 pm
Contact:

USB conection to PIC18F4550

Post by st9905 »

Hello,

I planing to use a PIC18F4550 in a project were I can connect my PC to the PIC via the USB to download new programs as well as receive data.
My PC recognize that a new USB device is attached, but doesn't find any driver for communication.
Is it possible to modify the USB driver for the ECIO to work with the PIC18F4550?


Regards
Erik
Erik

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 conection to PIC18F4550

Post by Benj »

Hello Erik

What are you developing your USB program in? The driver you require will be specific to the type of device you are trying to create. Is there an example driver that you can use?

st9905
Flowcode V4 User
Posts: 16
Joined: Tue Oct 24, 2006 5:41 pm
Contact:

Re: USB conection to PIC18F4550

Post by st9905 »

Hello Ben,

I am using Flowcode 4 to make my program with.
Just to try the communication I have used Joystick example program and changed the ECIO to my PIC.
I were able to download the program with the PIC programmer (EB006), but I don't know if the USB function is running as it should since I don't get any communication.

Brgds

Erik
Erik

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 conection to PIC18F4550

Post by Benj »

Hello Erik

Please post V4 questions into the V4 forum topic.

Have you changed the onboard crystal for a compatible value and have you set the configuration data correctly to correspond to your crystal.

http://www.matrixmultimedia.com/mmforum ... =26&t=6167

I have moved this topic to the V4 forum, Please use the Help -> Online resources link in Flowcode to gain access to the v4 forum topic.

If you like you can attach your program and I will have a look to see if there is anything out of place.

st9905
Flowcode V4 User
Posts: 16
Joined: Tue Oct 24, 2006 5:41 pm
Contact:

Re: USB conection to PIC18F4550

Post by st9905 »

Hello Ben,

I have tried with the example file called "USB Slave Demo 3-Byte" and change the PIC to PIC18F4550. I did also the configuration as in the link you sent.
The computer now find and install the USB driver, but still I can not download or modify any program via the USB port. The only way is via the EB-006.

I have sent the example file that I have used. The crystal is 4MHz.
http://cid-915418450c964fe9.skydrive.li ... 3-Byte.fcf

Brgdrs
/Erik
Erik

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: USB conection to PIC18F4550

Post by kersing »

st9905 wrote:I have tried with the example file called "USB Slave Demo 3-Byte" and change the PIC to PIC18F4550. I did also the configuration as in the link you sent.
The computer now find and install the USB driver, but still I can not download or modify any program via the USB port. The only way is via the EB-006.
Erik,

The example code does not contain a boot loader. If you want to be able to update programs in the 18F4550 you need to load a boot loader into the 18F4550. The ECIO contains a boot loader for this purpose. However, that boot loader is part of the ECIO offering and not available separately.

I am currently looking into creating a generic USB boot loader.

Best regards,

Jac
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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 conection to PIC18F4550

Post by Benj »

Hello

It seems there is a problem with the USB library with v4.0 and v4.1 of Flowcode. Please visit this FAQ page to download the latest up to date version of the USB library.

http://www.matrixmultimedia.com/support ... .php?t=553

st9905
Flowcode V4 User
Posts: 16
Joined: Tue Oct 24, 2006 5:41 pm
Contact:

Re: USB conection to PIC18F4550

Post by st9905 »

Hello,

I have updated the USB library, but still I can not connect.

In the complier option I have change to "boostc.pic18.flowcode.exe", but still no communication.
Do I have to make any other changes in the complier option?

/Erik
Erik

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 conection to PIC18F4550

Post by Benj »

Hello Erik

No you should not need to change any compiler or linker options the 16 gets replaced by 18 automatically when you compile to an 18F device.

One customer was having a similar problem but managed to get his 18F4455 working with the USB by autodetecting the device before assigning the configuration settings. You do this via the Chip -> Configuration window and then switching to the expert settings. They then compiled and programmed and their USB is working correctly.

This should also work for your 18F4550 as it is in the same device family.

Post Reply