EMX upgrade to 4.3 - piezo is silent

Hello guys,
I have upgraded my EMX dev board from .NET MF 4.2 to .NET 4.3 with latest GHI libraries and now I see that


is not supported anymore. So my question is, how can I make the piezo on my dev board works again. Is there a way to use PWM on IO10? IO10 is not marked as PWM in the pinout documentation :-(

Please use the signal generator feature.

1 Like

SignalGenerator docs, in case you’re not familiar with the feature:

https://www.ghielectronics.com/docs/24/signal-generator

3 Likes

Thanks for suggestion,
I’m playing with signal generator for some time but I’m still not able to achieve same behavior as with Utility.Piezo()

I used Utility.Piezo(1000, 50) for button press for example.

Now I’m trying to achieve this by:


uint time = (uint)((1.0 / item.Frequency) * 1000000);
int count = (int)(item.Duration * 1000 / time);

uint[] test = new uint[count];

for (int i = 0; i < count; i++)
{
    test[i] = time;
}

sg.Set(true, test, 0, test.Length);


But the result is far from previous behavior. I’ve also tried SetBlocking function, result is better, but everything becomes very laggy. Connecting it to PWM would be the solution but we cannot change our board design :frowning:

Another option is to use rlp to access the compare feature to generate sounds. You maybe able to even do it using register class. Either way, you need to processor manual and couple days of work.

One final option is to have GHI make the rlp for you through our consulting services.

Unless there is a specific reason to go to 4.3, then stay with 4.2.

@ Marten - When you say it the sound is far from the previous is that in terms of the frequency?

If so, that would be because your timing calculation is not correct, you need to half the calculated time to achieve the target frequency with a 50% duty cycle ie. each cycle is high half the time and low the other half.

Remember your will need to adjust your “count” calculation as well when you correct the “time” calculation.