Hydra pwm issue

Hi all,

I’m start using FEZ Hydra with SDK 4.3, Visual studio express 2012 and
Loader (TinyBooter) version information: 4.3.6.0 on this device.
Firmware (TinyCLR) version information: 4.3.7.10 on this device.

When I use them as digital output port, it works.
I’ve try to use pwm_0 and pwm_1 (socket 3), but scope shows 0.2V continuous (as before configure pin in digital outputport)

namespace TestPwm03
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            Debug.Print("Program Started");
            Mainboard.SetDebugLED(true);
            Thread.Sleep(300);
            Mainboard.SetDebugLED(false);

            OutputPort OutAvant;
            PWM ArrierePWM;

            OutAvant = new OutputPort(GHI.Pins.FEZHydra.Socket3.Pin4, false);  
            ArrierePWM = new PWM(Cpu.PWMChannel.PWM_0, 5000, 0.5, false);    // pin 3
            Thread.Sleep(200);

            //ArrierePWM.Frequency = 50000;
            ArrierePWM.Start();
                        
            OutAvant.Write(true);
            Thread.Sleep(500);
            OutAvant.Write(false);
        }
    }
}

I’ve tried other frequency and duty cycle…
In program above, the small flash on debug led and socket3.pin4 are working, but nothing occurs on pin 3 for pwm…
If I invert config outputport (on pin 3) and PWM (on pin 4), the problem is still on pwm configured pin.
I forget something…

Thanks a lot,
Arnaud.

socket 3 is marked as an SY socket, not a P socket. Socket 7 is the only marked P socket. According to GHI.Pins in the current 2015 R1 SDK, Socket 7 has PWM7, PWM8, and PWM9 on it.

Hello Brett,
Thanks a lot, sorry for dummy’s error. Now it’s working.
I’ll read and check documents…

1 Like

Hello,
I’d need some additionnal precision, if possible.
I’ve check quick socket reference and gadgeteer socket type, I understand pwm on type P socket…

But Why does “PWM0” and “PWM1” appear on Hydra schematics socket 3? I check with scope, there is no link with pwm pin of socket 7 type P.
PB8/PWM0 is just an unperfect detail, or it has a hidden meaning ?

Thanks and have a nice week-end.

Arnaud.

in the GHI.Pins there are no other PWM mappings - the P socket is the one you want. Just because an alternate function is documented on the chip does not mean it’s implemented - and all this doesn’t mean that there aren’t any other PWM pins available; just that they aren’t made accessible through what would normally be the best reference source (GHI.Pins reference)