1 Reply Latest reply on Sep 1, 2020 10:55 PM by AashitaR_11

    Let's make the dice of seven eyes on PSoC 4 for LED test

    NoTa_4591161

      5.pngHi all,

      The electronic dice I posted last time was very popular. Many people have requested that we make on PSoC 4 version, so I made it based on CY8CKIT-044. I have also created a new LED lighting board. This time it is based on Arduino. Before introducing the actual electronic dice program, I will first introduce the program for hardware confirmation. If you make a mistake, it will be difficult to debug, so please use this LED test program as one of the electronic dice courses. Here I make a roulette to check the lighting of each LED.

      1.png

      The environment used is as follows:

      PSoC Creator 4.3

      CY8CKIT-044

       

      The block diagram of the hardware is the same as the 7 eyes dice. In the case of dice, the decoding part is changed and timer control is performed by S/W. This time it's an LED test, so it's for confirming that all the LEDs are lit properly.

      The H/W block diagram is shown below. I will explain in order from the right of the block. The LED part is the Arduino custom board.

      2.png

      The LED parts are connected to the Arduino connector on the kit. The circuit of the connector and LED used is shown below.

      3.png

        4.png

      5.png

      By using the demux component for the counter value, the decoder section can shift the blinking of the LED by one each time it counts up. Since the LED lights up at Low, the output is inverted.

      The counter uses the Basic Counter component and the Digital comparator component in combination. Resetting the counter with a count of 5 represents a Modulo 6 counter.

      The whole circuit is as follows.

      6.png

       

      The timer for period adjustment is PWM. Use HFClk divided by 10 KHz as the clock source. The setting of PWM_1 is as follows.

      7.png

       

      The program is only the start setting of PWM_1.

       

      #include "project.h"
      
      int main(void)
      {
          CyGlobalIntEnable; /* Enable global interrupts. */
      
          /* Place your initialization/startup code here (e.g. MyInst_Start()) */
          PWM_1_Start();
          for(;;)
          {
              /* Place your application code here. */
          }
      }
      
      /* [] END OF FILE */
      

      Run and check everything when the LEDs light up like a roulette wheel shift. If it does not blink or if the operation is strange, check the H/W of your custom board.

       

       

      Thanks,

        Kenshow