Author Topic: Can I use this crystal for a pic ?  (Read 3067 times)

0 Members and 1 Guest are viewing this topic.

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 93
Can I use this crystal for a pic ?
« on: March 27, 2015, 07:17:57 pm »
Hi,

  I need a small and precise crystal for a Pic based clock. Searching on mouser, I found the TSX-3225 (datasheet).

  -Is this crystal ok for a pic (pic16f1508) ?
  -The datasheet does'nt say if it is a serie or parallel crystal (some Pic datasheet say that the MCU will only work with serie crystal, but he pic18f1508 datasheet doesn't say anything about this question) ?
  -Will it require a serie resistor ?
  -Which values should I pick for the capacitors ? (the datasheet says "Load capacitance : 7 pF to infinity")

Thanks you,
John.
 

Offline hamdi.tn

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: Can I use this crystal for a pic ?
« Reply #1 on: March 27, 2015, 07:42:51 pm »
16f1508 have an internal 16Mhz crystal so you don't need an external one to run the chip, for precise clock counting you need a 32.768 Khz crystal used with Timer 1 to get a precise seconds counting. so the crystal you asked about is useless for this application.
 

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 93
Re: Can I use this crystal for a pic ?
« Reply #2 on: March 27, 2015, 07:50:03 pm »

  The 32.768 crystal would be a bit more handy than a 12mHz or 16mHz one, but I could not find one in a proper package for my pcb. In addition to this, the low frequency crystals needs to be connected on different pin on the pic which, again causes some problems.

  My understanding is that if I use a 16mHz crystal, the only problem is that I will need to set prescaler to 8, have an interrupt every 50.000 cycles (16 bits timer), and increment the seconds every twentieth call of the interrupt. With a 32.768kHz crystal I could just have the interrupt called every 32.768 ticks.

  I am right there ? And if I am, can I use this 16mHz crystal for my pic ?

Thank you,
John.
 

Offline hamdi.tn

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: Can I use this crystal for a pic ?
« Reply #3 on: March 27, 2015, 08:14:46 pm »
IMO 32k crystal is better than both if used with the timer 1, but yes you still can use 16Mhz one, but you count the seconds every tenth call of the interrupt, why twentieth  :-//
 

Offline katzohki

  • Frequent Contributor
  • **
  • Posts: 378
  • Country: us
    • My Blog
Re: Can I use this crystal for a pic ?
« Reply #4 on: March 27, 2015, 08:15:50 pm »
16f1508 have an internal 16Mhz crystal so you don't need an external one to run the chip, for precise clock counting you need a 32.768 Khz crystal used with Timer 1 to get a precise seconds counting. so the crystal you asked about is useless for this application.

It's actually an RC oscillator, not a crystal. I always prefer to use the internal oscillator when I can, but for a good clock you need precision.
 

Offline hamdi.tn

  • Frequent Contributor
  • **
  • Posts: 623
  • Country: tn
Re: Can I use this crystal for a pic ?
« Reply #5 on: March 27, 2015, 08:46:17 pm »
16f1508 have an internal 16Mhz crystal so you don't need an external one to run the chip, for precise clock counting you need a 32.768 Khz crystal used with Timer 1 to get a precise seconds counting. so the crystal you asked about is useless for this application.

It's actually an RC oscillator, not a crystal. I always prefer to use the internal oscillator when I can, but for a good clock you need precision.

yap an RC my bad , same here i use internal most of the time, for clock 32K

if your project still in design stage , i suggest you use a micro with internal RTC, that help a lot for a clock application.
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Can I use this crystal for a pic ?
« Reply #6 on: March 27, 2015, 09:43:26 pm »
You do not say what your system needs are, so its harder to give good advice.

Are you avoiding Timer1 because you need the i/o pins for other functions ?

Do you need a system clock of  Fosc 16mhz / 4 ? for specific functions.

My local main supplier has 256 different 32k crystals in both though hole and smd, so why cannot you fit one to your design ?

Again your word 'precise'  thats rather unqualified, Timer1 with a 32k crystal will be out by a couple of seconds a week, unless you trim its capacitors or compensate in the software.

You can buy reasonably priced TCXO smd chips which give better accuracy than most standard crystals.

As an alternative, have a look at this site which gives details of a more precise 1 second timer, have read about it in another forum  but not actually tried it myself.

http://www.romanblack.com/one_sec.htm
 

Offline JaunedeauTopic starter

  • Regular Contributor
  • *
  • Posts: 93
Re: Can I use this crystal for a pic ?
« Reply #7 on: March 27, 2015, 11:16:06 pm »
>You do not say what your system needs are, so its harder to give good advice.

My main concern is size. My pcb is very small and the TX-3225 is just fit in the pcb almost no room left.
Second concern is precision since this is a clock of course. The 3225 is 10ppm, that's as good as I can find.

I use pics because the internal clamping diodes saves me 22 resistors on the pcb.

I know there are plenty of other possible solutions, but I'd like to understand if this one would fit.

The tsx-3225 is available at my supplier, have the proper size and is precise enough. Does someone know if I can use it, what value are needed for the capacitors, and if I need a serie resistor ?

Th,
Jophn.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf