Thanks Rob, after much guessing values, I got it to work with serial.
I'll try USB soon. The device file is ok, sorry about that I must have
misread something. How is the OSC is calculated with these working
values? Why is there P1(no devide) on CPUDIV, when on 18F4550 it is
P2(div 2)?

Can I use Internal Oscillator for USB? What settings can I use?

include 18f67j50                    -- target PICmicro
-- include chip
pragma target clock 48_000_000     -- oscillator frequency
-- configuration memory settings (fuses)
pragma target WDT  disabled        -- no watchdog
pragma target PLLDIV        P5     -- divide by 5 - 20MHZ_INPUT
pragma target CPUDIV        P1     -- no cpu system clock divide
pragma target OSC  HS_PLL          -- HS crystal or resonator
OSCTUNE_PLLEN = 1                  -- set 96mhz pll
_usec_delay(1_000)                 -- wait for OSC PLL to settle

Matt.

On Sep 27, 4:42 am, Rob Hamerling <[email protected]> wrote:
> Hi Matt,
>
> On 10/09/27 02:27, mattschinkel wrote:
>
> > Hey guys, I'd like to get USB going on 18f67j50.
>
> > I am having trouble getting the correct frequency. I have a 20mhz
> > crystal, but I would prefer internal osc if possible. I can't even get
> > serial to work at 48mhz OSC.
>
> > I had a look at the fuses which seem to be wrong compared to the
> > datasheet, and I don't see any USBPLL either.
>
> I've checked the datasheet and I cannot find anything wrong with the
> 18f67j50 device file in this respect.
>
> fuse_def OSC contains all possible variations, correct and none are
> missing.  Where in the datasheet did you find a reference to USBPLL and
> what would be the bit combination for it?
>
> fuse_def PLLDIV is also complete and correct. What exactly is wrong in
> your view?
>
> Did we look in the same datasheet (DS39775C)?
>
> Beware that you also have to set OSCTUNE_PLLEN to actually activate PLL.
>
> And don't forget to specify fuse_def CPUDIV.
>
> When your external oscillator is defect the PIC may switch to internal
> oscillator automatically, depending on config bits (don't trust
> defaults!), but of course then you should configure the internal
> oscillator for the desired frequency (OSCCON, OSCTUNE, maybe more).
>
> Regards, Rob.
>
> --
> R. Hamerling, Netherlands ---http://www.robh.nl

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to