ARM920 Timer Counter Configuration

Hi,

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.

Thanks, Steve

mailto: snipped-for-privacy@powereng.com

Reply to
sjohnson
Loading thread data ...

Try this

formatting link

-- _ | | / /__ .----------------------------------------------------------._____/ (___) | Rick Bronson rick at efn dot org Tel 541-485-7264 | (___) | Amazonia Computing

formatting link
__ o |_____ (___) | 5050 Donald Street "Onde esta dinheiro?" _`\

Reply to
Rick Bronson

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

-Michael

Reply to
Michael Schnell

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_CMR = AT91C_TC_TIMER_DIV2_CLOCK | AT91C_TC_CPCTRG; 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; } ....

}
Reply to
sjohnson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.