A FPGA controlled RGB LED MATRIX for Incredible Effects – the Software

By on February 20, 2017
Pin It

 

A dot matrix RGB LED graphic panel, managed by an FPGA-based controller board presented in a previous post that may be separately used as a demoboard. Let’s see the software and how to use it in practice. Second and final installment.

Composing even big size displays is now easier, and affordable for all budgets. This time, however, this “miracle” (so to say) has not been created thanks to Arduino, or by means of something that is Arduino-based, but via a board that is powered by a powerful FPGA (the Spartan 6 by Xilinx) that we accurately described in the first installment with regard to features  and hardware.

It is now the time, therefore, to analyze the project’s software. In these pages we will see, in fact, how to display fluid writings, animations and anything else your imagination may suggest, on matrix displays that are connected to our LED Matrix board.

 

 

Board configuration

As a first thing, it is needed to correctly configure the board, by going to set (in the FPGA’s memory) the type and the number of RGB LED matrices connected to it.

In order to do it, we have to connect the board to the USB port by keeping the JP1 jumper closed; in this way, the board will be directly powered from the PC. As for the moment, please do not connect the panels, otherwise, their absorption might alter the operation being performed, given that it would lower the 5 volt beyond the limit that ensures a proper functioning of the board.

The FPGA configuration is extremely simple, thanks to a terminal emulation program named RGB Matrix Terminal, that has been expressly written and that is provided with many functions.

 


 

Once it is started, a window will open; while in there you will find, down and on the left, a drop-down menu relating to the available COM ports; then please select the one with which the terminal communicates (the other one is the one used for the streaming and it will be needed in order to communicate with the management software).

 

 

In this regard, we would like to remind you that the integrated circuit that enables the communication between the LED Matrix board and the PC (the FTDI FT2232HL chip) is a USB/TTL double converter; therefore, by connecting the board two virtual COM ports will be created: one of them refers to the control serial connection and enables the management of the firmware loaded in the FPGA; the other virtual COM port is on the other hand used in order to transfer the Jinx software’s data stream at high speed. We will later relate to this software.

Unfortunately, Windows does not enable their immediate identification, therefore it is needed to select one of them and to press Return from the terminal; if we obtained a window as in the figure, we may proceed.

 

 

By using the dialog box that may be accessed from the menu of the FPGA Programmer, we may verify the version of the matrix display’s management firmware (that’s a file named RGB_Matrix_Controller_Vx.xx.bin) and possibly to update it. In order to do so, let’s select a Slot and give it a name, and by means of the button that is a bit more on the right let’s search for the firmware’s file to be loaded in the corresponding position (such files must be in the Bin format).

 

 

By means of the same window, it is also possible to select (via the flag) which one of the loaded firmwares will automatically start when booting the demoboard.

Once the updated firmware has been loaded, we may then set the board.

It is possible to interact with the board by means of the menu bar or by giving commands, typing on the terminal keyboard. The system implements an online Help, that is accessible by means of the Help command, followed by Return: the window lists the available commands, grouped in three macro-categories:

  • Matrix: for the purpose of configuring the connected LED panels;
  • SD-Card Commands: for the purpose of managing the animations’ reproduction from the SD-Card (the SD-Card management is a function that must be enabled by the manufacturer);
  • Miscellaneous: specific commands for the board.

 

 

The most important command in order to start using the board may be found in the first section: that’s the Preset command.

This instruction enables to quickly load the settings for the panels, and also to easily define how they are connected.

By typing the Preset command and by pressing the Tab button you will be able to see the list with the available Presets.

 

 

Let’s see how to use this command, thanks to an example: if you want to connect two 32 x 32 panels of the P6-3232-16S type (cod. RGBLEDPANEL3232) to the board, the preset to be selected is 3. Therefore, by typing the Preset 3 command, the correct values as for Clock, Resolution, Scan Ratio, etc. will be automatically set, and the board will be configured for the management of two 32 x 32 panels connected in cascade (we will later see how to do that).

It is also possible to know the set parameters, by typing Preset and by pressing the Return button.

Once this has been done, you will have to type the Save command, so to make the configuration you just carried out a permanent one.

 

 

The software

There are many software solutions that may be used along with our system, but among all the ones we tested, Jinx stands out because of its greater flexibility, and at the same, it is provided with many functions. This is the program that will deal with translating the visual effects chosen by the user and to send them to the LED panel.

Jinx supports different protocol types and enables to define every detail as for the animation that will then be executed and sent from the USB port to the LED Matrix board.

This software’s last available version is 2.4, at the moment, and may be downloaded from this website.
Once started, Jinx shows a window, that is composed by two side screens that may be mixed together and the result is displayed on the central screen: this is what will be physically shown on our LED matrix.

 

 

The software enables to control modular displays that on the whole count up to 48,000 pixels, that is to say, as many LEDs. Moreover, the Jinx software also integrates 22 different effects, that you may combine together in order to obtain the animation you prefer.

In addition to effects such as Stroboscope, Flame, Plasma, etc. you may also choose peculiar functions, such as the one for displaying a moving text (contained in a .doc or .txt file) and also pictures and videos (gif, avi are supported, as well as the webcam).

Another very interesting possibility is the one to show the screen capture on the display, for example in order to show a video.

For those who understand a bit of programming, Jinx!Script is available: that’s a basic-like coding language, used for the purpose of writing the code of your own custom effects, that are not found in the wide default palette.

Once an animation has been composed, it may be saved and it will be available in the Scenes palette, that has opened – as a default option – when the software starts and that is available by clicking on the button with the same name, in the middle of the working screen.

