X4 X4M05 SPI Port

Discussion in 'X2 & X4 SoC' started by Sooraj, May 29, 2017.

  1. Sooraj

    Sooraj New Member

    I successfully ported the xep source to python and tested using raspberry pi on X4M05. But when i read frames after a few frames (20-24) the data becomes all zeros. Also the read data repeats alternatively. That is the first, third , fifth,... frames are same and second, fourth ,sixth,.. frames are same.This continues for 20-24 frames and after the whole data becomes zero. Please help..
  2. Olav Liseth

    Olav Liseth Administrator Staff Member

  3. Sooraj

    Sooraj New Member

    Hi olav,
    Thanks for the reply. I didn't know about the X4_GPIO1. So should i configure it in the program or should i just make that pin High before every read?
  4. Olav Liseth

    Olav Liseth Administrator Staff Member

    Hi Sooraj,

    I recommend to configure and compile X4Driver for raspberry pi and use e.g. swig to call the library from python.
    The platform dependent functions are discussed in the documentation: xtXEP_source-0.9.1-rc3/xtXEP/doc/output/html/xep_x4driver.xhtml

    The default behavior is that X4 drives the X4_GPIO1 high when the frame is ready to readout, the X4Driver will then read the frame over SPI.
  5. Sooraj

    Sooraj New Member

    Hi Olav,
    Thanks for the response. We actually cannot use the current X4Driver since its based on RTOS.
    So we needed to port the code.
  6. Sooraj

    Sooraj New Member

    You said X4_ENABLE is cycled at initialization. So assuming the device is turned on, the ENABLE pin is cycled only once, right?
  7. Olav Liseth

    Olav Liseth Administrator Staff Member

    The X4Driver is written generic and OS specific functions are implemented with callbacks. The documentation should point you to the callbacks you have to implement.

    The enable pin is cycled once in the x4driver_init function.
  8. Ash

    Ash Member

    Hi, in addition to this post, i have some query, interfacing x4 module to RPi via SPI (follow up this https://github.com/xethru/X4Driver_RaspberryPi_Example), but while ./Runme, it show like...

    raspbian_x4driver start to work!
    task_radar start!
    radar_hal_init success
    x4driver_create success
    task_radar_init success
    x4driver_init unknow situcation
    x4driver_set_sweep_trigger_control success
    Error setting dac minimum
    Error code=-1
    raspbian_x4driver done.

    How can i see the radar raw data on terminal. Please suggest! Thanks!