Hello everybody,
I am quite new to netduino and are trying to make use of the build in counters.
What I want do do is counting rising edges on an digital in, preferably with two cascading 16 bit counters (32 bit total).
I trried to find samples for netduino and/or arduino but was nit successful.
My basic understanding is, first step would be to program the pio controller to map an general purpose signal to the
counter input. Can this be done with any of the 20 wired signals of the netduino board ?
Thanks for any help!
Bernhard
event counting with netduino
Started by udicom, Jun 05 2011 04:13 PM
2 replies to this topic
#1
Posted 05 June 2011 - 04:13 PM
#2
Posted 06 June 2011 - 11:52 AM
Have a look into Third example of this tutorial. You can configure as many pins you want to any of the edges.
It depends is the counters are separate or combined. If counters are separate you can reuse same code to increment them, but if they are shared (like all them increase same variable) then you have to perform some locking on the variable to prevent data corruption.
If you still have problems message me so I will try to put down some example for you
It depends is the counters are separate or combined. If counters are separate you can reuse same code to increment them, but if they are shared (like all them increase same variable) then you have to perform some locking on the variable to prevent data corruption.
If you still have problems message me so I will try to put down some example for you
#3
Posted 21 June 2011 - 12:04 PM
Thank you for this post! I'll check it out and come back to you in case I have more questions.
Have a look into Third example of this tutorial. You can configure as many pins you want to any of the edges.
It depends is the counters are separate or combined. If counters are separate you can reuse same code to increment them, but if they are shared (like all them increase same variable) then you have to perform some locking on the variable to prevent data corruption.
If you still have problems message me so I will try to put down some example for you
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users