Post Go back to editing

Free running clock along with SPI on python binding of libm2k of ADALM2000

Category: Software
Software Version: libm2k 0.80

Hello,

I need to generate a free running clock of 12.5MHz which should run independent of the spi command from the same ADALM2000.

Can you provide me with an example in python on how to do this.?

  • There is no way to do this independently.

    You need to generate two buffers the SPI command, and the free running clock.

    Merge the buffers the two buffers to a single one before pushing it to the hardware.

    You should be able to merge the buffers by doing bitwise OR between the two initial buffers. Also make sure the values in the initial buffers are properly shifted.

  • Hi 

    What spi functions are available post merging the buffers to write and read?

  • First you could follow the example from github that shows how to create a buffer containing an SPI transaction using the spi_create_buffer(). Then create another buffer of the same size for the clock. Merge the samples of both buffer using bitwise or (bit positions corresponds to the DIO channel).
    Once both buffers are merged you can:
    * Read: Set a trigger for one of the pins using setDigitalCondition() for one of the digital channels and startAcquisition()
    * Write: on the digital interface use the push(buffer)