Arduino Due Timer problem

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

Hello,

 

I have trouble with starting a timer and I wanted to ask you for help. I'm using the Arduino Due(sam3x8e) and have connected and external temperature sensor to pin 2 (PIOB25) which I have multiplexed to TIOA. I know I have the temperature sensor pulse configured correctly since I have checked with an oscillioscope.

 

Here is the relevant code I'm using:

https://pastebin.com/x2TMA4L0

 

I want the timer to be in capture mode and trigger on falling and rising edges, generated from the temperature sensor, but so far it doesn't work.

It doesn't seem to start and I never seem to get into the TC0_Handler().

 

I want to use Timer_clock1 and according to the attached picture, I figure that I should use channel 1.

 

When I read the TC Status Register, the clock started bit is still 0. This is a problem I thought that maybe I'm using the wrong channels or the clock cannot start with the current config.

 

I've been stuck with this for hours and I would greatly appreciated your help and insight.

 

Thanks in advance,

Attachment(s): 

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

For specific help on how to use the SAM3X timers, you may be better asking in the SAM forum ...

 

EDIT

 

You do realise that you can embed code & images in your post? See: http://www.avrfreaks.net/comment...

 

 

EDIT 2

 

Putting your thread title into google gives

 

http://forum.arduino.cc/index.ph... - which links to a, "Timer Library fully implemented for Arduino DUE"

 

https://arduino.stackexchange.com/questions/34926/problem-with-timer-in-arduino-due

Last Edited: Tue. Jan 9, 2018 - 09:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, I'll post there instead.

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

Be sure to post a link here so that people can follow the discussion!

 

Did you check out that library?