DSPRelated.com
Forums

GPIO as clock output

Started by iddq...@gmail.com June 15, 2008
HI

Does anyone know how to use GPIO pin to be a clock output?
I have try to set the "GPIO high----GPIO low_____GPIO high----GPIO low_____" to simulate the clock output. But that always give me some extra overheads that makes the clock unreliable. As you know the accuracy of the clock is important. Anyone have any idea how to use GPIO pin as clock output? All suggestions are welcome. Any help would be appreciated.

Thanks
Peter
Hi ,
Configure one Timer for your desired (Frequency/2) interval . Enable
the Timer interrupt .
For every T/2 , timer interrupt handler function will be called . In the
handler function ,toggle your GPIO pin status.
Toggling GPIO pin values will not add much overheads if your required clock
frequency is not that high .

- Jai

On Mon, Jun 16, 2008 at 8:48 AM, wrote:

> HI
>
> Does anyone know how to use GPIO pin to be a clock output?
> I have try to set the "GPIO high----GPIO low_____GPIO high----GPIO
> low_____" to simulate the clock output. But that always give me some extra
> overheads that makes the clock unreliable. As you know the accuracy of the
> clock is important. Anyone have any idea how to use GPIO pin as clock
> output? All suggestions are welcome. Any help would be appreciated.
>
> Thanks
> Peter
>
Peter-

> Does anyone know how to use GPIO pin to be a clock output?
> I have try to set the "GPIO high----GPIO low_____GPIO high----GPIO low_____"
> to simulate the clock output. But that always give me some extra overheads
> that makes the clock unreliable. As you know the accuracy of the clock is
> important. Anyone have any idea how to use GPIO pin as clock output? All
> suggestions are welcome. Any help would be appreciated.

Suggest to use the TIM1 pin for this. The TIMn pins are connected to onchip timer
circuitry output, and they also have drive characteristics more suitable for use as a
clock. The TIM0 pin is not a good idea, as TIMER0 is used by DSP/BIOS.

Using a GPIO pin for a clock is a bad idea. GPIO pins are not intended for this. As
you've discovered, tightly controlled timing of output signals is not possible.

-Jeff