problems with 18f27j53 and usb

Discuss PIC and electronic related things

Moderators: David Barker, Jerry Messina

Post Reply
richardb
Posts: 306
Joined: Tue Oct 03, 2006 8:54 pm

problems with 18f27j53 and usb

Post by richardb » Mon Jun 17, 2013 7:34 am

I've just realised I should have posted this as a new thread

I have a pcb that is designed for both 3v3 and 5 v with a jumper to select between the voltages, I have a 10uf ceramic on pin6(VDDcore)

If I fit an 18f2553 with the following config then it works and connects to the usb

Device = 18F2553
Clock = 48
Config
PLLDIV = 5,
CPUDIV = OSC1_PLL2,
USBDIV = 2,
FOSC = ECPLLIO_EC,
LVP = OFF,
VREGEN = ON

If I then fit the 18f27j53 and use the following config then it can flash an led at the correct rate but wont connect to the usb, I get "usb device not recognised" in windows

Device = 18F27j53
Clock = 48
Config
PLLDIV = 5,
CPUDIV = OSC1,
OSC = ECPLL,
CLKOEC = OFF,
CFGPLLEN = ON


I'm just wondering if I've messed up the config and the usb osc is wrong or something is missing.

Does anyone know if this is the correct setting for a 20MHz input from a clock source.
Hmmm..

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Mon Jun 17, 2013 9:21 am

That looks to be pretty similar to what I'm using for a 26J53.

I don't remember if there were any tricks to getting the J53 to work... the memory layout is a lot different in that chip.

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Post by RangerBob » Mon Jun 17, 2013 9:24 am

Looks about right to me but I haven't personally used this mode on this device.

As a quick test; have you tried just using the internal osc on the 18F27J53? On this device you can safely run Full speed USB off the internal 8Mhz oscillator, which is how I've been running it. Might give you some confidence about the board/chip.

Code: Select all

Device = 18F27J53
Clock = 48

Public Config
   OSC = INTOSCPLLO,                  ' internal osc 8MHz
   PLLDIV = 2,                        ' usb 48MHz
   CPUDIV = OSC1,                     ' 48MHz cpu clock
   FCMEN = OFF,
   IESO = OFF,
   WDTEN = OFF,
   WDTPS = 2048,
   STVREN = ON,
   XINST = OFF
   'DEBUG = OFF
Also which USB stack are you using? If you are not using Jerry's 1.42 stack it is well worth using (and may be necessary)!

Regards,

Rangerbob

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Post by RangerBob » Mon Jun 17, 2013 9:26 am

PS. I have some known working test code up on the wiki here:
http://www.sfcompiler.co.uk/wiki/pmwiki ... er.IntRTCC which uses this device that might be worth trying (uses internal osc).

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Post by bitfogav » Mon Jun 17, 2013 9:42 am

I was going to suggest running it with the internal clock as RangerBob suggested, but also correct me if I'm wrong the Vusb needs to be connected to 3.3v aswell.. were as the 18F2553 only needs a Cap to ground on the Vusb line.

richardb
Posts: 306
Joined: Tue Oct 03, 2006 8:54 pm

Post by richardb » Mon Jun 17, 2013 10:00 am

oooooh..... I think Bitofgav may have spotted the problem. I will try adding a link, it always amazes me how often microchip make subtle changes I just wish they had renamed the pin :(
Hmmm..

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Post by bitfogav » Mon Jun 17, 2013 10:05 am

I think thats just something thats caught me out before. Keep us posted if that fixes the problem.

richardb
Posts: 306
Joined: Tue Oct 03, 2006 8:54 pm

Post by richardb » Mon Jun 17, 2013 10:44 am

That was it !! thanks to everyone for the suggestions and especially to bitfogav.

that will teach me not to rtfm...
Hmmm..

Post Reply