Content originally posted in LPCWare by rsg on Tue May 31 13:37:48 MST 2016
Ugh! All I want to do is configure the SCT peripheral to count rising edges of a tach signal that is input on a pin. I would like to read the count periodically to determine the RPM of a motor. I don't need all these states and transitions! As is often the case with fancy peripherals, it seems the simplest uses get no documentation!
So far, this is the extent of my code; the count never seems to change. Any help would be greatly appreciated!
Ugh! All I want to do is configure the SCT peripheral to count rising edges of a tach signal that is input on a pin. I would like to read the count periodically to determine the RPM of a motor. I don't need all these states and transitions! As is often the case with fancy peripherals, it seems the simplest uses get no documentation!
So far, this is the extent of my code; the count never seems to change. Any help would be greatly appreciated!
// enable clock to and reset peripheral |
Quote: rsg
I don't need all these states and transitions!
If you say so. Then you have my deep respect, because you obviously plan to use some fancy modwrap-math to calculate the speed totally asynchronous from the difference of the counts c1,c2 at two different times t1,t2, determined by some hardware timer 'T'.
v = scale*(c1-c2) / (t1-t2)
But wait...what are you planning to use as timer 'T' ? Don't say, the SCT! Because then it's no longer the 'simplest use' you're after ;-)
(And for all other timers, I want to see your modwrap math, really! 0:)
Marc