Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

event counting with netduino


  • Please log in to reply
2 replies to this topic

#1 udicom

udicom

    New Member

  • Members
  • Pip
  • 2 posts

Posted 05 June 2011 - 04:13 PM

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

#2 georgejh

georgejh

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts
  • LocationGlasgow, UK

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

#3 udicom

udicom

    New Member

  • Members
  • Pip
  • 2 posts

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

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.