[ATSAMD51J18A] Timer/Counter Configuration

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

 

We want to use the counter/timer for triggering A/D conversions. We will load the counter/timer value (in frequency) and it should call the ISR (invoking call back function) for every count(High/low). For example, if we load the counter values as 1000 Hz, 1000 times A/D conversions should be started.

 

Also, we have checked in Atmel start and noticed that we have RTC and TC ( 0 to 5) instances. We are unable to find TC instance supported API in ASF4 API reference manual. We are able to find RTC mode supported API's.

 

Could anyone please advise me how to configure timer/counter for generating an interrupt for every count?

Jana8153

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't understand this: " for every count(High/low). "

 

The Timer driver can use TC0 - TC5 (also RTC and TCC0 - TCC4) when I try a project with ATSAMD51J18A.

/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Lajon wrote:

I don't understand this: " for every count(High/low). "

 

The Timer driver can use TC0 - TC5 (also RTC and TCC0 - TCC4) when I try a project with ATSAMD51J18A.

/Lars

 

Sorry for the above question. We have mentioned our requirement below in detail,

 

We have searched in google and found below example which paritally matches our requirement,

 

https://www.digikey.com/en/videos/m/microchip/atmel-start-sensors-adc-with-timer-callback-visualization-6

 

In that example, they have triggered AD conversion every 100 ms. They have used HAL: Driver:Timer and instance TC0 and length of the tick is 1 ms.

 

If we want to generate interrupt for X counts, can we follow the above example? Please advise us.

 

If it matches our requirement , how we have to configure GCLK_TC, prescaler and length of tick in ms.

 

our requirement : need to generate 100 interrupts per second. what is the interval time i need to give?

 

Jana8153