View previous topic :: View next topic |
Author |
Message |
scalebor
Joined: 08 Jul 2013 Posts: 3 Location: Türkiye
|
pic 24fj pll settings and rs232 and lcd problem! |
Posted: Mon Jul 08, 2013 1:14 am |
|
|
hi,
I use pic24fj256gb110 device. When i configured pll settings, rs232 baud rate is problem. I can not connect to pc. I tried every baud rate, but not. I see my delay_ms() function is too slow. I write 1000ms but it is 8-9 s. I don't understand what the problem is.
Code: |
#FUSES PR //Primary Oscillator with PLL
#FUSES PLL2 //Divide By 2(8MHz oscillator input) (i use 8MHz)
#use delay(clock=32000000) or i tried 48MHz |
|
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Mon Jul 08, 2013 5:49 am |
|
|
#FUSE PR_PLL |
|
|
scalebor
Joined: 08 Jul 2013 Posts: 3 Location: Türkiye
|
|
Posted: Wed Jul 10, 2013 2:16 am |
|
|
sorry , i allready use PR_PLL.i wrote wrong. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19519
|
|
Posted: Wed Jul 10, 2013 3:52 am |
|
|
You are not selecting a primary oscillator.....
On these chips the PR_PLL setting, says 'use the primary oscillator with PLL', and PLL2, says 'divide the clock by 2 to feed the PLL'. However you need to also say what oscillator 'type' you want the primary to be. XT - for 8MHz. Currently you have no primary oscillator type selected (so default to NOPR), and this won't start. The chip will therefore 'fall back' to using the internal RC.....
You can always see what is happening, by looking at the end of the .LST file at the programmed fuse list. With:
#FUSES PR_PLL, PLL2
The fuse list shows:
Code: |
Configuration Fuses:
Word 1L: 3F5F WPOSTS16 WDT128 WINDIS NOWDT ICSP1 NODEBUG NOWRT NOPROTECT NOJTAG
H: FF00
Word 2L: 93FB NOPR DISUVREG IOL1WAY NOOSCIO PR_PLL PLL2 IESO
H: FF00
Word 3L: FFFF WPFP WPDIS NOWPCFG WPEND
H: FF00
Word 4L: 0000
H: FF00
|
If you instead use:
#FUSES PR_PLL, PLL2, XT
you get:
Code: |
Configuration Fuses:
Word 1L: 3F5F WPOSTS16 WDT128 WINDIS NOWDT ICSP1 NODEBUG NOWRT NOPROTECT NOJTAG
H: FF00
Word 2L: 93F9 XT DISUVREG IOL1WAY NOOSCIO PR_PLL PLL2 IESO
H: FF00
Word 3L: FFFF WPFP WPDIS NOWPCFG WPEND
H: FF00
Word 4L: 0000
H: FF00
|
Note that the primary oscillator is now selected to use XT mode (up to 10Mhz on these chips).
Best Wishes |
|
|
scalebor
Joined: 08 Jul 2013 Posts: 3 Location: Türkiye
|
|
Posted: Wed Jul 10, 2013 5:34 am |
|
|
#FUSES WPOSTS1
#FUSES NOWINDIS
#FUSES NOJTAG
#FUSES XT
#FUSES CKSFSM
#FUSES PR_PLL
#FUSES PLL2
#use delay(clock=32000000)
i use this settings but it is same problem. if i want to use 1sn delay,i use 250ms delay.
delay_ms(250) = 1 second delay. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19519
|
|
Posted: Wed Jul 10, 2013 7:35 am |
|
|
This means your primary oscillator is not starting.
You can 'prove' that this is the problem, by selecting NOCKSFSM. If the chip doesn't start, then something is wrong with the oscillator. Currently if the primary doesn't start, it'll drop back to the internal oscillator.
I'd say you possibly have a connection problem with the primary oscillator.
Best Wishes |
|
|
|