Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
SunshineQAQ
Level 4
Level 4
50 replies posted 100 sign-ins First like received

Hi,

I use the XMC4300 development board, DAC_Sina_Wave this routine, I let it output the simplest sine wave, DAC channel one configuration and writing is exactly the same as DAC channel zero, why the output on the oscilloscope is not the same?

SunshineQAQ_0-1694069210911.png

SunshineQAQ_1-1694069217995.png

SunshineQAQ_2-1694069226563.jpeg

Best Regards

 

0 Likes
1 Solution
Owen_Su
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi, 

    I've copied your code and run in my XMC, the result is below:

Owen_Su_0-1694153774350.png

    You should check if you tested the correct pins and check your configuration in the Device Configurator. Hope this can help you.

BR,

Owen

View solution in original post

0 Likes
3 Replies
Owen_Su
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi, 

    The waveform selection of your two DAC are different, refer to the pictures below:

Owen_Su_0-1694078305209.pngOwen_Su_1-1694078327354.png

    Besides, the frequency of your waveform is different(From the picture you shared). Thanks.

BR,

Owen

0 Likes

Hi,Owen,

I have exactly the same configuration here.

SunshineQAQ_0-1694137831262.pngSunshineQAQ_1-1694137847545.png

SunshineQAQ_2-1694137882748.pngSunshineQAQ_3-1694137900910.png

#include "cybsp.h"
#include "cy_utils.h"
#include "cy_retarget_io.h"

/*******************************************************************************
* Defines
*******************************************************************************/

#define TICKS_PER_SECOND (100U) /* Systick ticks per second */
#define SINE_CHANNEL (0U) /*DAC channel for sine output*/
#define STATIC_CHANNEL (1U) /*DAC channel for static output*/

/* Define macro to enable/disable printing of debug messages */
#define ENABLE_XMC_DEBUG_PRINT (0)

 

int main(void)
{
cy_rslt_t result;

/* Initialize the device and board peripherals */
result = cybsp_init();
if (result != CY_RSLT_SUCCESS)
{
CY_ASSERT(0);
}

cy_retarget_io_init(CYBSP_DEBUG_UART_HW);

#if ENABLE_XMC_DEBUG_PRINT
printf("Initialization done\r\n");
#endif
/* System timer configuration */
SysTick_Config(SystemCoreClock / TICKS_PER_SECOND);
while (1)
{
#if ENABLE_XMC_DEBUG_PRINT
if(DAC_updated)
{
if(!loop_entered)
{
printf("DAC Updated\r\n");
loop_entered = true;
}
}
#endif
}
}

void DacUpdate(void)
{
/* Variable to track function call limit */
static uint8_t function_calls = 0,function_calls1 = 0;
/* Index variable to track and update frequency */
static uint8_t index = 0,index1 = 0;


XMC_DAC_CH_SetPatternFrequency(XMC_DAC0, SINE_CHANNEL, 50);

XMC_DAC_CH_SetPatternFrequency(XMC_DAC0, STATIC_CHANNEL, 50);

}

Finally, the oscilloscope output results are as follows.

SunshineQAQ_4-1694138093493.jpeg

Best Regards

0 Likes
Owen_Su
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi, 

    I've copied your code and run in my XMC, the result is below:

Owen_Su_0-1694153774350.png

    You should check if you tested the correct pins and check your configuration in the Device Configurator. Hope this can help you.

BR,

Owen

0 Likes