CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

pic 24fj pll settings and rs232 and lcd problem!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
scalebor



Joined: 08 Jul 2013
Posts: 3
Location: Türkiye

View user's profile Send private message

pic 24fj pll settings and rs232 and lcd problem!
PostPosted: Mon Jul 08, 2013 1:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 08, 2013 5:49 am     Reply with quote

#FUSE PR_PLL
scalebor



Joined: 08 Jul 2013
Posts: 3
Location: Türkiye

View user's profile Send private message

PostPosted: Wed Jul 10, 2013 2:16 am     Reply with quote

sorry , i allready use PR_PLL.i wrote wrong.
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Wed Jul 10, 2013 3:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 10, 2013 5:34 am     Reply with quote

#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: 19518

View user's profile Send private message

PostPosted: Wed Jul 10, 2013 7:35 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group