Re: [Flashforth-devel] flashforth on p18f4550 - No usb?
Brought to you by:
oh2aun
From: Mikael N. <mik...@pp...> - 2011-10-14 16:02:10
|
Hi Scott. Great that it works ! So if you want you can make the CPU run slower with the CPUDIV. PLLDIV must be set according to what kind of XTAL you have. USBDIV should always be 2 The clock constant tells how fast the CPU is running. It is needed for setting up the 1 ms timer and for configuring the UART baud rate. Did you have any special project in mid for FlashForth. For the 4550 and cousins, here are a few examples for full speed USB. config PLLDIV = 1 ; 4 MHz XT xtal config PLLDIV = 2 ; 8 MHz XT xtal config PLLDIV = 3 ; 12 MHz XT xtal config PLLDIV = 4 ; 16 MHz XT xtal config PLLDIV = 5 ; 20 MHz XT xtal config CPUDIV = OSC1_PLL2 ; 48 MHz cpu clock constant clock=d'48000000' config CPUDIV = OSC2_PLL3 ; 24 MHz cpu clock constant clock=d'24000000' config CPUDIV = OSC3_PLL4 ; 16 MHz cpu clock constant clock=d'16000000' config CPUDIV = OSC4_PLL6 ; 8 MHz cpu clock constant clock=d'8000000' config USBDIV = 2 ; USB clock from 96 MHZ PLL divided by 2 Cheers Mike |