Hi.
I'm trying to get a 18f24k50 to work with USB and the internal
oscillator. The chips will arrive next week, in the mean time I'm
working on my code.
At first I got a lot of compile errors in the usb_drv library, but I
found this post from 21st June, by Jim Gregory:
"The usb_drv library is not compatible with the newer k50 parts
(18f24k50/18f25k50/18f45k50). The library assumes the USB interrupt
flag and enable bit addresses are PIE2_USBIF and PIE2_USBIE,
respectively, but on these parts the address are PIE3_USBIF and
PIE3_USBIE. This causes compilers errors when attempting to use any USB
protocol with these parts."
I added two lines to 18f24k50.jal and the compiler errors went away:
var volatile bit PIE2_USBIE at PIE3 : 2
var volatile bit PIR2_USBIF at PIR3 : 2
My test program:
include 18f24k50 -- target PICmicro
pragma target clock 48_000_000 -- frequency
pragma target OSC INTOSC_NOCLKOUT --internal oscillator 16Mhz
pragma target PLLEN enabled --PLL Enable Configuration bit
pragma target PLLSEL PLL3X --3*16MHz=48MHz
pragma target CPUDIV P1 -- CPU System Clock Postscaler
pragma target WDT disabled -- no watchdog
pragma target DEBUG disabled -- no debugging
pragma target IESO disabled -- no in/ext oscillator switchover
pragma target LVP disabled -- no Low Voltage Programming
pragma target MCLR external -- reset externally
ACTCON_ACTEN = 1 -- Self tuning on
include usb_serial
enable_digital_io()
forever loop
-- do stuff
end loop
Does this look like it should work?
--
Emil
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.