CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18F4550 USB driver code
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
seven



Joined: 26 May 2005
Posts: 10

View user's profile Send private message

PostPosted: Thu May 26, 2005 1:53 pm     Reply with quote

please, can you tell me why i have to use a 24MHz crystal.
If i want to use a 20 MHZ crystal i have just to configure config1l the way i get 5 on the pll divider no?
seven



Joined: 26 May 2005
Posts: 10

View user's profile Send private message

PostPosted: Thu May 26, 2005 2:16 pm     Reply with quote

so i just have to configure the register and all will work fine Smile

can u tell me how i can use the code u've posted please. Do i have to copy it in the .h file created?
How can i create a new pic with ur code?
seven



Joined: 26 May 2005
Posts: 10

View user's profile Send private message

PostPosted: Fri May 27, 2005 6:53 am     Reply with quote

i've just realised i can't program my pic 18F4550 !!!

i used to use an icd for programming my pic, but with with icd i can't programm this pic. An error has occured telling me that i have to update my firmware so that he can support PIC18. I did it (using MPLAB for PIC 18), but when i test my icd he doesn't to say : "test icd passed", and i have the following error : " ...xxxblablaxxx ...: check icd power"

Please can you tell me how you programm your pic and if you use ICD how can i get mine working.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri May 27, 2005 9:03 am     Reply with quote

seven wrote:
i've just realised i can't program my pic 18F4550 !!!

i used to use an icd for programming my pic, but with with icd i can't programm this pic. An error has occured telling me that i have to update my firmware so that he can support PIC18. I did it (using MPLAB for PIC 18), but when i test my icd he doesn't to say : "test icd passed", and i have the following error : " ...xxxblablaxxx ...: check icd power"

Please can you tell me how you programm your pic and if you use ICD how can i get mine working.


Wrong forum to ask that question. There is a forum just for those kinds of questions.
seven



Joined: 26 May 2005
Posts: 10

View user's profile Send private message

PostPosted: Fri May 27, 2005 9:22 am     Reply with quote

Mark wrote:
seven wrote:
i've just realised i can't program my pic 18F4550 !!!

i used to use an icd for programming my pic, but with with icd i can't programm this pic. An error has occured telling me that i have to update my firmware so that he can support PIC18. I did it (using MPLAB for PIC 18), but when i test my icd he doesn't to say : "test icd passed", and i have the following error : " ...xxxblablaxxx ...: check icd power"

Please can you tell me how you programm your pic and if you use ICD how can i get mine working.


Wrong forum to ask that question. There is a forum just for those kinds of questions.

i know and i have posted there Smile, but i saw that david knew lots of thing so i decided to post there because i know he will probably answer my question.

sorry to post wherever
Tre



Joined: 03 Jun 2005
Posts: 21

View user's profile Send private message

PostPosted: Fri Jun 03, 2005 9:56 pm     Reply with quote

I tried this code today but I was unable to get it working properly. I am using a 4MHz crystal. I have the the oscillator set at HS-PLL, NO 96MHz prescalar, and the CPU Post Scalar at /3 and /4. I see the pulse on the USB input when I plug the cable in and I get an interrupt, but it never connects. I have tried the internal voltage regulator (with 220nF cap to ground) and disabling the regulator and putting a 3.3v supply on the pin. So far no luck though, does anyone have any suggestions?

Thanks,
Drew
Tre



Joined: 03 Jun 2005
Posts: 21

View user's profile Send private message

PostPosted: Sun Jun 05, 2005 10:27 pm     Reply with quote

Finally, I got the code working after many many hours of frustration. The problem was actually quite simple but just something I had never considered. I was trying to test this on a PICDEM 2 PLUS board. Well, RC3 and RC4 are typically used for I2C communications. There are two pullup resistors R8 and R9 on the board that pull these lines to 5V since I2C is open collector. These two resistors cause all kinds of havoc on USB communication. Therefore, in order to get this code running on the PICDEM 2 Plus board, you need to do the following:

1) Desolder R8 and R9.
2) Connect a 220nF capacitor between RC3 and Ground
3) Connect D+ and D- to RC4 and RC5
4) Connect the USB ground to the ground plane
5) Do not try and power the PICDEM 2 board from USB, it draws too much current. It has too much capacitance (in-rush current) and all of the LED's/peripherials. So just leave the power unconnected. Power it with the 9V or aux adapter.
snavarro



Joined: 06 Jun 2005
Posts: 3

View user's profile Send private message

PostPosted: Mon Jun 06, 2005 12:16 pm     Reply with quote

Hi

Could someone tell me the settings for 20MHz cristal.

thanks
Tre



Joined: 03 Jun 2005
Posts: 21

View user's profile Send private message

PostPosted: Mon Jun 06, 2005 7:33 pm     Reply with quote

The Full Speed USB Clock Source: 96Mhz PLL/2
CPU System Clock Postscalar: Set this to whatever you want, its your micro speed
96Mhz PLL Prescalar: Divide by 5 (20 Mhz)
Oscillator: Either HS or HS-PLL depending on what you want for your micro speed

Enable these
=========
Powerup Timer, Fail-Safe Clock Monitor, USB Voltage Regulator, Brown Out Detect, Stack Overflow

Disable these
=========
Watchdog timer, Internal External Switch Over Mode, Code Protect
snavarro



Joined: 06 Jun 2005
Posts: 3

View user's profile Send private message

PostPosted: Sat Jun 11, 2005 12:33 pm     Reply with quote

Hi Tre

Thanks for your info. My 18F4550 is working with this code.

I tried to compile the files:

ex_usb_scope.c and ex_usb_hid.c and I have to insert the line:

#define USB_MAX_PACKET_LENGTH 64

in the pic_usb18.c file for the correct compilation.

I'm not sure of the 64 value. Is the same that the value used in the usbn960.c file.

I have added comments in the lines with the function usbn_get_version() too.

I was searching for more info, and I found this link:

http://www.sixca.com

In this site there are code that , I think, can be used for try the code of the files ex_usb_scope.c and ex_usb_hid.c.

Regards
andrew1956



Joined: 25 Jul 2005
Posts: 4

View user's profile Send private message

PostPosted: Thu Aug 18, 2005 6:14 am     Reply with quote

Hi

Thanks for code

How modify by 18f2550 ?

Thanks
kathiresan



Joined: 07 Oct 2005
Posts: 2

View user's profile Send private message

184550 configuration
PostPosted: Tue Oct 25, 2005 8:54 pm     Reply with quote

sir

how to incoporate the change " 96Mhz PLL Prescalar: Divide by 5 (20 Mhz) "? which file i have to incooperate and how?For bus powered how to incooperate changes in the software? pl help me
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group