Page 1 of 1
External clock on a pin
Posted: Mon Dec 03, 2012 11:45 am
by Mantas
Hello everybody,
I have a ITG-3200 3-axis gyro from Invensense. This chip is equipped with an input of external clock, which can be either 32.768kHz reference, or 19.2MHz reference, to get more stable readings. What is the best way to generate a clock pulse at the mentioned frequencies on ARM SAM7 chip?
Best regards,
Mantas
Re: External clock on a pin
Posted: Mon Dec 03, 2012 11:52 am
by Benj
Hello Mantas,
I would use an external component such as a crystal or digital oscillator to drive the gyro. Driving the clock output yourself from the ARM is probably do-able but would likely eat up a lot of the process time especially at 19.6608MHz. Also generating the clock yourself will not be as accurate as it could be using a crystal or other accurate clock source.
If you must generate via the ARM then the lower frequency can probably be generated by using a timer interrupt running at twice the frequency. Inside the timer routine you check to see if the output is already on, if it is then switch it off and visa versa.
Re: External clock on a pin
Posted: Mon Dec 03, 2012 12:14 pm
by Mantas
Thanks Ben,
I will consider a 32.768kHz crystal as it is much cheaper than 19.2Mhz.
There is a line in a datasheet: Optional external clock inputs of 32.768kHz or 19.2MHz
to synchronize with system clock
what does it mean to sync with system clock? ARM is running at much higher frequency, so how it will sync?? a little confused..
Best regards,
Mantas
Re: External clock on a pin
Posted: Mon Dec 03, 2012 1:50 pm
by Benj
Hello Mantas,
In some systems it is better to run all processors off the same clock as it means that their program cycles are synchronized. For most cases this synchronization is overkill and is not really necessary.
Re: External clock on a pin
Posted: Mon Dec 03, 2012 2:42 pm
by Enamul
There is a line in a datasheet: Optional external clock inputs of 32.768kHz or 19.2MHz to synchronize with system clock
what does it mean to sync with system clock? ARM is running at much higher frequency, so how it will sync?? a little confused..
In my sense, I can feel from most of the microcontroller there is an option to have 1/4 of clock frequency in which the processor is running. If you use that clock/4 frequency to drive your IC in that case your system will be synchronised. We did that for MRI (Magnetic Resonance Imaging)scanner to synchronize with EEG (Electroencephalography)machine.
Re: External clock on a pin
Posted: Mon Dec 03, 2012 9:24 pm
by Mantas
As I am working on a real time system, I wouldn't want to scale down the system clock, because the chip is doing a lot of floating point operations in real time, so this would degrade the performance of the implemented algorithm. I think I will stick to one of the gyros as a reference clock.
Best regards,
Mantas