Pages: [1]   Go Down
Author Topic: Arduino Due Clock output  (Read 1923 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 142
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 142
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8583
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any example code of setting that up?
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8583
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I've not worked with this yet.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1]   Go Up
Jump to: