element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#060 – PSoC 4 Mini-Billboard
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 13 replies
  • Subscribers 29 subscribers
  • Views 2657 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#060 – PSoC 4 Mini-Billboard

cy.wbz
cy.wbz over 12 years ago

Hello!

 

Today’s example was talked about in the Processing post we released earlier this week. We are going to use Processing to generate an image on a 16x32 RGB LED matrix board. We use a Processing GUI to load the desired image onto the PSoC 4 device to display on the LED Matrix board.

 


image

 

Forum Post Attachments:

 

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

  • Example Project Zip File
  • Processing Example
  • 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:

  • UART
  • LED Matrix Datapath Component (custom)
  • Control Register
  • Annotated Component for the Pioneer Board (custom)
  • Pin Helper Component (custom)
  • CyClock
  • CyPin
  • ISR

 

Firmware Description:

 

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

 

In this example we provide a new custom component to drive and control the LED Matrix. This component was implemented on the UDBs of the PSoC 4 to handle the timing-sensitive sensitive and tedious portions of the designs. You will see the ‘LED Matrix’ component in the example. This component .h and .c files are included in the project. This component supports the following APIs to write to the PSoC 4:

 

void DrawPixel(uint8 x, uint8 y, RGB c, color *matrix)

void ClearPixel(uint8 x, uint8 y, color *matrix)

void ClearScreen(color *matrix)

 

In this example we are receiving data over the PSoC 5LP USB-UART bridge from the PC Processing application. We then take that data and display it out on the LED Matrix Panel. This project supports a 5-bit color image at a refresh rate of 360 Hz.

 

Here is a rough flow of the project when in operation:

  • The Component clocks out 32 RGB values to the 2 planes of the panel.
  • It then latches the data, enables the LED driver, and triggers a ‘done’ signal.
  • An ISR fires on the ‘done’ signal, and this increments the row, writes new RGB data to the Component (FIFOs) from a buffer, and handles the Binary Code Modulation (BCM) for color control
  • In main code, the buffer for the image to be drawn on the panel is modified (when necessary). This is done when the UART sends new data to be drawn. Previous 3 steps go on endlessly.

 

The other half of this example uses the Processing IDE to generate an application that transmits the ICON image down to the Pioneer board. The code for the Processing example is provided below.

 

image

 

You will need to ensure that the Processing application is selecting the correct COM port created by your computer for the Pioneer USB-UART capabilities. Also you will need to enter in the correct image in your script.

 

You will see in the images for the kit example that we have put some paper over the LED Matrix. This is due to the brightness of the LEDs. When you are working on the example it’s easier to save your eyes to put a little diffuser over the LEDs when testing.

 

Hardware Connections:

 

In this example we use an Arduino Breadboard shield to perform all of the wiring between the LED Matrix board and the Pioneer kit. In this example we use an RGB LED Matrix Panel from Adafruit to generate all of our images. The panel is a 16x32 RGB LED panel that uses a serial addressing scheme to light up the LEDs.

 


image

 

Adafruit supplies a tutorial page on the LED matrix panel. We suggest you reviewing this page to see how the panel works and how to interface the panel to the PSoC.

The Adafruit web site has a tutorial on connecting and wiring up the panel to an Arduino kit. You can follow the same instructions to connect the panel to the Pioneer board.

 

image

 

The above header can be summarized in the following table:


Pin name

Description

R1, G1, B1

R, G, B value for a pixel in plane 1

R2, G2, B2

R, G, B value for a pixel in plane 1

A, B, C

3-bit row address

OE

Output Enable (active low)

LAT

Latch (active low)

CLK

Clock

GND (4 pins)

Ground

 

The panel can be thought of as 2 ‘planes’, each with 8 rows. The RGB color in the 8 rows of plane 1 are controlled using (R1, G1, B1) and likewise for plane 2. The 8 rows are addressed using the (A, B, C) lines. Columns are accessed by clocking out values (serial interface of sorts); i.e. after one clock you are at column 1, after 31 clocks, you are at column 31.

 

image

 

We also connect the UART pins between the PSoC 4 and the PSoC 5LP device to enable the USB-UART bridge capabilities. Connect two wires between the Pioneer Arduino headers and the PSoC 5LP headers.

 

PSoC 4 P4[1] -> P5LP P12[6]

PSoC 4 P4[0] -> P5LP P12[7]

 

Test Your Project:

 

Connect your hardware and program the Pioneer kit with the target firmware. Start up the Processing script and load in your image. Download that image to the Pioneer board for display on the LED Matrix board. The following image is a set of the logs images and their output on the LED Matrix.

 


image

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
RGB_LED_Matrix.COMMENTED2.zip
5756.Project Images.zip
ProcessingExamples RGB LED Matrix.zip
  • Sign in to reply
  • Cancel
Parents
  • sebi1991
    sebi1991 over 11 years ago

         Hello Matt. It is work very well, congratulation. I want some advises, please help me if you can, how to write some text on the matrix panel(i try with printf but doesn't work) and how to do some animation ,it is possible to do this without processing application ?

         I tried to import libraries from adafruit learning system(RGBMatrixPanel library and Adafruit_GFX library)  but i don't have succes(it is possible to use c++ code on psoc microcontroller? (I have same model of psoc ,cy8ckit-042) .

          Thank you very much.

     

    Best regards,

    Sebastian Rosca

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • sebi1991
    sebi1991 over 11 years ago

         Hello Matt. It is work very well, congratulation. I want some advises, please help me if you can, how to write some text on the matrix panel(i try with printf but doesn't work) and how to do some animation ,it is possible to do this without processing application ?

         I tried to import libraries from adafruit learning system(RGBMatrixPanel library and Adafruit_GFX library)  but i don't have succes(it is possible to use c++ code on psoc microcontroller? (I have same model of psoc ,cy8ckit-042) .

          Thank you very much.

     

    Best regards,

    Sebastian Rosca

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 11 years ago in reply to sebi1991

    Hello Sebastian,

    I am going to port this library over to psoc over the next couple of weeks. Heres the link https://github.com/El-Man/GlowTime. I changing LED_Matrix.c and LED_Matrix.h.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    Hey Elman,

    I really like how you have taken this project and developed on it.

    The Github code looks good.


    Let me know you progress with it!
    All the best!

     

    @Sebastian - were you able to solve your problem?

     

    Antonio

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • sebi1991
    sebi1991 over 11 years ago in reply to Former Member

    Thank you for your  help, I am student and i had exams and i can't respond .

    I want to know , if i must to change the wiring on  the prototype shield  for the new configuration (I saw that the pins are reconfigured and it don't match) . I ask that because I glued the wires on the board .

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube