Let's make the dice of seven eyes using on PSoC 4 with a proximity sensor and DMA

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

cross mob
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi all,

Through this dice, I was able to learn various PSoC designs. In the past, UDB implemented counters and decoders, but I tried this part is implemented by DMA. The data value is transferred to GPIO for LED lighting by DMA and blinks.

 

Please see past posts for more information on electronic dice.
"
PSoC 4 Seven Eyes Dice"
PSoC 4 Seven Eyes Dice with sound
Let's make the dice of seven eyes on PSoC 4 with sound - version 2

The environment used is as follows:

PSoC Creator 4.3

CY8CKIT-044

Since PSoC 4 cannot represent multiple offset transfers with one DMA, we used three DMAs. The transfer image of DMA is as follows. 

The circuit is as following:

10.png

The DMA component settings are all the same.

12.png

The circuit is as following:

11.png

The program adds the data for the transfer and the initial settings for DMA.

:

uint32 Data1[6]={0x0007,0x0007,0x0007,0x0003,0x0003,0x0003};

uint32 Data2[6]={0x000D,0x0007,0x0005,0x0007,0x0005,0x0002};

uint32 Data3[6]={0x0003,0x0001,0x0001,0x0000,0x0000,0x0000};

int main(void)

{

        /* Proximity sensor state. */

       uint8 proximity  = INACTIVE;

   

    CyGlobalIntEnable; /* Enable global interrupts. */

        /* Enable and start the CapSense block. */

       CapSense_Start();

       /* Initialize the baselines of all CapSense widgets. */

       CapSense_InitializeSensorBaseline(CapSense_PROXIMITYSENSOR__PROX);

       /* Enable and start PWM block. */

    PWM_2_Start();

    DMA_1_Start(Data1,(void *)0x40040000);

    DMA_2_Start(Data2,(void *)0x40040100);

    DMA_3_Start(Data3,(void *)0x40040300);

    for(;;)

    {

       :

       :

The dice rolls when you hold your hand over the proximity sensor, and the dice slowly rolls when you move it away, and then stops.

Thanks,

Kenshow

1 Reply
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Kenshow-san,

Thank you for sharing your example project with the community.

Best regards,
Hari

0 Likes