Thread (17 messages) 17 messages, 4 authors, 2009-08-31

AT91SAM9260: How to output PCK0 clock on a GPIO pin

flat view

From: Pedro I. Sanchez <hidden>
Date: 2009-08-31 21:06:09

On Tue, 1 Sep 2009 00:35:46 +0400, Sergey Matyukevich [off-list ref]
wrote:
quoted
So are the following statements correct?

1. The pck0 clock I've been playing with has nothing to do with the
clock I want on PC6 (TIOB2).
Yes. PCK's (programmable clocks) are assigned to different pins:  
PB30, PC1 for PCK0 and to  PB31, PC2 for PCK1. 
For PCK see ch. 26 of at91sam9260 datasheet.
quoted
2. I have to use instead the "tc2_clk" as defined in
arch/arm/mach-at-91/at91sam9260.c.
Yes
quoted
3. I have to access the TC_CMR register directly to set things up. I
mean, there are no macros already defined to access these structures.
You have to 'ioremap' required registers and write to those
registers directly using memory-writing macroses iowriteXX.

But at first decide what you need, TIOB or PCK. If you don't need all
the power of Ryan Mallon's pwm driver (see below in the thread) and
all you need is clocking output on GPIO pin, then you might be happy
with PCK. Note that PMC_PCK registers allows several dividers, if
original clock is too high.

Sergey
Well, the board I'm working on, as well several others already on my shelf
:-(, is already wired to use PC6 so I have to go the TC way. So this is the
way to go for me.

-- 
Pedro
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help