Using PWM to generate audio

Hi all,

Does anyone have any experience with using the PWM on a RCM4400w to generate beeps or tones on a small speaker or piezo element? I am using a rotary encoder for scrolling through LCD menus and wanted to produce audible “clicks” for every selection change and other beeps/tones for other events.

Using the programmable PWM would be ideal. Any code examples or suggestions would be much appreciated.

TIA!
thecncguy