Libraries/examples for communicating with X4SIP02

Discussion in 'X2 & X4 SoC' started by Jon, Mar 26, 2019.

  1. Jon

    Jon New Member

    I am having a hard time digging through all of the XeThru resources to determine what libraries and/or examples might be available for our system design. We purchased the X4SIP02 subsystem and designed our own antenna board. We are now trying to figure out how to begin communicating with the X4 with an MCU of our own choosing (perhaps an Arduino?).

    Most of the libraries + examples seem to assume the user has purchased the X4M200 or some other full module with an MCU onboard. We have our own MCU we are planning on using and we want to figure out how to begin SPI communication/configuration with the X4SIP02. Is there a header/documentation/example that could be used for this type of implementation?
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Jon,

    You are correct, Most of the libraries + examples are prepared for developers who use XeThru sensor or development kit directly. For a user like you who are using their own MCU to communicate X4, we can only provide examples for transplant. XEP is the open source development we suggest for XeThru radar development, it's based on Atmel MCU. Its core code is X4driver and written by C. You can just replace the SPI driver part for your custom MCU.
    An RPI example of X4driver transplant: https://github.com/xethru/X4Driver_RaspberryPi_Example
     
    Jon likes this.
  3. Jon

    Jon New Member

    Hi Charlie,

    Thank you for your response. I had one last question I was hoping you could help with.

    Do you know why there are two SPI rows for the X4SIP02? If we are only communicating with one MCU, is it okay to ignore one of the SPI rows?
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    I am not sure what do you mean by saying two SPI rows. If you check X4SIP02 datasheet pin-out part, you will find that X4 also supports QSPI, but it is ok to just use SPI communication. All XeThru modules use SPI communication by far.
     
  5. Jon

    Jon New Member

    Hi Charlie,

    I see now that it supports QSPI. Can you clarify which lines are not needed on the X4SIP02 if we are only using normal SPI operation? As the RPI transplant you posted seems to suggest, we only need:

    • SPI_SCLK (P4-2)
    • SPI_MOSI (P5-2)
    • SPI_MISO (P4-3)
    • SPI_nss (P5-4)
    • X4_IO1 (P4-1)
    • X4_ENABLE (P4-5)
    Is this correct? Also, was curious why there are two VDD and GND on the power row on the top of the subsystem. Are both needed to be connected to power the system properly?

    Thanks!
     
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Jon,

    Yes, you only need the list pins and power supply. The multi VDD and GND is a common design for chip and PCB module. For this case, it will help to provide enough current for X4 and also good for heat emission. Strongly suggest you connect both of them to power the chip and antenna. You can find the schematic of X4M05(X4SIP02+X4A02 Antenna board) form this document: https://www.xethru.com/community/resources/x4m05-documentation-package.94/
     
  7. Jon

    Jon New Member

    Hi Charlie,

    We have decided to use a Pi for testing purposes and the transplant code you provided mostly works. We were able to read out the raw radar frames.

    However, it only works sporadically. We are receiving an "Error setting dac_minimum" output from the code. It seems to be happening due to one of the SPI functions related to get read/write SPI register. Do you know what the cause might be?

    Also, could you point me in the direction of what the meaning of the frame outputs from the transplant code are?

    Thanks!

     
  8. jaeyong

    jaeyong New Member

    Hi, Jon and Charlie.

    I'm also trying to use my own RPI.

    But how did you connect the GPIO of X4M05 and RPI?
    GPIO pinch of RPI is 2.54mm and X4M05 is 1.27mm.

    I looked up and found that the proper parts did not exist.
    So I try to design a PCB board that directly converts the I/O pin size 1.27mm to 2.54mm.
    Am I doing right? or Are there alternatives?