2 Replies Latest reply on Jun 24, 2013 1:46 PM by cy.wbz

    PSoC 4 Pioneer Kit Community Project#037 – PSoC With Friends! Word Scramble Game

    cy.wbz

      Hello!

       

      This project demonstrates interfacing an I2C EEPROM chip to the PSoC 4 device to backup data. A 5 letter word scramble game has been developed as an example. The game saves and retrieves the scores and the used words. The data is retained on power off and power on conditions using the I2C EEPROM.

       

      001 - Schematic View.png

      002 - Project Image 1.png

       

      Forum Post Attachments:

       

      At the bottom of this post we are including the following items:

      • Example Project Zip File
      • Zip File of Images
        • Project Schematic
        • Component Configurations

       

      Components Used:

       

      The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

      • SPI
      • I2C
      • CapSense
      • CyPins
      • ISR

       

      The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.

       

      Firmware Description:

       

      The main.c firmware is included in the example project. Please review the commented sections for more details.

       

      This project demonstrates a 5 letter word scramble game with an I2C EEPROM interfaced to the PSoC 4. The game ends when the user has unscrambled 10 random words that have been displayed. The user can save the game scores, power down the device and continue the game when it powers back up.

       

      This game uses the CapSense Slider as an interface for the GLCD. While the CapSense slider has 5 segments only 3 of the segments are used in this example. Each segment is used as a standalone button instead of a slider. The two ouside buttons are used for scrolling up or down. The center element is used to make a selection. You will use these buttons to select the letters for the word scramble.

       

      If you wish to save your game press SW2 and the game status and data will be saved to the EEPROM.

       

      When powering up the kit, you will be asked if you would like to continue from a saved game or start a new game. You will be able to use the CapSense buttons to make that selection.

       

      Hardware Connections:

       

      In this example you will need to have the Pioneer board connected to the protoshield and the GLCD shield. In this example we used the sparkfun GLCD and protoshields. On the protoshield we mounted the I2C EEPROM 23LC128 device. The following is a schematic of the EEPROM wiring.

       

      003 - Project Image 2.png

       

      004 - Schematic Layout.png

       

      Test Your Project:

       

      Program your kit and then follow the instructions on the screen to play the word scramble game.

       

      I hope this example can help you in your design.

       

      Best,

      Matt