Hey everyone,
I’m trying to control 4 motors with the 4 PWM Output Pins on the FEZ Panda II. I read here somewhere that you can use all pwm Pins at the same time but only with the same frequency. My problem is that I can only control one pin at the same time. I have already tried to initialize all 4 of them without any Problem. But when I call the first pwm.set methode the other pwm ports don’t react anymore. Even with the same frequency. Is there a trick or something I do wrong?
Sorry I haven`t been on my computer the last couple days.
This is the code I use at the moment. I can control every individual pwm pin this way. But not all of them at the same time.
can you show us what works and what fails? How did you check that the pins were working? I suspect you are using servos, can you try connecting the same servo to all pins individually and see if the pins are operating?
I have connected all four pwm pins to the ESC of my quadrocopter. When I comment out any three of the four SetPulse methods from the code above one pwm pin works. But as soon as I call more then one SetPulse methods (e.g. pwm1.SetPulse and pwm2.SetPulse) only the first pin (pwm1) will have a signal. I have checked the pins with the ESC and with an oscilloscope. Looks like only one pwm pin works at a time.
OK, thanks for explaining, but no I don’t think this is the correct behaviour. There’s something else going on.
Can you please try some combinations now?
First, confirm each works individually by only including one SetPulse command for different Pins and confirm your ESC will work.
Then, please try by including two pins, and re-order the SetPulse statements, see what happens when you SetPulse for Pin2 before Pin1. In the meantime I’ll see if I can repro this (although I don’t have an ESC or servo close by I can try it on).
Also, can you please check your SDK installs? Please report back what Device Capabilities shows from MFDeploy, and please confirm what SDK you have installed (check the release notes in something like C:\Program Files (x86)\GHI Electronics\GHI NETMF v4.1 SDK… Mine shows USBizi (FEZ Mini, FEZ Domino, FEZ Rhino, FEZ Panda) V 4.1.8.0)
Hey Brett,
thank you for helping me out. Looks like I messed something up. I programmed everything again and updated the firmware to have factory settings. Now it seems to work. Thank you again. I thought my pwm pins were broken.
Hi, i’m just starting to program, i just get a FEZ Panda II and i want to learn how to make PWM ports work, i’ve been trying with some codes that i found in the forum but i can’t make it works, i can’t even setup a PWM port, i got an error that PWM could not be found, maybe a missing assembly reference
I’m using Visual Studio 2013 with .NET MF V4.1, but i had previously installed the 2014 R1 version , also i’m using the next references
using System;
using System.Threading;
using Microsoft.SPOT;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;
To use VS2012 you’d need to install VS2012, then netmf 4.3 RTM SDK, then GHI 2014 R1 package, then the 4.1 GHI SDK. That way you know the combination works.
Then you need to start a new console application, target the correct 4.1 framework version, and add references and USING statements.