Author Topic: X10 Oscillator  (Read 1837 times)

0 Members and 1 Guest are viewing this topic.

Offline javi.arTopic starter

  • Newbie
  • Posts: 2
X10 Oscillator
« on: May 05, 2013, 02:47:12 pm »
Hi, I am trying to develop an X10 project based on the microchip AN. it is quite hard to find an 7.68Mhz crystal oscillator for accomplishing 120Khz envelope...  which is the recomendation for substitution, RC, 555 ??? thanks a lot
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: X10 Oscillator
« Reply #1 on: May 05, 2013, 03:53:05 pm »
It seems like they just use that frequency along with the timer2 settings to divide it by 64 then use that as the pwm frequency to produce a 120 kHz square wave at 50% duty cycle.

You could instead use a NTSC colorburst crystal at 14.31818 MHz and divide that by 119. Since timer2's input is already the master clock divided by 4 (Fosc/4), then you only need to further divide by 29 (119/4). You can set the timer 2 prescaler to  1:1 and use the timer2 compare register to divide by 29.  Then you get 14.31818 MHz / 119 = 120.3208 kHz. This is within the X10 spec of +/- 2kHz

If you are in a PAL country, then you might have access to 13.5 MHz crystals.  If you use this one, just setup timer 2 to divide by 112 to get 120.536 kHz.

If you use an 11.0592 MHz crystal and divide by 92, you will get 120.209 kHz. This crystal is commonly used for older PC serial port chips.

You could also use an 8 MHz crystal and divide by 67.  Then you will get a frequency of 119.403 Khz.

These are all close enough for X10, and within the 2 kHz tolerance for the 120 kHz burst.

If you change the crystal, you need to make sure that the rest of the code from that appnote doesn't make any other timing assumptions that the clock frequency will be 7.68 MHz.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf