8 Replies Latest reply on Sep 21, 2015 8:17 PM by deisterhold

    Sharp Memory Display

    deisterhold

      I'm trying to interface my Edison to a 2.7" Sharp Memory LCD. I've read the datasheet for programming the LCD and have written a library that bit bangs the SPI communication using the mraa library. For the wire connections from the Edison to the LCD, I'm using a GPIO breakout from Sparkfun then running jumper wires to a development board made by TI. I've attached my code and the library that I've written below. When I attempt to draw on screen I get nothing and was wondering if it was something wrong with my code or with mraa library. If anybody could review my implementation to verify that I'm sending the data correctly I would appreciate it.

       

      Thanks,

           Daniel

        • 1. Re: Sharp Memory Display
          CMata_Intel

          Hi Daniel,

           

          Are you checking the signals in those pins? Are you using 3.3V or 5V? Which MRAA and Image version do you have in the board?

           

          Regards,

          Charlie

          • 2. Re: Sharp Memory Display
            deisterhold

            I don't have an oscilloscope or logic analyzer to check the signals with. I have a cheap multimeter that shows a voltage of about 1.5V when i turn a pin on, but I think that is an error with the multimeter. The GPIO is set to translate to 3.3V, which I have tested and can confirm works on another microcontroller. My mraa version number is 0.7.3 and I recently updated my image to version 2.1. When I attempt to compile the example on mraa: Main Page I get a compilation "undefined reference to 'mraa_get_i2c_bus_count'" which leads me to believe that there is an issue with the mraa library.

            • 3. Re: Sharp Memory Display
              CMata_Intel

              Hi Daniel,

               

              Yes, you should have 3.3V if you have selected that option. I have just ran the same code with the 0.7.3 version and got the same error message. Then, I updated the MRAA library to the 0.7.4 version and I was able to run the example without problems.

              Update the library and let us know if you get better results.

               

              Regards,

              Charlie

              • 4. Re: Sharp Memory Display
                deisterhold

                Ok. I've updated mraa (downloaded and built from source) to 0.7.5. I'm now getting an error linking "multiple definition of `mraa::getSubPlatformIndex(int)`". When I compile I have my "main.cc" that includes "SharpMemory.h" and within my header file I "#include "mraa.hpp". I then compile both my "main.cc" and "SharpMemory.cc" then I link them and include the mraa library with "-l mraa". I can prevent this error if I "#include "SharpMemory.cc" inside of my "main.cc" then just compile and link with mraa. Is this the correct way to be doing this? Or should I be doing this another way?

                • 5. Re: Sharp Memory Display
                  CMata_Intel

                  Hi deisterhold,

                   

                  That looks like a compatibility issue, you could just update the mraa version using opkg. What you can do now is try to link the location of the mraa library using the -I flag: gcc -I option flag (include directory) You should do something like: gcc code.c -o output -I /usr/include/mraa

                   

                  Regards,

                  Charlie

                  • 6. Re: Sharp Memory Display
                    CMata_Intel

                    Hi deisterhold,


                    Do you have updates with this? Were you able to compile and run the code?


                    Regards,

                    Charlie

                    • 7. Re: Sharp Memory Display
                      deisterhold

                      I'm still getting the same error, I've uploaded my Makefile and associated files. I'll try to update mraa when I get a chance.

                       

                      Output from Makefile:

                      g++ -Wall -c -I /usr/include/mraa/ main.cc -o main.cc.o

                      g++ -Wall -c -I /usr/include/mraa/ SharpMemory.cc -o SharpMemory.cc.o

                      g++ -Wall -I /usr/include/mraa/ main.cc.o SharpMemory.cc.o -o sharp -l mraa

                      SharpMemory.cc.o: In function `mraa::getSubPlatformIndex(int)':

                      SharpMemory.cc:(.text+0x0): multiple definition of `mraa::getSubPlatformIndex(int)'

                      main.cc.o:main.cc:(.text+0x0): first defined here

                      collect2: error: ld returned 1 exit status

                      Makefile:19: recipe for target 'sharp' failed

                      make: *** [sharp] Error 1

                       

                      Thanks,

                          Daniel

                      • 8. Re: Sharp Memory Display
                        deisterhold

                        Ok. I've got mraa updated finally and it compiles without any errors.

                        To update libmraa I couldn't get opkg to work so instead I had to do:

                        "wget http://repo.opkg.net/edison/repo/core2-32/libmraa0_0.7.5+git0+effc813e42-r0_core2-32.ipk"

                        then

                        "opkg install libmraa0_0.7.5+git0+effc813e42-r0_core2-32.ipk"

                         

                        And now I don't get the multiple definition error.

                        I will update later if I can successfully control the screen.