Advanced Search
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
February 05, 2012, 06:01:55 AM
Home
Help
Calendar
Login
Register
News
: Glomation introduced new wireless ready low cost GESBC-9260S
Glomation
»
Peer Support Forums
»
GESBC-9260
»
9260 event counter?
« previous
next »
Pages: [
1
]
Topic Tools
Topic Tools
Send this topic
Print
July 31, 2010, 09:51:06 PM
#0
tharold
tharold
Show tharold's last posts.
Show general stats for tharold.
Hero
Posts: 3
9260 event counter?
Hi,
Which pin can I use?
According to the 9260 datasheet, I will need to clock one of the TCLK0-2 pins or TIOA0-2 pins. However none of these are available on the GESBC-9260 board.
What is available are the TIOA3-5 pins and TCLK3-4 pins, but I can't find any documentation on them. There is supposed to be just 3 timer/counters on the chip, so I don't know what these extra pins do.
How can I implement an event counter (very low speed) on the 9260 board?
Thanks,
-harold
August 02, 2010, 10:29:48 AM
#1
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 339
Re: 9260 event counter?
The Atmel AT91SAM9260 data sheet does not have a lot information regarding those pins. If the input frequency is really low maybe using one of the GPIO pin can be used as interrupt source and using a kernel module to count the event, kind of a software event counter.
September 06, 2010, 07:35:32 AM
#2
tharold
tharold
Show tharold's last posts.
Show general stats for tharold.
Hero
Posts: 3
Re: 9260 event counter?
For anyone trying to do this, here's how I enabled TC3 (first clock of the second block) as event counter, clocking on TCLK4 (pin 18 on the GESBC9260).
Tell the PMC to power it on:
p = mem(PMC_START + PMC_PCER); *p = (1<<26); /* enable TC3 clock */
Tell the peripheral controller to set up pin 18 as:
p = mem(PIOB_START + PIO_PDR); *p = (1<<17); /* no pio */
p = mem(PIOB_START + PIO_ODR); *p = (1<<17); /* no output */
p = mem(PIOB_START + PIO_PUDR); *p = (1<<17); /* no pullup */
p = mem(PIOB_START + PIO_BSR); *p = (1<<17); /* on periph B */
Set up the counter:
p = mem(0xFFFDC000 + TC_IDR); *p = ~1; /* disable interrupts */
/* 0x6: use XC1; 0x8: falling edge */
p = mem(0xFFFDC000 + TC_CMR); *p = 0x6|0x8;
p = mem(0xFFFDC000 + TC_CCR); *p = 0x5; /* reset counter */
delay(100);
Read counter value:
p = mem(0xFFFDC000 + TC_CV);
printf("%d\n", *p);
Now my problem is I can't seem to reset it to 0, it always resets to some arbitrary value. It's not a big deal though.
Thanks,
-harold
Pages: [
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Announcements
=> General Discussion
=> Programming Tips, Recommendded Readings, etc.
-----------------------------
Peer Support Forums
-----------------------------
=> GESBC-9302
=> GESBC-9260
=> GESBC-9G20
=> GESBC-2440
=> GESBC-9315
Loading...