I use
HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, sinArray[m]);
for produce SinWave
and the sinArray is setting by
for(int i=0;i<360;i++){
sinArray[i]=(2047*sin((i*3.14)/180))+2047;
}
but the Analog wave is clipping why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 10:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 10:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 11:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 11:36 AM
yes
I have been enabled it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 11:45 AM
Learn embedded debugging.
Put a breakpoint in your loop, view the dac register, write 0x0fff and check on your scope first. Then if it look ok, watch your sintable values. Last, check errata sheet as sanity check. DAC usually has hardcoded sawtooth waves for testing. Normal wave gemeration uses dma cycling through a buffer, the dac being triggered by a timer pwm which tells the sample out tempo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-27 11:47 AM
And make sure the dac pin is only going to the scope probe to factor out vdda and protection diods.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-11-28 02:58 AM
thank you I disable buffer and problem has been solved!
@Community member​