cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

HaLi_1053816
New Contributor

I order a 4100ps prototype board, The DMA does not work? Maybe it does not support dma now? I try with "RAM-DMA-IDAC_P4M_01-000.cywrk_.Archive01.zip" example.

0 Likes
1 Solution
DineshbabuM_66
Employee

Hi,

Attached is the DMA code example for PSoC 4100PS device.  This example generates sine wave using VDAC.  DMA is used to transfer LUT values from flash to VDAC input data register.

Thanks,

Dinesh

View solution in original post

5 Replies
AnkitaS_51
Employee

PSoC 4100PS supports 8 channel DMA

0 Likes
DineshbabuM_66
Employee

Hi,

Attached is the DMA code example for PSoC 4100PS device.  This example generates sine wave using VDAC.  DMA is used to transfer LUT values from flash to VDAC input data register.

Thanks,

Dinesh

View solution in original post

HaLi_1053816
New Contributor

Hello Dinesh,

Thank you for your fast respond.

I use DMA driver IDAC, It seem need 32 bit for every new IDAC value.

    uint32 Buffer1[128];

    uint32 newRegisterValue;

    newRegisterValue = IDAC7_1_IDAC_CONTROL_REG & ~IDAC7_1_CURRENT_VALUE_MASK;

    for (uint32 i=0; i<128; i++){

    Buffer1 = newRegisterValue |((i << IDAC7_1_CURRENT_VALUE_POS) & IDAC7_1_CURRENT_VALUE_MASK);

    }

    DMA_Start((uint32 *)Buffer1,(uint32 *)IDAC7_1_IDAC_CONTROL_PTR);   

    DMA_SetNumDataElements(0,128); 

Can I use one byte to change idac value wihe dma?

Than a lot.

Haixian

0 Likes
DineshbabuM_66
Employee

Hi Haixian,

To transfer data size of one byte, following changes are required in the DMA Component.

Data Element Size : Byte

Source and Destination Transfer Width : Byte to Word

Enable the option "Increment source address by one"

Note:  Keep byte as your array data type

This will transfer the current value from memory to LSB of Register as required by the value field of IDAC current setting register.

Thanks,

Dinesh

0 Likes
HaLi_1053816
New Contributor

I have try CE223693 example, it's work great. Thank you for fast support.

0 Likes