Main Site Documentation

OutputCompare


#1

I am trying to port a FEZ driver for the ZX-Servo16 servo controller that ran on FEZ Cobra and Panda to run on a Cerbuino Bee.

The driver used the OutputCompare class that was in the GHIElectronics.NETMF.Hardware dll.

If I add a reference to GHIElectronics.NETMF.Hardware, the compiler is unable to resolve the reference, possibly because this dll will not run with 4.2?

I tried adding GHI.Premium.Hardware and using the SignalGenerator class, but this fails also. Possibly because the premium version doesn’t work with Cerbuino?

Any thoughts on implementing OutputCompare in this context?

Thanks,

Michael


#2

@ hvelo - There is a community version of the Cerberus (CerbuinoBee) firmware that implements SignalGenerator. If you would rather not go with a custom firmware, I have also implemented a RLPLite version of SignalGenerator, it is on codeshare, unfortunately I did that for the Hydra so it will not work on the Cerberus family devices, but that would be an option.

I do not know what the ZX-Servo 16 is (probably should google it) but could you not just use PWM rather than SignalGenerator?


#3

Hey Taylor,

I can probably get PWM to work, but I have already coded and tested against the existing ZX Servo 16 driver and it has been working well.

The PWM and PulseCount documentation seems lacking to me. When I go to https://www.ghielectronics.com/docs/18/pwm#325 it is saying to use Microsoft.SPOT.Hardware.PWM. But when I type Microsoft.SPOT.Hardware in the gadgeteer project, there isn’t any PWM class…

Thanks for your help!

Michael


#4

it’s in Microsoft.SPOT.Hardware alright, but the assembly is in it’s own reference that you need to add. Microsoft.SPOT.Hardware.PWM. Add that and you’ll find it.


#5

@ hvelo - If you can go with PWM, it would be better because PWM is handled by an dedicated peripheral so consumes little to no CPU cycles once it is running, SignalGenerator on the other hand is very CPU intensive as it runs tight loops or very frequent interrupt routines on the CPU. Just a thought.

As Brett said, you just need to reference the right assembly and you can use PWM. The interface is quite easy once you get the hang of it.


#6

OK. I see the class now.

Thanks for the guidance on the additional reference.

Will see if I can get it to work!