Frequency Generator / divider using Timer

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using 14.7456MHz oscillator and I connected it in ATmega 88x xtal/osc input. Also using ADC from Maxim MAX1403 that allows 2.4576MHz input frequency. Is it possible to divide 14.7456MHz frequency by 6 using uC and wire it to the ADC.

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow--a $40 part...and a $2 AVR. ;)

Yes, you can get a /6 clock by dedicating one of the timers and using one of the OC pins.

For Timer0, for example, and OC0A:

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: 14745.600 kHz
// Mode: CTC top=OCR0A
// OC0A output: Toggle on compare match
// OC0B output: Disconnected
TCCR0A=0x42;
TCCR0B=0x01;
TCNT0=0x00;
OCR0A=0x02;
OCR0B=0x00;

and make PD6 an output.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great, Thanks for your example code!