Does anybody know how to generate a clock signal on an digital pin of an Arduino Due?
like a CPU clock. I am trying to communicate to a OV3640 but i have to give it a 24 MHz clock signal. I was wondering if there was a way to generate that using the CPU clock of the Due.
dishimwe:
Does anybody know how to generate a clock signal on an digital pin of an Arduino Due?
like a CPU clock. I am trying to communicate to a OV3640 but i have to give it a 24 MHz clock signal. I was wondering if there was a way to generate that using the CPU clock of the Due.
I don't think that it is possible using the CPU clock, but you could maybe use a pwm signal. Or a timer interrupt.
i tried using the PWM signal but i could not adjust the frequency. Do you know how to change it?
dishimwe:
i tried using the PWM signal but i could not adjust the frequency. Do you know how to change it?
I don't exactly know, but you should definitely take a look at this: http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__pwm__group.html
Gericom:
I don't exactly know, but you should definitely take a look at this: http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__pwm__group.html
Thanks a lot! I am going to try that.
I finally found out that this:
Gericom:
I don't exactly know, but you should definitely take a look at this: http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__pwm__group.html
cannot work for me because am using the Arduino IDE. Do you know of anything else? Everything i tried cannot go above 150kHz frequency.
The SAM processor has 3 programmable clock pins but the function is not supported by Arduino.
From the data sheet
The PMC controls 3 signals to be output on external pins, PCKx. Each signal can be independently
programmed via the Programmable Clock Registers (PMC_PCKx).
PCKx can be independently selected between the Slow Clock (SLCK), the Main Clock
(MAINCK), the PLLA Clock (PLLACK), UTMI PLL Clock (UPLLCK/2) and the Master Clock
(MCK) by writing the CSS field in PMC_PCKx. Each output signal can also be divided by a
power of 2 between 1 and 64 by writing the PRES (Prescaler) field in PMC_PCKx.
I've not used them though so can't advise on that. They may not even be broken out on the Due.
Rob
Any example code of setting that up?
Sorry, I've not worked with this yet.
Rob