5 Replies Latest reply on Jan 27, 2016 7:55 AM by DiegoV_Intel

    Connecting RGB LED matrix to Edison

    M-Soliman

      Hi, I have two RGB Matrix 16x32 and I want to connect then to Edison, How would I? (Hardware wiring / Software Libraries)?

       

       

      Thanks

        • 1. Re: Connecting RGB LED matrix to Edison
          DiegoV_Intel

          Hello M-Soliman,


          If you are using the Arduino Expansion Board I recommend you to take a look at the following tutorials:

           

           

          There is a library to use the matrix in the tutorials above, but it is Arduino UNO compatible only. Anyhow, if you understand how the matrix works by reading the tutorials above I'm sure you could check the library provided and write a new one based on it to be used with Edison.

           

          I hope you find this information useful.

           

          Regards,

          Diego.

          1 of 1 people found this helpful
          • 2. Re: Connecting RGB LED matrix to Edison
            M-Soliman

            Hi Diego,

             

            Thank you so much for your help, I'm using the mini breakout, will it work?

             

            Thank you again,

            • 3. Re: Connecting RGB LED matrix to Edison
              DiegoV_Intel

              Hi M-Soliman,

               

              The implementation would be different because it's a different board but the principles are the same. If you use the Mini-Breakout Board you will need to use a logic level converter because the Edison's IOs use 1.8V logic while the LED matrix uses 5V. Besides the logic level translator the wiring would be similar, however the Mini-Breakout Board has another footprint so you would have to choose which IOs to use in order to interface the LED matrix. I recommend you to check the Hardware Guide of the Mini-Breakout Board to know which pins you can use: Intel® Edison Breakout Board Hardware Guide for Boards and Kits

               

              The programming part would be the same. I recommend you to full understand how the matrix works and check the Arduino library provided for the matrix. Based on that library you can program your own code to use the matrix. You have different options: Python, JavaScript, C/C++. The MRAA library might be useful to control the GPIOs of the Mini-Breakout Board. Check the following sites for additional details about the MRAA library with the Mini-Breakout Board:

               

              Regards,

              Diego.

              1 of 1 people found this helpful
              • 4. Re: Connecting RGB LED matrix to Edison
                M-Soliman

                Hi Diego,

                 

                I'm sorry I didn't reply you earlier, as I was trying to order the bi-logic converter, but, I got Arduino breakout board and I have managed to go through the links that you posted,

                but, the Arduino code won't run it gives me errors in Intel's code as below

                 

                Arduino: 1.6.5 (Mac OS X), Board: "Intel® Edison"

                 

                 

                In file included from /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/variants/edison_fab_c/variant.h:27:0,

                                 from /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/Arduino.h:33,

                                 from /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.h:2,

                                 from /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:36:

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp: In member function 'void RGBmatrixPanel::init(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, boolean, uint8_t)':

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:112:15: note: in expansion of macro 'digitalPinToBitMask'

                   sclkpin   = digitalPinToBitMask(sclk);

                               ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:131:53: error: 'PinDescription' has no member named 'pPort'

                #define digitalPinToPort(P)  ( g_APinDescription[P].pPort )

                                                                     ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:134:38: note: in definition of macro 'portOutputRegister'

                #define portOutputRegister(port) ( &(port->PIO_ODSR) )

                                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:113:34: note: in expansion of macro 'digitalPinToPort'

                   latport   = portOutputRegister(digitalPinToPort(latch));

                                                  ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:114:15: note: in expansion of macro 'digitalPinToBitMask'

                   latpin    = digitalPinToBitMask(latch);

                               ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:131:53: error: 'PinDescription' has no member named 'pPort'

                #define digitalPinToPort(P)  ( g_APinDescription[P].pPort )

                                                                     ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:134:38: note: in definition of macro 'portOutputRegister'

                #define portOutputRegister(port) ( &(port->PIO_ODSR) )

                                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:115:34: note: in expansion of macro 'digitalPinToPort'

                   oeport    = portOutputRegister(digitalPinToPort(oe));

                                                  ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:116:15: note: in expansion of macro 'digitalPinToBitMask'

                   oepin     = digitalPinToBitMask(oe);

                               ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:131:53: error: 'PinDescription' has no member named 'pPort'

                #define digitalPinToPort(P)  ( g_APinDescription[P].pPort )

                                                                     ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:134:38: note: in definition of macro 'portOutputRegister'

                #define portOutputRegister(port) ( &(port->PIO_ODSR) )

                                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:117:34: note: in expansion of macro 'digitalPinToPort'

                   addraport = portOutputRegister(digitalPinToPort(a));

                                                  ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:118:15: note: in expansion of macro 'digitalPinToBitMask'

                   addrapin  = digitalPinToBitMask(a);

                               ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:131:53: error: 'PinDescription' has no member named 'pPort'

                #define digitalPinToPort(P)  ( g_APinDescription[P].pPort )

                                                                     ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:134:38: note: in definition of macro 'portOutputRegister'

                #define portOutputRegister(port) ( &(port->PIO_ODSR) )

                                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:119:34: note: in expansion of macro 'digitalPinToPort'

                   addrbport = portOutputRegister(digitalPinToPort(b));

                                                  ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:120:15: note: in expansion of macro 'digitalPinToBitMask'

                   addrbpin  = digitalPinToBitMask(b);

                               ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:131:53: error: 'PinDescription' has no member named 'pPort'

                #define digitalPinToPort(P)  ( g_APinDescription[P].pPort )

                                                                     ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:134:38: note: in definition of macro 'portOutputRegister'

                #define portOutputRegister(port) ( &(port->PIO_ODSR) )

                                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:121:34: note: in expansion of macro 'digitalPinToPort'

                   addrcport = portOutputRegister(digitalPinToPort(c));

                                                  ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:122:15: note: in expansion of macro 'digitalPinToBitMask'

                   addrcpin  = digitalPinToBitMask(c);

                               ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp: In constructor 'RGBmatrixPanel::RGBmatrixPanel(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, boolean, uint8_t)':

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:131:53: error: 'PinDescription' has no member named 'pPort'

                #define digitalPinToPort(P)  ( g_APinDescription[P].pPort )

                                                                     ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:134:38: note: in definition of macro 'portOutputRegister'

                #define portOutputRegister(port) ( &(port->PIO_ODSR) )

                                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:148:34: note: in expansion of macro 'digitalPinToPort'

                   addrdport = portOutputRegister(digitalPinToPort(d));

                                                  ^

                /Users/MAG/Library/Arduino15/packages/Intel/hardware/i686/1.6.2+1.0/cores/arduino/wiring_digital.h:132:56: error: 'PinDescription' has no member named 'ulPin'

                #define digitalPinToBitMask(P)  ( g_APinDescription[P].ulPin )

                                                                        ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:149:15: note: in expansion of macro 'digitalPinToBitMask'

                   addrdpin  = digitalPinToBitMask(d);

                               ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp: In member function 'void RGBmatrixPanel::begin()':

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:73:19: error: 'PORTB' was not declared in this scope

                  #define SCLKPORT PORTB

                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:159:28: note: in expansion of macro 'SCLKPORT'

                   pinMode(_sclk , OUTPUT); SCLKPORT   &= ~sclkpin;  // Low

                                            ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:72:19: error: 'DDRD' was not declared in this scope

                  #define DATADIR  DDRD

                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:171:3: note: in expansion of macro 'DATADIR'

                   DATADIR  = B11111100;

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:71:19: error: 'PORTD' was not declared in this scope

                  #define DATAPORT PORTD

                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:172:3: note: in expansion of macro 'DATAPORT'

                   DATAPORT = 0;

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:175:3: error: 'TCCR1A' was not declared in this scope

                   TCCR1A  = _BV(WGM11); // Mode 14 (fast PWM), OC1A off

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:175:17: error: 'WGM11' was not declared in this scope

                   TCCR1A  = _BV(WGM11); // Mode 14 (fast PWM), OC1A off

                                 ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:175:22: error: '_BV' was not declared in this scope

                   TCCR1A  = _BV(WGM11); // Mode 14 (fast PWM), OC1A off

                                      ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:176:3: error: 'TCCR1B' was not declared in this scope

                   TCCR1B  = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // Mode 14, no prescale

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:176:17: error: 'WGM13' was not declared in this scope

                   TCCR1B  = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // Mode 14, no prescale

                                 ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:176:30: error: 'WGM12' was not declared in this scope

                   TCCR1B  = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // Mode 14, no prescale

                                              ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:176:43: error: 'CS10' was not declared in this scope

                   TCCR1B  = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // Mode 14, no prescale

                                                           ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:177:3: error: 'ICR1' was not declared in this scope

                   ICR1    = 100;

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:178:3: error: 'TIMSK1' was not declared in this scope

                   TIMSK1 |= _BV(TOIE1); // Enable Timer1 interrupt

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:178:17: error: 'TOIE1' was not declared in this scope

                   TIMSK1 |= _BV(TOIE1); // Enable Timer1 interrupt

                                 ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:179:7: error: 'sei' was not declared in this scope

                   sei();                // Enable global interrupts

                       ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp: In member function 'virtual void RGBmatrixPanel::drawPixel(int16_t, int16_t, uint16_t)':

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:277:14: error: 'swap' was not declared in this scope

                     swap(x, y);

                              ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp: At global scope:

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:401:4: error: expected constructor, destructor, or type conversion before '(' token

                ISR(TIMER1_OVF_vect, ISR_BLOCK) { // ISR_BLOCK important -- see notes later

                    ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp: In member function 'void RGBmatrixPanel::updateDisplay()':

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:504:3: error: 'ICR1' was not declared in this scope

                   ICR1      = duration; // Set interval for next interrupt

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:505:3: error: 'TCNT1' was not declared in this scope

                   TCNT1     = 0;        // Restart interrupt timer

                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:73:19: error: 'PORTB' was not declared in this scope

                  #define SCLKPORT PORTB

                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:517:10: note: in expansion of macro 'SCLKPORT'

                   tock = SCLKPORT;

                          ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:71:19: error: 'PORTD' was not declared in this scope

                  #define DATAPORT PORTD

                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:535:35: note: in expansion of macro 'DATAPORT'

                          [data] "I" (_SFR_IO_ADDR(DATAPORT)), \

                                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:541:5: note: in expansion of macro 'pew'

                     pew pew pew pew pew pew pew pew

                     ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:535:43: error: '_SFR_IO_ADDR' was not declared in this scope

                          [data] "I" (_SFR_IO_ADDR(DATAPORT)), \

                                                           ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:541:5: note: in expansion of macro 'pew'

                     pew pew pew pew pew pew pew pew

                     ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:71:19: error: 'PORTD' was not declared in this scope

                  #define DATAPORT PORTD

                                   ^

                /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel/RGBmatrixPanel.cpp:567:7: note: in expansion of macro 'DATAPORT'

                       DATAPORT =

                       ^

                Multiple libraries were found for "RGBmatrixPanel.h"

                Used: /Users/MAG/Documents/Arduino/libraries/RGB-matrix-Panel

                Not used: /Users/MAG/Documents/Arduino/libraries/LedPanel

                Error compiling.

                 

                 

                  This report would have more information with

                  "Show verbose output during compilation"

                  enabled in File > Preferences.

                 

                 

                So, what do you think, should I re-write the RGB matrix code, I think that's crazy effort or is there a faster way?

                 

                Thank you for your continuous support,

                • 5. Re: Connecting RGB LED matrix to Edison
                  DiegoV_Intel

                  Hi M-Soliman,

                   

                  The errors above are due to architecture differences. The code is based on the AVR architecture. Since the Edison has a different architecture there are registers that don't exist so the code won't compile.

                   

                  I'd recommend you to re-write the code. I know that it represents a huge effort but I'm afraid there isn't another way. You could search for another library that is Edison compatible but I'm not sure if there is such library and it might take more time looking for the library than re-writing the Arduino one.

                   

                  I'd suggest you to try to write a new library, that way you will learn a lot about how a RGB LED matrix works and if you use the Arduino library as a reference maybe it won't be that hard.

                   

                  Regards,

                  Diego