Raspberry PI, Windows 10 and SPI Debugging with the Tektronix MDO3054

Поделиться
HTML-код
  • Опубликовано: 25 июл 2015
  • In the previous video • Raspberry PI 2, Ti DAC... we looked at using windows 10 for IOT on a Raspberry PI2 to control a Texas Instruments DAC8734 Quad Digital to Analog convertor using the SPI bus.
    While I was designing the software and figuring out how to use the DAC with the PI, I ran into a few issues that required me to debug the SPI interface of the PI and for this I reached out to my Tektronix MDO3054 Oscilloscope with its SPI decoder software.
    This allowed me to quickly resolve the issues and get back to developing my test application on the PI for the DAC.
    As other viewers may fing the adventure interesting I recorded the findings and reviewed what the issue was and this forms the basis of this video.
    I hope you find it interesting and informative. If you dont have ne of these scopes, A Salae or other SPI / logic Analyzer would also be very helpful. Also a simple 2 channel scope could be used fo the diagnosis and in this video, many of the shots of the scope use are not even using the decoder software and are infact refering to the relationship between the edges of the clock and the MOSI line.
    The resultant issue was I was using SPI mode 0 (Had worked OK for many TI chips in the past so I assumed it would work for this one... ya I know, read the manual!. I had to use Mode 1.
    I also show all 4 modes of the signal and have posted many details on the Element 14 community site and will be doing the same on my web site soon.
    The E14 link to all the videos is here:- www.element14.com/community/co...
    and includes the software source code, feel free to use it and if you find bugs, please let me know.
  • НаукаНаука

Комментарии • 4

  • @mrlazda
    @mrlazda 9 лет назад

    Another great educational video.
    There is one little thing that need to be mentioned that even Raspberry PI is running on GHz clock that not mean that GPIO clock is in that range, GHz clock is only clock used by core, peripheral clocks are different (ARM use multiple AHB and APB peripheral clocks) and in datasheet for BCM2835 (Raspberry PI not V2) state that maximum operating frequency of the General Purpose clocks is ~125 MHz at 1.2V and clock is selectable.
    But even with that limitation and taking in account it run Windows, SPI interface should work much faster than it is shown in this video (this remind me on early 90 and time of DOS and W3.1 andt that joke how to from your new I486 to make XT, just in DOS type win)

    • @TheBreadboardca
      @TheBreadboardca  9 лет назад

      Miloš Lazović I understand that the SPI clock is not the CPU clock, the point I was making is not a slow clock, the clock speed was actually OK and will go to 50Mhz easily, it is the time after clocking out the data and before getting to the next iteration, there is something wrong there as it should not take that long to release the CS line or get through to outputting the next value. As I mentioned, removing the lowest level call to the Spi.Write allowed a complete 256*255 loop to run in a total of 33mS, a single loop of 255 samples took 44mS when making the call, this is in no way related to only outputting the data stream, as is shown in the timing diagrams. Your point is good to mention though as Im sure some folks did not know that and it helps to clarify, Thanks
      Peter

    • @TheBreadboardca
      @TheBreadboardca  9 лет назад

      Miloš Lazović Oh, and I totally relate to the OLD Dos days and the initial move to a windows based environment, thinks seemed so slow at that time too

    • @mrlazda
      @mrlazda 9 лет назад

      Peter Oakes I expect that Microsoft fix that little issues soon, anyway W10 IoT is new product and it is expected to have some issues, but on other side Raspberry Pi is not personification of speed on GPIO, I didn't try Raspberry Pi 2 but what I try with Raspberry Pi 1 Model B I didn't managed to get toggling GPIO with greater speed than 25 MHz ( I was going so far to try even bare-metal to remove influence of OS and got no significant difference), What i read Raspberry Pi 2 should be near twice faster on GPIO then Raspberry Pi 1 Model B.
      Another point is that ARM Cortex-A are optimized for multimedia/application (mobile phones, tablets, tv boxes ....), on other hand ARM Cortex-M are optimized for microcontrollers and ARM Cortex-R is for real time applications (as I read ARM Cortex-R will be merged in ARM Cortex-M). Microsoft development support ARM Cortex-M in form of .NET Micro Framework which I never try but it look more useful than Arduino (.NET Micro Framework is real development platform contrary to branch of poorly written libraries) so it maybe something interesting you to try (it support STM32 microcontrollers that are dirt cheap and I found them that have great performance/price ratio).