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

cross mob
Komugiz_King
Level 2
Level 2
5 replies posted First like received 5 questions asked

Capture d’écran (73).png

Hello everyone,

I'd like to discuss a modification I'm currently working on for the CY8C6347BZI-BLD53 board, using the example code CE220924. This code utilizes the VDAC and DMA components to generate a sinusoidal signal. My goal is to adapt this code to produce a signal with a custom frequency.

To achieve this, I need to generate a new Look-Up Table (LUT) for each frequency and adjust the number of sampling points accordingly. My intention is to modify the "Number of data elements of transfer" parameter for the DMA and then initiate the signal generation process. Here's the code in question:

 

 

#define DATACNT (100)
cy_stc_dma_descriptor_t descriptor = {0};

descriptor = *Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL);

Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); // Valid range is 1 to 256.
descriptor.src=(void *)sineWaveLUT_5;
descriptor.dst = (void *)&(CTDAC0->CTDAC_VAL_NXT);
Cy_DMA_Descriptor_DeInit(&descriptor);
Cy_DMA_Channel_Enable(DMA_HW, 1);
DMA_Start(descriptor.src, descriptor.dst);

 

 

 

In this code, I first retrieve the current descriptor, then modify the "Number of data elements of transfer" parameter for the DMA. Finally, I initiate and start the DMA. However, I sense there might be errors or improvements needed in this code. I would greatly appreciate your advice on how to correct this part of the code.

Thank you in advance for your valuable assistance. Your suggestions will be highly appreciated.

#CY8C6347BZI-BLD53

0 Likes
2 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

HI @Komugiz_King 

Can you please send the console error message while trying to build this code in PSoC Creator?

Thanks and Regards.
Leo

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @Komugiz_King 

Thread was locked due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards,
Leo

0 Likes