Go Down

Topic: Arduino Due Clock output (Read 2395 times) previous topic - next topic

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.

Gericom


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.
Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

dishimwe

i tried using the PWM signal but i could not adjust the frequency. Do you know how to change it?

Gericom


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
Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

dishimwe


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.

dishimwe

I finally found out that this:

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.

Graynomad

The SAM processor has 3 programmable clock pins but the function is not supported by Arduino.

From the data sheet

Quote
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
Rob Gray aka the GRAYnomad www.robgray.com

dishimwe

Any example code of setting that up?

Graynomad

Sorry, I've not worked with this yet.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy