9 Replies Latest reply on Nov 25, 2015 10:58 AM by CMata_Intel

    MRAA SPI Write using Mini Breakout

    DavidGS

      I've posted about this issue before, but I didn't have quite as much information as I do now.

       

      My basic question is: Has anyone gotten SPI to function properly using the Mini Breakout board?

       

      What I'm seeing:

       

      If I short MISO to MOSI, I seem to get the right data coming in on MISO as I sent out on MOSI, but of course clock, and chip select, are not involved there.  (See first attachment.)

       

      Once THOSE two are added to the mix, all bets are off. I have hooked this to my logic analyzer, and indeed CS is pulled low, and the clock goes as it is supposed to. (see second attachment)

       

      I know the board I'm talking to does the right thing, because I have been programming that board via SPI successfully for quite some time using a straight FTDI FT232H.

       

      So, what is the problem? I'm using mraa via C (though the javascript MRAA via Node misbehaves as well, just in a different way.

       

      Starting to think using Intel Edison for this project was a major mistake ...

        • 1. Re: MRAA SPI Write using Mini Breakout
          CMata_Intel

          Hi DavidGS,

           

          Which MRAA and image are you using?

          Also, have you tried with different speeds?

          Which shield are you using?

           

          Regards,

          Charlie

          • 2. Re: MRAA SPI Write using Mini Breakout
            DavidGS

            I have been trying different speeds, all to no avail.

             

            It's not a shield you can buy. This is an in-house developed board that speaks standard SPI Mode0, and I can successfully program it via SPI from an FT232H USB dongle.

             

            MRAA version: Version: v0.7.3-27-g0ad7536

            • 3. Re: MRAA SPI Write using Mini Breakout
              TwistedTrasistor

              I feel your pain. And a lot of other people do too.  I started this tread about the same thing:  Has *ANYONE* been able to get SPI bus working on Edison + Arduino board?

               

              It seems that SPI with mraa does not work at all.  It will work if you code it using the Arduino compiler.

               

              If you look at the logic analyzer output you posted, the CS line goes high at the positive edge of the 8 clock cycle.  In Logic1.jpg, it does that in the second byte sent, and in Logic2.jpg, it does it in the first byte sent.

               

              I don't have a logic analyzer, so I would be curious to see that analyzer output if you run the same code having used the Arduino compiler instead of C/C++.

              • 4. Re: MRAA SPI Write using Mini Breakout
                DavidGS

                It's becoming increasingly clear that Edison is not ready for prime time. It's just not fully baked yet. It may get there someday, but the code support, the libraries, and the documentation are just not quite to alpha-level yet. Even the pinouts are a pain. Try hooking a logic analyzer to the mini breakout board for SPI and you'll see what I mean. :-)

                 

                Sadly, I think it's time to pack it in on Edison until Intel gets its act together a bit more so it is fully functional. Without basic things like SPI working, it's just not possible to do much.

                • 5. Re: MRAA SPI Write using Mini Breakout
                  TwistedTrasistor

                  Yup!  I couldn't agree more.  I was really psyched for the Edison.  Small, powerful, easy to use.  But as it is, it's more of a headache.

                   

                  Unfortunately, coding my app with using Arduino, it is slow enough that it is not even worth it.  Performance (using Arduino code) to price ration makes the Edison a huge loser in the list of MCUs for my purposes.  Price wise, I'm better off with a tiny version of the Arduino.

                  • 6. Re: MRAA SPI Write using Mini Breakout
                    CMata_Intel

                    Hi guys,

                     

                    Thank you for letting us know about your results and the issue with SPI. We are aware of this issue and we are working on a fix.

                    • 7. Re: MRAA SPI Write using Mini Breakout
                      KurtE

                      Thanks CMata_Intel,

                       

                      I have probably already been on enough SPI threads so I won't say too much here.

                       

                      I also stopped doing much with the Edison for awhile as I was frustrated with things like SPI... So I started using the Raspberry PI 2 on the Trossen Robotics HR-OS1 project as that was the second option they ship with.  Actually for this project SPI is not used so this is not a stopper issue.  After playing with the RPI2, I ran into issues with the USB/FTDI code talking to the servo controller (Arbotix Pro) which uses an FTDI chip for USB, so I swapped the Edison back in... So far the USB appears to be happier on the Edison.  Oops sorry a little off topic.

                       

                      As for SPI, I have noticed several commits up on the Edison Linux github: https://github.com/01org/edison-linux/commits/edison-3.10.17

                      That have to do with SPI, including things like DMA and the like.  As I mentioned in another thread, I wish that either there was a documented set of steps for us to use to build an image based on what is up on github and/or some place where you upload an image based on what is up there.  Preferably before you do an official release.  i.e something like what the Arduino group does with their nightly builds, or what PJRC (Teensy) does where he will release beta releases of a new release, such that hopefully the user community will find any new major regressions before the release is official.

                      • 8. Re: MRAA SPI Write using Mini Breakout
                        DavidGS

                        Any updates on getting SPI to function on the Edison??

                        • 9. Re: MRAA SPI Write using Mini Breakout
                          CMata_Intel

                          Hi DavidGS,

                           

                          We are still working on this; l we hope to have updates soon. In the meantime please be patient.

                           

                          Regards,

                          Charlie