In order to couple Jinx to our board, it is needed to follow three simple steps:

  • to define the size of our LED panel;
  • to select the connected LED Matrix board;
  • to correctly map the display.

 

Let’s imagine we want to manage a system that is composed of two LED matrices having a size of 32 x 32, and let’s go under Setup -> Matrix Options to select – while in Matrix Dimension – a 64 px width and a 32 px height. We will leave the rest of the settings as the program’s default ones.

 

 

We now have to tell our program where our board is connected; for the purpose, from the Setup menu we will give the Output Devices command, as soon as the dialog box that may be seen in figure opens, we will have to click on the Add button.

 

 

The window that opens will enable us to select the Device Type, that is to say, the communication protocol: we will select Glediator.

 

 

As for the Serial Port/USB Device entry, let’s select the COM created by our PC for sending data to the demoboard, and select an 115,200 communication speed and then click OK. Please close the dialog box with such a command and complete the output device settings.

All that is left is to correctly map the LED matrix, which means to tell Jinx which matrix LEDs to manage. From the program’s main screen, please click on the Setup menu and give the Output Patch command; from the Patch Device drop-down menu in the dialog box that will appear, please select the COM port chosen in the previous passage and then click on the Fast Patch button: the dialog box with the same name will open, in which you will have to insert the size of your panel (in our case, that’s 64 x 32) in the Patch Area section, to confirm the selected COM port, and accept all the other shown settings. After that, please close by clicking on OK.

 

 

At this stage you will have returned to the Output Patch, dialog box, in which you will have to click on Close, so to confirm the chosen settings. You will thus re-enter the Jinx’s main window.

The configuration is now complete. In order to connect the software to the demoboard, and therefore to send the scenes to your matrix display, please access the Setup menu, there you will have to click on the Start Output command.

 

 

Connecting displays

Let’s finish with the building of the display, that concerns the wiring of the boards and their power source.

Let’s suppose we have to create a system composed of a single demoboard and two 32 x 32 LED panels, so to obtain a 64 x 32 LED.

Let’s join the two panels by means of a 20-pole flat-cable, that has been appropriately crimped on the two male connectors (please pay attention to the bearing of the two connectors, that ideally must be crimped by keeping them oriented with the tooth on the same side, otherwise you would invert the connection polarity) and use another flat-cable in order to connect this matrix to the demoboard’s CN4 connector.

 

 

If on the other hand, you wish to connect the maximum number of matrices (that is to say, four) you will have to connect two of them to the CN4 connector, and the other two to the CN5 connector.

As for the power source, every display is supplied with a 5 volt power connector; this one must be connected to the power supply, that must supply 5 volt and the requested current.

Being the case, in order to compose your display with more matrices, you will have to join their power source by connecting them to the +5V Power and GND pins.

Please consider that – on average – a 32 x 16 LED display module absorbs 1.8 ampere when showing a scene that engages all the pixels, such as for example a video with a very bright scene; as regards displays composed of more modules, the current is obtained by multiplying the said value for the number of the modules composing it. In our example, therefore, we would have to expect and consider an absorption of about 15A!

The modular display you will create must be mechanically fixed to a wood or aluminium chassis, capable of bearing the lot; the fixing will be made easier by the fact that the matrices we used have – on the back side – some 3MA metal threaded seats, in which it is possible to fasten some 3 mm screws.

 

Test

Once the board has been connected to the PC and the displays, please power the lot (as a first thing, please remember to open the JP1 jumper, so to separate the USB power and to let the lot to be powered by the 5V power source that you will have used for the system, otherwise you risk damaging the PC’s USB port) and start the Jinx program.

From the latter’s main window, please open the menu of one of the four channels and choose the desired effect; it may be suggestive to see what happens when reproducing a video streaming, or one that is shown on the PC screen.

 

 

For the purpose, please give the Capture Screen command from the menu and click on the Edit button, as soon as a dialog box in which you will be able to set some viewing parameters opens; by clicking on the Select Screen Region button, a window will open: you will have to make it overlap over the screen area to be “framed” (it will be sent to the display…) and to resize it so to cover it all.

You will now have to just click on the screen pertaining to the video and you will see it appear on the display.

In order to obtain a fair visual result – in terms of image resolution – the display must have at least 64 x 64 pixels and if you cover it with a white paper sheet (80÷100 g/m²) or with a white 3 mm plexiglass plate, the viewing will be even more fluid and homogeneous, since the transitions between close pixels will be smoothed. Please carry out different tests, by drawing the sheet (or plate) nearer or farther from the LEDs, and you will see the picture becoming more or less clear; at a certain distance from the display, you won’t almost be able to sense the frame of the shown picture.

Of course, you might also try to open an image file (even in this case, in order to make the viewing more fluid, you may place the usual white paper sheet or the plexiglass plate before the LED matrix) or a text, and make it flow with the usual mode; and even try one of Jinx’s default effects.

Please remember that as for the picture reproduction, or the screen captures or the videos, you may set the background brightness of the matrix display and the color saturation, so to give a greater contrast to the shown pictures.

 

 

Also, there are many other functions, but rather than describing them, we would like to invite you to test them personally, by setting all the different options that are provided by the software and by looking at the produced results: that’s better than what words can do.

Well, with this we finished describing the LED Matrix project.

All that is left is to wish you all the best for your work, and have fun with your modular displays!

 

From openstore

LED Matrix controller RGB

16×32 RGB LED panel

32×32 RGB LED panel

64×32 RGB LED panel

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.

One Comment

  1. Pingback: LED MATRIX: giant & stand-alone panels | Open Electronics

Leave a Reply

Your email address will not be published. Required fields are marked *