Difference between revisions of "F19: M&B (Morph & Blend)"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Objective)
(Hardware Design)
Line 275: Line 275:
  
 
=== Hardware Design ===
 
=== Hardware Design ===
Discuss your hardware design here. Show detailed schematics, and the interface here.
+
The hardware design of the 32x64 RGB LED matrix panel which is the most important part of the project, uses four data lines namely A,B,C and D which can be addressed and used to control each LED which has following technical specifications:
 +
 
 +
Parameters:
 +
*2048 RGB LEDs
 +
*1/16 Scan Rate
 +
*IDC Connector for Daisy Chaining
 +
*5V Supply Voltage
 +
 
 +
 
 +
 
 +
{|
 +
|[[File:RGB_LED_Matrix_Panel_-_32x64.jpg|550px|left|thumb|LED Matrix]]
 +
|
 +
|
 +
|[[File:LED Backpanel.jpg|400px|left|thumb|LED Backpanel]]
 +
|
 +
|}
 +
 
 +
 
 +
The figure and table below shows the pin-out of RGB LED matrix with description.
 +
[[File:Panel.png | 450px | thumb | left| '''For Interface of RGB LED matrix with LPC''']]
 +
{| class="wikitable"
 +
|-
 +
! scope="col"| Label
 +
! scope="col"| Name
 +
! scope="col"| Function
 +
|-
 +
! scope="row"| 1
 +
| R1
 +
| High R data
 +
|-
 +
! scope="row"| 2
 +
| G1
 +
| High G data
 +
|-
 +
! scope="row"| 3
 +
| B1
 +
| High B data
 +
|-
 +
! scope="row"| 4
 +
| R2
 +
| Low R data
 +
|-
 +
! scope="row"| 5
 +
| G2
 +
| Low G data
 +
|-
 +
! scope="row"| 6
 +
| B2
 +
| Low B data
 +
|-
 +
! scope="row"| 7
 +
| A
 +
| A line selection
 +
|-
 +
! scope="row"| 8
 +
| B
 +
| B line selection
 +
|-
 +
! scope="row"| 9
 +
| C
 +
| C line selection
 +
|-
 +
! scope="row"| 10
 +
| D
 +
| D line selection
 +
|-
 +
 
 +
! scope="row"| 11
 +
| CLK
 +
| CLOCK
 +
|-
 +
! scope="row"| 12
 +
| LAT
 +
| LATCH
 +
|-
 +
! scope="row"| 13
 +
| OE
 +
| Output Enable
 +
|-
 +
! scope="row"| 14
 +
| GND
 +
| GND
 +
|}
 +
 
 +
===='''LED Matrix Control'''====
 +
The LED panel contains 1024 RGB LEDs arranged in a matrix of 32 rows and 32 columns. Each RGB LED contains separate red, green, and blue LED chips assembled together in a single package. The display is subdivided horizontally into two parts, the top half and bottom half consists of 32 columns and 16 rows respectively.
 +
 
 +
There are different drivers for controlling display’s columns and another set of drivers for controlling rows. To illuminate an LED, the drivers for both the column and the row for that LED must be turned on. To change the color of an LED, the red, green, and blue chips in each LED package are controlled individually and have their own column drivers.
 +
 
 +
<center>
 +
<table>
 +
<tr>
 +
<td>
 +
[[File:Block4.png|600px|thumb|right|LED Matrix]]
 +
</td>
 +
<td>
 +
</td>
 +
<td>
 +
</td>
 +
</tr>
 +
</table>
 +
</center>
 +
 
 +
 
 +
The panel contains six sets of column drivers; three for the top half of the display and three for the bottom. Each driver has 32 outputs. The three drivers for the top of the display drive the red, green, and blue chips in each of the 32 columns of LEDs in rows 0 to 15 of the panel. The three drivers for the bottom of the display drive the red, green, and blue chips in each of the 32 columns of LEDs in rows 16 to 31 of the panel. The red, green, and blue column drivers for the top half of the display are attached respectively to the R0, G0, and B0 data inputs. The red, green, and blue column drivers for the bottom half of the display are attached respectively to the R1, G1, and B1 data inputs. All six of the 32-bit drivers share common SCLK, LATCH, and BLANK signals.
 +
 
 +
The display is multiplexed and has a 1/16th duty cycle. This means that no more than one row out of the 16 in the top half of the display and one row out of the 16 in the bottom half of the display are ever illuminated at once. Furthermore, an LED can only be on or off. If both the row and column for an LED are turned on, the LED will be illuminated; otherwise, the LED will be off.
 +
To display an image, the entire LED panel must be scanned fast enough so that it appears to display a continuous image without flickering. To display different colors and different brightness levels, the brightness of the red, green, and blue LED chips within each LED package must be adjusted by varying the amount of time that each LED chip is on or off within a single refresh cycle.
  
 
=== Hardware Interface ===
 
=== Hardware Interface ===

Revision as of 12:00, 18 December 2019

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

M&B (Morph & Blend)

Abstract

M&B is a unique and fast auto-runner defined by color. The game demands good reflexes to jump and blend in with the approaching obstacles to keep moving forward. The player is required to control his cube-like character that moves to the right, left and forward directions to make long jumps and change color in accordance with these obstacles. Instead of the usual jumping over the barriers and pits, the player has to adapt to them by dynamically changing the character’s color before landing on the platform. SJTwo board will be used to implement the game logic, control the RGB matrix and the joysticks/switches. The RGB matrix will be used to display the real-time game statistics such as the player name and their score. The game ends if the player lands on the wrong colored platform.

Objectives & Introduction

Objective

The objective of this project is to develop a simple, single-player 2D game using LPC174078 microcontroller on an LED matrix display. It focuses on integrating the micro-controller peripheral drivers, led drivers, mp3 player, button controller interface and the application software in FreeRTOS.The button controller interface consists of the button controls for changing color, to control the player's movement and to reset the game. The mp3 player is used to play the game background music.

There are four components in this project:

  • The Display : A 3X64 LED Display Matrix acts as the display of the game.
  • The Controller : The SJ Two Board computes the random obstacle generation and handles the movement and color blend of the player from the button control interface and transfers the information to the display using the GPIO pins.
  • The Button Control Interface : The push buttons on the PCB designed for the game control, interfaced with the game reads the inputs given by the user and relays to the SJ One board to control the player.
  • The MP3 music player : The game background music is played from the mp3 player and relayed to the SJ-Two board using the SPI bus.

Introduction

The Project consists of three main modules:

Console Module: It consists of accelerometer on SJ one board. Calibrated board orientation and switch pressed status is sent to the Display Module via Wireless Module.

Display Module: It is responsible for controlling 32*32 LED Matrix and Piezo buzzer interfaced to SJ One Board.

Wireless Module: This establishes communication between Display and Console module.

About the game

  • Player should collect the eggs into the basket which are shot from the canon.
  • Press switch on the console (SJOne board) to start the game.
  • Tilt the console left or right to move the basket.
  • Collect the eggs falling of randomly.
  • Avoid red objects, if caught Game Over, else continue to collect eggs till the end of level.
  • 6 eggs need to be caught to progress to next level.
  • Yellow egg is a freebee where the basket expands to help the player.
  • Level 2 and 3 has rising water level on each egg miss which increases the difficulty of the game.
  • Player can play and pause the game anytime and resume from where he paused.


Team Members & Responsibilities

  • Ryan Will
    • PCB design
    • MP3 implementation
    • Testing
  • Shreeya Mahadevaswamy
    • LED Matrix driver
    • Game Logic- Obstacle
    • Game control configuration
    • Scoreboard
    • Testing
  • Shanmathi Saravanan
    • LED Matrix driver
    • Game Logic- Autorunner
    • Game control configuration
    • Testing
    • Scoreboard

Schedule

Github Project

Week Date Task Status Completion Date
1 10/10/2019
  • Submission of Project Proposal
  • Completed
  • 10/10/2019
2 10/15/2019
  • Research for Required Components.
  • Submit Schedule and Components List.
  • Completed
  • 10/20/2019
3 10/22/2019
  • Ordering components
  • Familiarize with LED Matrix Datasheet.
  • Completed
  • 11/5/2019
4 10/5/2019
  • Develop Drivers for hardware components.
  • Completed
  • 11/15/2019
5 11/16/2019
  • MP3 implementation
  • In progress
  • -/-/2019
6 11/16/2019
  • 64x32 LED matrix Implementation
  • Completed
  • 11/19/2019
7 11/19/2019
  • Develop Algorithm Design for Game Logic
  • Autorunner and Obstacle generation
  • Completed
  • 11/26/2019
8 11/26/2019
  • Game control configuration
  • TODO
  • -/-/2019
9 12/3/2019
  • Integration of subsystems
  • TODO
  • -/-/2019
10 12/10/2019
  • Final bug fixes and troubleshooting.
  • TODO
  • -/-/2019
11 12/17/2019
  • Complete wiki report and final demo.
  • TODO
  • -/-/2019

Bill of Materials (General Parts)

PART NAME

PART MODEL & SOURCE

QUANTITY

COST (USD)

  • SJTwo Boards
Purchased from Preet Kang
2
50.00
  • LED Matrix 32x64
Sparkfun [1]
1
64.99
  • Switches
Amazon [2]
6
7.00
  • DC Barrel Jack Adapter - Female
https://www.amazon.com/Chanzon-Female-Connector-Security-Adapter/dp/B079RCNNCK/ref=sr_1_4?keywords=DC+Barrel+Jack+Adapter+-+Female&qid=1574052181&sr=8-4
1
5.75
  • Power supply
Sparkfun 5V / 4A Power Supply
1
12.95


Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

The hardware design of the 32x64 RGB LED matrix panel which is the most important part of the project, uses four data lines namely A,B,C and D which can be addressed and used to control each LED which has following technical specifications:

Parameters:

  • 2048 RGB LEDs
  • 1/16 Scan Rate
  • IDC Connector for Daisy Chaining
  • 5V Supply Voltage


LED Backpanel


The figure and table below shows the pin-out of RGB LED matrix with description.

For Interface of RGB LED matrix with LPC
Label Name Function
1 R1 High R data
2 G1 High G data
3 B1 High B data
4 R2 Low R data
5 G2 Low G data
6 B2 Low B data
7 A A line selection
8 B B line selection
9 C C line selection
10 D D line selection
11 CLK CLOCK
12 LAT LATCH
13 OE Output Enable
14 GND GND

LED Matrix Control

The LED panel contains 1024 RGB LEDs arranged in a matrix of 32 rows and 32 columns. Each RGB LED contains separate red, green, and blue LED chips assembled together in a single package. The display is subdivided horizontally into two parts, the top half and bottom half consists of 32 columns and 16 rows respectively.

There are different drivers for controlling display’s columns and another set of drivers for controlling rows. To illuminate an LED, the drivers for both the column and the row for that LED must be turned on. To change the color of an LED, the red, green, and blue chips in each LED package are controlled individually and have their own column drivers.

LED Matrix


The panel contains six sets of column drivers; three for the top half of the display and three for the bottom. Each driver has 32 outputs. The three drivers for the top of the display drive the red, green, and blue chips in each of the 32 columns of LEDs in rows 0 to 15 of the panel. The three drivers for the bottom of the display drive the red, green, and blue chips in each of the 32 columns of LEDs in rows 16 to 31 of the panel. The red, green, and blue column drivers for the top half of the display are attached respectively to the R0, G0, and B0 data inputs. The red, green, and blue column drivers for the bottom half of the display are attached respectively to the R1, G1, and B1 data inputs. All six of the 32-bit drivers share common SCLK, LATCH, and BLANK signals.

The display is multiplexed and has a 1/16th duty cycle. This means that no more than one row out of the 16 in the top half of the display and one row out of the 16 in the bottom half of the display are ever illuminated at once. Furthermore, an LED can only be on or off. If both the row and column for an LED are turned on, the LED will be illuminated; otherwise, the LED will be off. To display an image, the entire LED panel must be scanned fast enough so that it appears to display a continuous image without flickering. To display different colors and different brightness levels, the brightness of the red, green, and blue LED chips within each LED package must be adjusted by varying the amount of time that each LED chip is on or off within a single refresh cycle.

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.

Software Design

Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.

Implementation

This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

<Bug/issue name>

Discuss the issue and resolution.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.