Clock signal on a general purpose I/O pin

Discussions about all user software around SAM Series.

Moderator: nferre

the_ideator
Posts: 2
Joined: Tue Oct 19, 2010 8:19 pm

Clock signal on a general purpose I/O pin

Sun Oct 24, 2010 8:27 pm

Hi everybody!
It's just a week I'm stuck on this problem :evil:
I'm a complete AT91SAM9260 newbe and at work i have to write an application based on this MCU that runs on a custom board very similar in functionalities to AT91SAM9260-EK.
I have to get a clock on 8 I/O pins (PC1-PC8) and i want that signal pulsing at 20 KHz.
Surfing the web i found that it's possible to associate Timer/Counter to I/O pins (unfortunately isn't up to me to decide pins configuration on this board, so i have to use those pins to emit that pulsed signal!): if i got it well, you have to first set as output clock the pin you want to deal with (some function like "set_C_periph(...)" is used) and then you have to modulate some parameters like PLLs and MCK.
So i ask you: how can precisely do that, considering it could be possible to do so for all those 8 pins at the same time? Could you post a simple C example?
Some more detail:
1.i suppose i can't use the Programmable Clock (there are only 2 PCK signals, that way i could only send two signal at the same time).
2. I found code examples that use mach-at91 libs under linux kernel sources but my application should run as a normal stand-alone program and not as a kernel module. So i was thinking about the usage of AT91LIB, provided by ATMEL in its sample code for AT91SAM9260 Evaluation Board. Do you know the differences between these two libs?
Thanks in advance :wink:

Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest