Timer "Input Capture" ?

Post here first, or if you can't find a relevant section!
User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Timer "Input Capture" ?

Post by RogerClark » Sun Feb 11, 2018 3:03 am

Thanks

I'll look at that other code

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Timer "Input Capture" ?

Post by RogerClark » Sun Feb 11, 2018 10:40 am

I've reverted the commit that added the Input Capture feature as the code I took from this thread as some major problems :-(

stevestrong
Posts: 2043
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: Timer "Input Capture" ?

Post by stevestrong » Sun Feb 11, 2018 2:44 pm

I reworked the input capture mode handling and added two examples:
- input capture + one pulse mode
- PWM mode (using input capture) to measure PWM pulse and period width.

https://github.com/stevstrong/Arduino_S ... de99ba8ac0

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Timer "Input Capture" ?

Post by RogerClark » Sun Feb 11, 2018 8:35 pm

Thanks Steve

I will try your code later today.

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Timer "Input Capture" ?

Post by RogerClark » Mon Feb 12, 2018 7:17 am

Steve

I've manually copied your updated files and your HardwareTimerPWMInput demo worked fine.

I've not tested this copy of your One Pulse demo, but I presume its the same as the one you posted to the forum, so I will test later to confirm its OK

Your files also included my old demo using @konzpcap's code, but I think I will delete it, as its the wrong way to do input capture

I may also modify your One Pulse demo to show you to use an external trigger for to the timer

Then I'll commit the changes back to my repo.

BTW. I presume that you can't do a PR because your repo is too different from mine.

Thanks

Roger

stevestrong
Posts: 2043
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: Timer "Input Capture" ?

Post by stevestrong » Mon Feb 12, 2018 8:23 am

RogerClark wrote:
Mon Feb 12, 2018 7:17 am
BTW. I presume that you can't do a PR because your repo is too different from mine.
Indeed, and because Github is still a mystery for me, I didn't even offer to do a PR. I can do it for individual files on web github, but not for more than one. Sorry.

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Timer "Input Capture" ?

Post by RogerClark » Mon Feb 12, 2018 8:29 am

No worries

It wasn't too many files to copy manually ;-)

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Timer "Input Capture" ?

Post by RogerClark » Tue Feb 13, 2018 8:47 am

OK.

I've pushed the updated files from @stevestrong, which work correctly for Input Capture and OnePulse

Post Reply