- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This is a demo project showing 8-bit Sine (or arbitrary shape) wave generation using custom component (WaveGen) and standard PWM. The wave generator is RAM-DMA-PWM bridge transferring 8-bit data from RAM buffer to PWM. The PWM period is set to 255 to match 8-bit incoming data. Sine wave frequency is controlled with high resolution by the DDS32 generator.
The demo project provides examples of 32 and 256 wave points/period. External RC-filtering of the PWM output needed to produce a smooth sine wave. Like with all PWM-generated analog signals, the maximum achievable output frequency is quite limited. The upper frequency for this design is limited by the maximum DDS output frequency (BUS_CLK/2). For example, using 32 samples/period, Fmax = (BUS_CLK/2) / ( 256 x 32) = 2.9 kHz.
Draft version of the WaveGen component is included in the project. The DDS32 component can be found here:
Re: DDS24: 24-bit DDS arbitrary frequency generator component
/odissey1
Figure 1. Sine wave production using RAM-DMA-PWM bridge (WaveGen) and DDS32.
Figure 2. Yellow trace - PWM output at 32 points/period, Cyan trace - WaveGen reference signal.
- Tags:
- community
- component
- custom
- dma
- odissey1
- pwm
- ram-dma-pwm
- sine
- sine generator
- sine wave
- spwm
- wave generator
- wavegen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the sharing.