external oscillator question...

Thread Starter

osx-addict

Joined Feb 9, 2012
122
Hi all... Stupid question if you don't mind.. I'll be using an external RTCC (NXP PCF2127A) which can provide a clock output which I was thinking about connecting as the external clock to drive the PIC24FJ64 processor clock.. However, the spec-sheet for that PIC part (section 2.6) indicates that I should use grounded copper pours and is very specific about parts placement.. However, if I'm just connecting a line from the RTCC's clock-out line to the OSCI line on the PIC24 is this really necessary? I'll not be using an XTAL or caps as far as I know.. I'm still reading up on the external oscillator use in the spec sheet to ensure I'm following it..

I guess I could just skip this and use the internal clock and leave it at that. Any suggestions here? I don't need a super accurate setup since my RTCC will take care of good time keeping for me..

Thx!
 

ErnieM

Joined Apr 24, 2011
8,377
I believe you could just drive SOSCI directly using the Low-Power oscillator mode. In any case the recommended layout is very conservative, and completely unnecessary for a digital line.

If your NXP chip already has an excellent 32KHx output why add the parts to make another one?
 

Thread Starter

osx-addict

Joined Feb 9, 2012
122
Thanks Ernie.. I need to read-up more on which input to connect to on the PIC side -- you might be right that it's the SOSCI and not the OSCI input -- I was reading the section last night but wasn't quite following the slow vs fast vs etc conversation..

In this case the NXP part has an open drain oscillator output of the main TCXO 32Mhz clock -- hence the interest to use it in lieu of external parts or using the internal clock provided natively by the PIC itself.. (at least as I recall -- I don't have the data sheet in front of me)..

So, for simplicity sake, I should be able to run a single line (short as possible I'd think) between the output pin on the NXP part to the clock input on the PIC and life should be good.. :p
 

Thread Starter

osx-addict

Joined Feb 9, 2012
122
Ok.. I answered my own question.. Per section 6.5.3 of the PIC24F manual it states that I can connect a CMOS oscillator source directly to the primary oscillator input line (OSC1) and program the config bits to be in EC mode (external clock). I gather I do not want to use ECPLL mode which will consume the most power because the PLL is enabled (besides the fact that I don't need to do any clock multiplication anyway).. If I'm going to feed a 32Mhz signal directly, no PLL circuit is required. Yeah!

P.S. I'm feeling more comfortable with the PIC24F than I was with the PIC32MX150 I was planning on using.. I really didn't need the extra power and can also save some $$ as the 24's are a little cheaper.. :D

This is getting fun! My wife still wonders what I'm working on late at night as I scour docs and poke around on the Mouser site.. :rolleyes:
 

ErnieM

Joined Apr 24, 2011
8,377
32MHz? Huh? The NXP's output is only 32KHz, 3 orders of magnitude less. :D

Here's the entire clock diagram:


While you can drive OSC1 with NXP everything runs slow. The good news is there is a nice 8MHz oscillator (FRC) on board which you can PLL-up higher if you wish.

I was saying to drive SOSCI by the NXP (with a pull-up from the PIC's supply) as you need that clock line to keep your RTCC active. I did a PIC32 clock once that way: an external RTCC was just used to init the PIC at power on, then the PIC registers kept the time for as long as the device was on.

SOSCI drives the gate input the same way as an external clock drives OSC1, which is why I said to drive there. I have not personally tried this but if I was going to try something it would be my first way to go.
 

Attachments

Thread Starter

osx-addict

Joined Feb 9, 2012
122
32MHz? Huh? The NXP's output is only 32KHz, 3 orders of magnitude less. :D
Doh!! How did I miss that MINOR issue! :eek:

In light of that discovery I'll probably just skip using that to keep things simple and just use the built in OSC and leave it at that.. I follow your suggestion though -- sounds interesting BUT if I've got a full external RTC I'll probably just go that route and leave the PIC's internal one unused..

Oops.. One minor design gotcha related to using the internal oscillator -- found in the user guide section 6.8 :

Due to specified FRC accuracy, the FRC Oscillator modes may not meet the minimum frequency accuracy requirements for serial communications (such as UART and USB).
Another Doh! Ok.. Back to the drawing board. External RTC clock is too slow (32Khz instead of 32Mhz -- can't multiply it up enough), internal clock not accurate enough for serial comm.. So, that leaves me with either using another external oscillator or a crystal of some sort which then requires the associated caps and extra board space to properly ground it per the spec-sheet..

If I go the lazy but requires less board space way, I think I can use one of these parts which is only another $1 and change ea (when buying >100 parts), shouldn't require any odd PCB work and is fairly small I guess (0.5"x0.5").. Am I missing anything with using something like this and feeding it's 32Mhz output in the same manner as discussed earlier (into OSC1)?
 

ErnieM

Joined Apr 24, 2011
8,377
An external clock oscillator like that is an excellent choice. I've used them when I need extreme accuracy as they "just work."

I do hope you're not using this for USB as that chip doesn't have one.

For RS-232 on a one-off project you could probably just use the internal oscillator, (especially if you use the lower transfer rates) with no problems.
 

Thread Starter

osx-addict

Joined Feb 9, 2012
122
Thanks Ernie! No, I'm not using USB so that's no issue.. But on the other hand I don't want to go through the effort of designing something only to find I messed up by taking a short-cut and finding I've got to re-spin the PCB.. I'll have to see if I can get a sample or two of that part to play with.. Thanks again for the help!!
 

ErnieM

Joined Apr 24, 2011
8,377
There's nothing wrong with putting in the clock chip into the PCB and just not populating the holes if you find out later you don't need it when you go right to PCB for you prototype. I always hand wire the first one.
 
Top