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 not working to drivers.. Questions!

ldd meanwell PWM

Best Answer iced98lx, 03 February 2013 - 04:56 AM

Well how embarrassing. 

 

I've been working with pin D5 as my testing bed. Turns out that pin D3, and pin D6, and pin D9 work, but D5 DOES NOT for me.

 

Is this just me?? It's a brand spankin new N+2 upgraded to 4.2.2

Go to the full post


  • Please log in to reply
10 replies to this topic

#1 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 03 February 2013 - 03:48 AM

Ok, so I've stolen Gutworks example PWM setup and am attempting to get it to dim an LDD-700H driver (http://www.meanwell..../LDD-H-spec.pdf spec sheet). 
 

Here is how I have it hooked up:

 

Netduino Plus pin-D5-> PWM IN of LDD-H
Netduino Plus GND - > -V IN of LDD-H (-V of powersupply)

 

I can dim the onboard LED no problem, but not the driver, any suggestions?

 

namespace PWM_Test{    public class Program    {        public static void Main()        {            PWM led1 = new PWM(PWMChannels.PWM_PIN_D5, 100, .5, false); // Set later            led1.Frequency = 100;            led1.DutyCycle = 1;            while (true)            {                double startValue, endValue;                for (startValue = 4.712; startValue < 10.995; startValue = startValue + 0.0005)                {                    endValue = System.Math.Sin(startValue) * .5 + .5;                    led1.DutyCycle = endValue;                }            }        }    }}

 

 

Even a simple test like this doesn't yield dimming:

 

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.Netduino;namespace PWM_Test{    public class Program    {        public static void Main()        {            PWM led1 = new PWM(PWMChannels.PWM_PIN_D5, 100, .5, false); // Set later            led1.Frequency = 900;            led1.DutyCycle = 1;            while (true)            {                led1.DutyCycle = .5;            }        }    }}

 

Thoughts?



#2 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 03 February 2013 - 03:51 AM

I verified the drivers are working, by Grounding the PWM pin to the GND on the Netduino and it turns off (as it should)



#3 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 03 February 2013 - 04:49 AM

Well, if I do this:

 

PWM led1 = new PWM(PWMChannels.PWM_PIN_D3, 500, .5, false);led1.Start();led1.DutyCycle = .05;

It works as expected. BUT I can't get other pins to work yet.. not sure What my issue is.  Obviously it's a me problem lol



#4 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 03 February 2013 - 04:56 AM   Best Answer

Well how embarrassing. 

 

I've been working with pin D5 as my testing bed. Turns out that pin D3, and pin D6, and pin D9 work, but D5 DOES NOT for me.

 

Is this just me?? It's a brand spankin new N+2 upgraded to 4.2.2



#5 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 03 February 2013 - 05:05 AM

if you're curious how it turned out.



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 February 2013 - 06:09 AM

Hi iced98lx,

Is this just me?? It's a brand spankin new N+2 upgraded to 4.2.2

Which version of firmware are you using exactly? 4.2.2.0? 4.2.2.1? 4.2.2.2? I used pin D5 as PWM recently on Netduino Plus 2. If you plug an LED into pin D5 and GND on your Netduino Plus 2, can you blink it using OutputPort? Does PWM work on the LED? Chris

#7 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 03 February 2013 - 04:23 PM

Hi iced98lx,Which version of firmware are you using exactly? 4.2.2.0? 4.2.2.1? 4.2.2.2? I used pin D5 as PWM recently on Netduino Plus 2. If you plug an LED into pin D5 and GND on your Netduino Plus 2, can you blink it using OutputPort? Does PWM work on the LED? Chris

 

 

Hi Chris

 

4.2.2.1 / Jan 26th build

 

I have to dig out an LED to test, but lets put it this way:

 

If I pull the pin out of D6, (which is working properly) and put it in D5, then change my code to say D5 and redeploy, it doesn't work. I am using D0 as a onewire bus if that has an impact. I'll test with an LED later today and get back to you.



#8 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 03 February 2013 - 04:34 PM

Which version of firmware are you using exactly? 4.2.2.0? 4.2.2.1? 4.2.2.2? I used pin D5 as PWM recently on Netduino Plus 2. If you plug an LED into pin D5 and GND on your Netduino Plus 2, can you blink it using OutputPort? Does PWM work on the LED? Chris  

 

Chris,

 

4.2.2.2? Which firmware is this?

 

Chuck



#9 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 03 February 2013 - 10:48 PM

Hi Chris

 

4.2.2.1 / Jan 26th build

 

I have to dig out an LED to test, but lets put it this way:

 

If I pull the pin out of D6, (which is working properly) and put it in D5, then change my code to say D5 and redeploy, it doesn't work. I am using D0 as a onewire bus if that has an impact. I'll test with an LED later today and get back to you.

Hi iced98lx,

 

I'm glad to see you have the PWM working. I'm not aware of any issues with PWM with the 4.2.2.1+ firmware. I've tested it fairly extensively on all pins and it seems to be very stable now. I do recall that in 4.2.2.0, if I had any sort of error on a pin (i.e. out of range frequency) I could use that pin until I reset the Netduino, but I haven't noticed anything similar since then. Also it's advisable that you still use resistors when driving LEDs, even though the NP2 can source up to 25mA per pin. By any chance do you have a Logic Analyzer to test the pin with? Also can you use D5 as an OutputPort to blink an LED? 

 

Steve



#10 iced98lx

iced98lx

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationSouth Dakota

Posted 05 February 2013 - 08:25 PM

Hi iced98lx,

 

I'm glad to see you have the PWM working. I'm not aware of any issues with PWM with the 4.2.2.1+ firmware. I've tested it fairly extensively on all pins and it seems to be very stable now. I do recall that in 4.2.2.0, if I had any sort of error on a pin (i.e. out of range frequency) I could use that pin until I reset the Netduino, but I haven't noticed anything similar since then. Also it's advisable that you still use resistors when driving LEDs, even though the NP2 can source up to 25mA per pin. By any chance do you have a Logic Analyzer to test the pin with? Also can you use D5 as an OutputPort to blink an LED? 

 

Steve

 

Steve, Chris-

     It appears my pin 5 is dead, all together, but more on that later when I can confirm through some better testing equipment. Just as a note, I'm not sourcing any power to "Drive" LED's from the N+2, I'd have much bigger problems considering I'm using 700ma per channel I'm dimming which are requiring 36v. The PWM from the netduino simply tells the driver how to drive the LED, doesn't drive it directly.   I'll try resetting the board, and re-loading with known good configs, but truthfully I haven't passed it any funky parameters AFAIK. Currently the D5 pin doesn't do anything at all. 

 

Cheers.



#11 ButtCrackBob

ButtCrackBob

    New Member

  • Members
  • Pip
  • 1 posts

Posted 13 July 2013 - 07:52 PM

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;background-color:rgb(247,247,247);]Hi iced98lx,[/color]

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;background-color:rgb(247,247,247);]   Did you ever resolve the 5 pin issue? I'm having the same problem with a Netduino plus 2 and a DFRobot motor shield. It drove me crazy. I'm working on my first PWM motor control project and learning PWM coding at the same time. Needless to say I've reflashed my firmware so many times I can do it with my eyes closed. My project a one motor controller, so it wasn't until I ran my code on pin 6 that I discover a problem with my board's 5th pin.[/color]

[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;font-size:12px;background-color:rgb(247,247,247);]Regards, Robert[/color]







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.