4 Replies Latest reply on Jul 6, 2015 3:52 PM by JernejH

    Costum interface on Galileo gen 2

    JernejH

      Hello everyone,

       

      In the past couple of days I was trying to connect Colors shield (Colors Shield - Arduino RGB LED Matrix driver shield)  with Intel Galileo gen 2. At first I thought I needed to use I2C communication, but when I read the datasheet for DM163(IC responsible for LED control) I found out is uses some different communication, it is very similar to SPI, but it is only one way. In order to nake communication between galileo work I would need to simultaneously run two GPIO's. One for clock and one for data. Is it possible to do this?

       

       

      My plan is to use python or C. Did anyone try to do something similar?

       

      Any ideas how to solve my problem, if it possible to do it?

       

      Best, Jernej

        • 1. Re: Costum interface on Galileo gen 2
          DiegoV_Intel

          Hi JernejH ,

           

          I've checked the datasheet of the shield and the DM163. It seems that it uses a shift register to store the input data. Check the picture below:

          ShiftRegister.JPG

           

          The S_IN line is the data line and the DCK line in the clock line.  Those lines are mapped to the pins 7 (DCK) and 8 (S_IN) in the shield. In the datasheet of the shield those lines are named differently, SDA for the data line and SCK for the clock line.

           

          According to the datasheets, the input data is transferred at rising edges of SCK. It is not a particular communication protocol like SPI or I2C (in the most primitive concept both are implementations of shift registers); it is just the way a shift register works. If you are not familiar with shift registers, you can check the following link for a brief explanation: Shift register.

           

          To send data to a shift register, you don't have to run two GPIOs simultaneously. You only need to put the data (HIGH or LOW) in the SDA line, and then make a toggle in the SCK line (HIGH -> LOW -> HIGH). The data will be captured by the shift register. Then you have to repeat the process with the new bit data. Check the picture below:

          clk.JPG

           

          You can program this "protocol" manually in your sketch by sending 1 byte in each transfer and it should work. I don't have the shield to test it but I encourage you to do it. Additionally, there is a library provided in the Itead site that you can use to make your own implementation: Colors Shield - Arduino RGB LED Matrix driver shield.

           

          Some time ago, another user had issues with this same shield: colors shield not support?. You posted in that thread by the way. The library pointed by the user is not Galileo compatible because it is written for the AVR architecture (Arduino boards). I can't tell whether or not the shield will work but you can give it a try with the information I wrote above.

           

          I hope this information is useful for you. If you need help with something else, don't hesitate to ask.

           

          Regards,

          Diego.

          • 2. Re: Costum interface on Galileo gen 2
            JernejH

            Hi Diego,

             

            I tried what you said. I wasn't able to change arduino sketch into a working one . Then I used Python to see if it is possible to control a LED screen. I am able to select light on a screen, but am not able to draw any characters or shape on the screen. The problem I am having that I need to implement refreshing on screen, so that only LED I want to see will be visible, not entire line. In hindsight perhaps Python is not the best program to do that.

             

            Cheers, Jernej

            • 3. Re: Costum interface on Galileo gen 2
              DiegoV_Intel

              Hello JernejH,

               

              Unfortunately the library available for Arduino needs to be ported to Galileo in order to use that shield. I don’t have the shield to try making it work but I don't think Python is the problem. The library could be ported to Python or C, but you must know in detail how the shield and the Arduino library work. You could try it, but it is going to be a long task to achieve.

               

              Regards,

              Diego.

              • 4. Re: Costum interface on Galileo gen 2
                JernejH

                Hi Diego,

                 

                shield is relatively easy to understand how it works. The shield uses 8 GPIO which are used for 8 horizontal lines of LED shield. One for each line. DM163 have 8 times 3 channels. Because we use RGB system every vertical line has three 3 control pins one for each color in line. If I want to light only one LED I need to choose and give power to one horizontal line and one vertical at the same time, only one LED will light up.

                 

                Python is by my experience too slow to deal with something that need to be almost done in real time. When running program on Galileo we are in users space, which means our program does not have priority in kernel and python is usually slower than C because python code need more processor time than C. This is the reason I decided not to even try solve this problem in python.

                 

                I started porting code, unfortunately this is my side project and I don't spend as much time as I would want on this, I am slowly trying to write C code. Currently I am stuck, because I don't know how to write timer function for Galileo. Because I haven't found something similar to system tick on Galileo. Perhaps I have wrong understanding of my problem and if anyone has any suggestions for solution I am open for them.

                 

                Cheers, Jernej