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 support@ccsinfo.com

PIC18f2450

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eoinoc



Joined: 30 Apr 2009
Posts: 16

View user's profile Send private message

PIC18f2450
PostPosted: Thu Apr 30, 2009 6:48 am     Reply with quote

Hi guys,

I have began a project with a PIC18f2450 and I am having trouble turning on the Vusb pin 14 on the part for USB communication.
I want to use the internal voltage regulator which puts 3,3V on this pin for the pull-up resistor.
For my fuses I have the following enabled
#Fuses HSPLL,NOWDT,NOPROTECT,NOBROWNOUT,NOPUT,DEBUG,NOLVP,USBDIV,PLL5,CPUDIV1,VREGEN, NOXINST,MCLR

I'm using a 20Mhz crystal so thats why I have the PLL5 to obtain the 48Mhz clock for the USB 2.0 communication.

I have downloaded this code ( ps i have other code working fine I2C protocol) and I am not seeing 3,3V on Vusb.

Does anyone have any ideas ?
Ttelmah
Guest







PostPosted: Thu Apr 30, 2009 7:24 am     Reply with quote

Obvious comment #1. What capacitor have you got on it?.
Then, what code are you using for the USB?.
The regulator depends on three bits. VREGEN, the master 'USBEN', and the 'SUSPND' bit. The latter is not likely to be a problem, unless you have tweaked things, but USBEN could be the problem. Some of the examples, won't actually enable the USB peripheral, till a connection is 'seen'. This is controlled by the connection sense pin (normally wired to B2), which takes the 5v from the USB bus, feeds this through a potential divider, giving a logic input, that goes true, when the USB cable is attached. When this is seen, the USB peripheral is enabled, and enumeration begins. If you are using the standard examples, check how this is configured.

Best Wishes
eoinoc



Joined: 30 Apr 2009
Posts: 16

View user's profile Send private message

PostPosted: Thu Apr 30, 2009 8:36 am     Reply with quote

I put a 220nF cap to ground on pin14 and I also placed a 1,5k pullup to D+ pin16.

#include <18f2450.h>
#include "pic18_usb.h"
//#include "usb.h"

#use fast_io(b)
//#define bit short int
//#device icd=true
#Fuses HSPLL,NOWDT,NOPROTECT,NOBROWNOUT,NOPUT,DEBUG,NOLVP,USBDIV,PLL5,CPUDIV1,VREGEN,NOXINST,MCLR

Thats a snippit from my code, I tried attaching usb.h but i get an error "External symbol not found USB_stack_status

For the moment I would just like to see the 3,3v on Vusb but im still not seeing it, I even tried connecting the PIC to my pc but still no action on Vusb, its just sitting at 0v

So you are saying I need to connect the 5v pin from the USB connector to pinb2 of the pic ? Problem there is I am already using B2 for something different.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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