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

PWM version


  • Please log in to reply
14 replies to this topic

#1 iReplicate

iReplicate

    New Member

  • Members
  • Pip
  • 4 posts

Posted 28 February 2012 - 03:29 PM

So deploy shows Microsoft.SPOT.Hardware.PWM,4.2.0.0 My assembly reference shows C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll Version 4.2.0.1 How do i resolve this? Also Secretlabs.NETMF has a PWM . Which one should I use? Will Cpu.PWMChannel.PWM_0 get the right pin for pwm_0? thx

#2 Dano142

Dano142

    New Member

  • Members
  • Pip
  • 3 posts

Posted 30 June 2012 - 03:15 AM

I'm having the exact same problem, cannot deploy if I'm referencing Microsoft.SPOT.Hardware.PWM v4.2.0.1.

#3 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 30 June 2012 - 07:23 AM

With the 4.2 beta for Netduino Classic/Plus you would need Secretlabs.NETMF.Hardware for the PWM class. best to not reference to Microsoft.SPOT.Hardware.PWM.dll
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#4 Cornelius

Cornelius

    New Member

  • Members
  • Pip
  • 7 posts

Posted 18 August 2012 - 08:52 AM

With the 4.2 beta for Netduino Classic/Plus you would need Secretlabs.NETMF.Hardware for the PWM class. best to not reference to Microsoft.SPOT.Hardware.PWM.dll


Does this apply to the final release of the 4.2 framework as well?
I thought that new PWM and AnalogInput classes are suppose to better... if there is not way to use them, it kind of defeats the purpose :(

#5 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 18 August 2012 - 10:19 AM

have you uninstalled all the previous sdk's and installed the 4.2qfe2 version of the netmf SDK and netduino SDKs? Nak.

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 August 2012 - 11:54 AM

Hi Cornelius,

Does this apply to the final release of the 4.2 framework as well?
I thought that new PWM and AnalogInput classes are suppose to better... if there is not way to use them, it kind of defeats the purpose :(

The final release includes the new AnalogInput and PWM classes by default. If you want to use the legacy ones, you can pull those in by explicitly adding them as references to your project.

Chris

#7 Cornelius

Cornelius

    New Member

  • Members
  • Pip
  • 7 posts

Posted 18 August 2012 - 02:44 PM

Hi Chris,

The final release includes the new AnalogInput and PWM classes by default. If you want to use the legacy ones, you can pull those in by explicitly adding them as references to your project.


I understand that there are two PWM classes one could use in his project, but i'm wondering which is better.

In my current project, i'm trying to build an IR emitter with a 38KHz carrier.
the Netduino PWM class can supply this frequency (SetPulse(26,8) for example) but modulating it is a problem: there is no start/stop, and changing the duration parameter takes too long (about 300us).

My hopes were that the new Microsoft PWM class would react faster or have a start/stop function, but from this post it seems that it is better not to use it.
moreover, it is not clear how to use it - how does the PWM enumaration relate to the Netduino GPIOs.

BTW, if it is not recommended to use the new classes, why were the old ones replaced..? :huh:

Thanks again,
C.

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 August 2012 - 03:32 PM

Hi Cornelius, I would recomend using the new classes. The legacy classes are now wrappers around the new classes...so you'll get the most benefit by using Microsoft.SPOT.Hardware.AnalogInput/PWM instead of SecretLabs.NETMF.Hardware.AnalogInput/PWM. Chris

#9 Cornelius

Cornelius

    New Member

  • Members
  • Pip
  • 7 posts

Posted 18 August 2012 - 03:57 PM

I would recomend using the new classes.


Thanks :)

Do you have any example for working with the new classes?
How does the Cpu.PWMChannel enumaration relate to the GPIO pins of the Netduino?

C.

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 August 2012 - 05:50 PM

Hi Cornelius,

Do you have any example for working with the new classes?
How does the Cpu.PWMChannel enumaration relate to the GPIO pins of the Netduino?

We're working on updates samples for the "Getting Started with Netduino" kit. In the meantime, grab a copy of the Netduino SDK 4.2.0 source from the downloads page...and it will show you how we wrap the new classes inside the legacy classes.

Regarding Cpu.PWMChannel... You can use those, but I'd recommend using "PWMChannels.PWM_PIN_D##" instead. Just like there is a Pins. collection for Cpu.Pin, there is a PWMChannels. collection for Cpu.PWMChannel. There's also an AnalogInputs. collection for the analog input pins.

Chris

#11 Cornelius

Cornelius

    New Member

  • Members
  • Pip
  • 7 posts

Posted 18 August 2012 - 09:21 PM

We're working on updates samples for the "Getting Started with Netduino" kit. In the meantime, grab a copy of the Netduino SDK 4.2.0 source from the downloads page...and it will show you how we wrap the new classes inside the legacy classes.


I'll do that.
Thanks!

#12 SteveE

SteveE

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationMidwest

Posted 19 August 2012 - 04:31 AM

I'll do that.
Thanks!

It will be nice to see a page somewhere that lists the new pin mappings at a glance.

In other words, newcomers, using MF 4.2, wanting to do the simple RGB sample app (10,000 example online), are not going to get this to compile:


PWM red = new PWM(Pins.GPIO_PIN_D0);

And then once they figure out the new form of:


PWM red = new PWM( Cpu.PWMChannel.PWM_0, 10, 50, false);

this will leave the user wondering/guessing what physical pin is Cpu.PWMChannel.PWM_0, is it D0? I could be wrong, but I do not think I have seen one page listed in Google that shows the mapping of PWM_0 to a physical pin.

Of course one can dig through the source, but that's like building an app to print an ASCII chart.

Then after mastering this, the new user can move on to the continuing confusion with the accidental (I hope) misuse of millisec and microsec (us vs. ms) in source code comments. :)



#13 SteveE

SteveE

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationMidwest

Posted 19 August 2012 - 05:51 AM

This article was very informative and somewhat rare info.
http://wiki.tinyclr....x.php?title=PWM

My prediction is that a lot of people (like me initially) will be confused between these two:
Microsoft.SPOT.Hardware.Cpu.PWMChannel.PWM_5 (0 thru 7)
vs.
SecretLabs.NETMF.Hardware.NetduinoPlus.PWMChannels.PWM_PIN_D5 (5, 6, 9, 10)

#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 August 2012 - 12:36 PM

Hi SteveE, It's a bit unfortunate that the built-in Cpu.Pin, Cpu.PWMChannel, and CPU.AnalogChannel classes have built-in enums. When using IO pins, PWM, or AnalogInput...start typing the following and intellisense will point you in the right direction: Pins. PWMChannels. AnalogChannels. All of these will let you select from the header pins labels (A0, D5, etc.) as you mentioned. Chris

#15 karpediemnow

karpediemnow

    New Member

  • Members
  • Pip
  • 4 posts

Posted 29 January 2013 - 06:12 PM

Hi Cornelius, I would recomend using the new classes. The legacy classes are now wrappers around the new classes...so you'll get the most benefit by using Microsoft.SPOT.Hardware.AnalogInput/PWM instead of SecretLabs.NETMF.Hardware.AnalogInput/PWM. Chris

Hi Chis,

i have installed the .net microframework 4.2 (MicroFrameworkSDK_NETMF42_QFE2.msi) and in the Microsoft.SPOT.Hardware.AnalogInput

 class i have only AnalogInput i don't have PWM, why? Regard
Gianpaolo





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.