Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
ARM920 Timer Counter Configuration
- 12-18-2006
- sjohnson
December 18, 2006, 6:01 pm

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

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

Re: ARM920 Timer Counter Configuration

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;
}
....
}
Site Timeline
- » GPL vs SonoCalc™ IMT Embedded Linux Software
- — Next thread in » Embedded Linux
-
- » where can i find linux image/src apart from one on the Atmel website?
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Javascript help with iframes
- — The site's Newest Thread. Posted in » Electronics Design
-
- » Matériel électronique à céder, quel "j uste" prix... ? Conseils éventuels ...
- — The site's Last Updated Thread. Posted in » Electronics (French)
-