EHS5 PWM to drive a buzzer - Frequency Selection - AT^SWDAC | Telit Cinterion IoT Developer Community
May 21, 2014 - 8:13pm, 4518 views
The AT command AT^SWDAC allows the EHS5 to produce a PWM wave on GPIO6 or GPIO7.
The command only provides a limited selection of 6 frequencies as follows:
0 400 Hz (accuracy of 1 percentage step)
1 1000 Hz (accuracy of 3 percentage steps)
2 8,125 Hz (accuracy of 1 percentage step)
3 16,250 Hz (accuracy of 1 percentage step)
4 32,500 Hz (accuracy of 1 percentage step)
5 65,000 Hz (accuracy of 2 percentage steps)
For my application, I write short "songs" from a series of different notes (defined by frequency and time). I use a slew of different frequencies to do this and my current microcontroller allows me to do so. It is possible to recreate this application using the PWM onboard the EHS5?
For example I pulse a piezo buzzer as follows to play a short song:
playsong{
2500 Hz for 100 ms
delay 100 ms
6000 Hz for 100 ms
delay 100 ms
5000 Hz for 100 ms
delay 100 ms
}
Thanks!
Hi Jedrzej
We're looking at an application using the PWM on the EHS6. Are you able to point me at the Java API to drive the PWM? The AT command interfact from Java is a bit clunky and slow so the Java API would be valuable.
Thanks
Brett
Hello,
Please see com.cinterion.io.DAC class in the provided API.
Regards,
Bartłomiej