ARM920 Timer Counter Configuration

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View

Does anyone have any example code demonstrating how to configure a
timer/counter interrupt for the AT91 processor running Linux? I'm new
to running embedded Linux, and I can't seem to find any information out
on the net. All that I am really trying to do is generate a periodic
interrupt using one of  the built in timer/counter channels.

Any information would be greatly appreciated.



Re: ARM920 Timer Counter Configuration
Try this
                                                                  | |
We've slightly trimmed the long signature. Click to see the full one.
Re: ARM920 Timer Counter Configuration
You want to create a device driver kernel module.

So first you need to know how to create a device driver: "Linux device
drivers 3rd Edition" by Rubini and Friends.

Then you proceed according to the information the chips data sheet


Re: ARM920 Timer Counter Configuration

Quoted text here. Click to load it

Thanks, Michael. I am able to build a device driver without a problem.
I guess my real question is how to actually configure the timer counter
in Linux for the AT9200RM processor. I have found an application note
on the Atmel site that describes the process without using an OS. My
problem is that I'm not sure what to do in Linux. Here's what I am
trying, but I think its totally wrong:

volatile AT91PS_TCB p_tcb = (AT91PS_TCB)AT91C_VA_BASE_TCB0;
volatile AT91PS_TC  p_tc  (AT91PS_TC)&p_tcb->TCB_TC0;

status = request_irq(AT91C_ID_TC0, timer_isr, SA_INTERRUPT,
"timer_isr", NULL);
if ( !status ) {
    p_tc->TC_CCR = AT91_TC_CLKDIS;
    p_tc->TC_IDR = AT91C_TC_CPCS;
    dummy = p_tc->TC_SR;
    p_tc->TC_CCR = AT91C_CLKEN;
    p_tc->TC_IER = AT91C_TC_CPCS;
    p_tc->TC_RC = 0x00ff;
    p_tc->TC_CCR = AT91C_TC_SWTRG;


Site Timeline