Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Logic PD support staff and engineers participate, Logic PD does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Logic PD engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Logic PD product download, please subscribe to the TDG Forum of interest.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Jun 2019 04:39 PM by  Pratik Saripalli
Accessing SPI on DM37xx dev board - Linux
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Pratik Saripalli
New Member
New Member
Posts:4


--
11 Jun 2019 05:44 PM

    I am new to the platform and I am a little overwhelmed by the documents and I am having trouble getting my spi sensor to work.

    I'm running Linux 12.04 on the Torpedo with BSP 2.4-4.

    have been using spi-test as a base to try to understand and connect to my sensor. Initially i could not get spi-test to run the Acitivity board on SPI3 so I changed the dev to "spidev1.1" so that is would work on SPI1 and connect the SPI_CS1 for the chip select. I am then trying to modify the code address to read on a single register on the sensor and I cannot seem to get it to work.  Any suggestions on where/how I modify the code to get it to work?

    Thanks

    Adam Ford
    Advanced Member
    Advanced Member
    Posts:773


    --
    12 Jun 2019 06:20 AM
    The Torpedo baseboard has a built-in EEPROM on SPI1, CS0 You should be able to run the spi-test app referencing that and it will write 'Hello World' to the EEPROM and read it back.

    DM-37x# spi-test /dev/spidev1.0
    Opening "/dev/spidev1.0" for SPI communication
    [ 3626.853302] omap_device: omap2_mcspi.1: new worst case activate latency 0: 24
    4140
    Status is: 0x00
    Sending write enable
    Done sending write enable
    Status is: 0x02
    0x00000000 : ff ff ff ff ff ff ff ff |........|
    0x00000008 : ff ff ff ff ff ff ff ff |........|
    0x00000010 : ff ff ff ff |....|
    Writing "Hello world!"
    0x00000000 : 48 65 6c 6c 6f 20 77 6f |Hello wo|
    0x00000008 : 72 6c 64 21 |rld!|
    SPI EEPROM Read/Write test successfull!

    You may want to connect an oscilloscope to the CS1 pin to make sure that pin is toggling. If the CS1 pin doesn't go low, there might be a pin mux issue or something else going on. If you're connecting the sensor to the Torpedo baseboard, it would be J32, pin 11.

    adam
    Pratik Saripalli
    New Member
    New Member
    Posts:4


    --
    13 Jun 2019 05:29 PM

    The CS1 pin is toggling when I run the test code and my code with dev1.1. For some reason when I try to run my code, I get a return value of 3.

    I tried checking the clocking mode it seems to be in mode 3 because the polarity is definitly high and I am pretty sure the phase is secondary. Here is a link to the characterization. I am not exactly sure how to proceed. I want to try testing with this code to test settings but ltib does not want to build. i only get a 679 error.

    Any suggestions on how to proceed?

     

     

    Pratik Saripalli
    New Member
    New Member
    Posts:4


    --
    13 Jun 2019 05:29 PM

    The CS1 pin is toggling when I run the test code and my code with dev1.1. For some reason when I try to run my code, I get a return value of 3.

    I tried checking the clocking mode it seems to be in mode 3 because the polarity is definitly high and I am pretty sure the phase is secondary. Here is a link to the characterization. I am not exactly sure how to proceed. I want to try testing with this code to test settings but ltib does not want to build. i only get a 679 error.

    Any suggestions on how to proceed?

     

     

    Pratik Saripalli
    New Member
    New Member
    Posts:4


    --
    14 Jun 2019 04:39 PM

    I managed to get  spidev_test.c to work and I am getting unusual results. I run it and I am getting wildy different results with different modes.

    with mode 0 i get :

    00 FF 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00

    mode 1:

    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00

    mode 2:

    00 00 7F 80 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00

    mode 3:

    00 FF 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00 00 00 00 00
    00 00

    I am not sure what is going wrong here. any suggestions would be appreciated.

     

    You are not authorized to post a reply.