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.
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; } } }}
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
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.
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
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?
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.
[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]