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
External clock on a pin
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: External clock on a pin
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Mantas
- Posts: 221
- Joined: Tue May 15, 2012 10:32 pm
- Location: Klaipeda, Lithuania - North sea, UK
- Has thanked: 57 times
- Been thanked: 27 times
Re: External clock on a pin
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
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
Science is my true religion.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: External clock on a pin
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
Re: External clock on a pin
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.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..
- Mantas
- Posts: 221
- Joined: Tue May 15, 2012 10:32 pm
- Location: Klaipeda, Lithuania - North sea, UK
- Has thanked: 57 times
- Been thanked: 27 times
Re: External clock on a pin
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
Best regards,
Mantas
Science is my true religion.