cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kranthig
Visitor
Visitor
2,399 Views
Registered: ‎02-24-2015

ADC conversion time in SDK

Hi, I want to interface ADC with Microblaze. Different ADC have different conversion time. Select the Slave using Xspi_mSetSlaveSelectReg(), for corresponding slave (ADC/DAC). After slave select, read the data from ADC. Wil it automatically slave deselectd or we should deselect after ADC data read. And How do control conversion time (CS high time). Please help me.
0 Kudos
Reply
3 Replies
timduffy
Explorer
Explorer
2,357 Views
Registered: ‎04-05-2016

There is a nice collection of SPI examples for use with MicroBlaze supplied in the Xilinx github repo.

https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/spi/examples

This low level example shows a read and a write:

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/spi/examples/xspi_low_level_example.c

If you are concerns about what the output waveform looks like, you may want to load in an ILA to your design and observe the output of the SPI core. Additionally, looking at the output of the FPGA pins on a scope or logic analyzer can be very helpful ( I like using saleae logic analyzer ).

In many cases I've seen the /CS line timing being pretty "liberal" when using the SPI peripheral with MicroBlaze. If the /CS line is used to control sample timing, you may want to write some HDL that handles the timing itself.
0 Kudos
Reply
kranthig
Visitor
Visitor
2,345 Views
Registered: ‎02-24-2015

Thank you. in case of ADC SPI, CS high time is conversion time. How do we control Conversion time using Microblaze SDK. Please help me.
0 Kudos
Reply
timduffy
Explorer
Explorer
2,328 Views
Registered: ‎04-05-2016

0 Kudos
Reply