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

Combining Pins


  • Please log in to reply
5 replies to this topic

#1 Rage9532

Rage9532

    New Member

  • Members
  • Pip
  • 3 posts

Posted 13 September 2011 - 06:54 PM

Hi guys! This is my first post here. I'm am very new to micros and electronics, so please excuse if this is a light-weight question. :) I've been playing around with a N+ for the last week and find it pretty easy to do just about anything at a pin-level in code, with each pin being individually addressable. But, what if you want to treat a block of pins as a single unit? I believe the ATMegas call this a PORT. Each pin maps to a single bit in a value written to the PORT making it very easy to change the values of multiple pins with a single write operation. I haven't seen anything similar in the .NETMF or N+ SDKs. Is there some equivalent that I'm missing?? I know, I could easily write an emulation of this myself, but what I'm looking to do is save all the CPU cycles by avoiding the bit-shifting over a byte. Great litle product! I'm already looking forward to 4.2.

#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 13 September 2011 - 07:20 PM

Welcome to the community!

But, what if you want to treat a block of pins as a single unit? I believe the ATMegas call this a PORT.

Unfortunately, the current version of .NET Micro Framework does not expose any class to access group of pins or the I/O port directly. You'd need to use for example Corey Kosak's SimpleNGen-enabled custom firmware, or implement it using native interop. The Netduino microcontroller has two 32-bit general purpose I/O ports, but only partially broken out (*) - there are two separate groups of 4 consecutive pins available (PWM0 - PWM3 and Analog In 0 - Analog In 3), so you'd need some bit manipulation anyway.

(*) To be compatible with Arduino

#3 Rage9532

Rage9532

    New Member

  • Members
  • Pip
  • 3 posts

Posted 13 September 2011 - 08:18 PM

Welcome to the community!


Unfortunately, the current version of .NET Micro Framework does not expose any class to access group of pins or the I/O port directly. You'd need to use for example Corey Kosak's SimpleNGen-enabled custom firmware, or implement it using native interop. The Netduino microcontroller has two 32-bit general purpose I/O ports, but only partially broken out (*) - there are two separate groups of 4 consecutive pins available (PWM0 - PWM3 and Analog In 0 - Analog In 3), so you'd need some bit manipulation anyway.

(*) To be compatible with Arduino



I've taught myself a lot in the last couple of weeks, but I haven't gotten that far, yet. ;)

Thanks!

#4 Mike P

Mike P

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAuckland, New Zealand

Posted 14 September 2011 - 12:30 AM

NETMF may not have a built in class but GHI have implemented a parallelPort class for their products on NETMF.
I wonder if this could be ported into the Netduino firmware? They also have an outputCompare class that looks pretty useful.
http://www.ghielectr...tion/Index.html

Oh well...

#5 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 14 September 2011 - 06:08 AM

I wonder if this could be ported into the Netduino firmware?

Yes, it could be ported. I made Register class some time ago, which can be used for direct I/O port access too.

#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 14 September 2011 - 06:57 AM

The only problem is that Rage9532 owns a Netduino Plus, and he won't able to compile any native driver (unless he purchases a RVDS license). In other words: it is not possible!
Biggest fault of Netduino? It runs by electricity.




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.