Page 1 of 1
Data capture via GPIO
Posted: Tue Aug 14, 2018 7:53 am
by vybhav
Hi
I have been working on this project where i have interfaced the RPi-3 with the ADC and ADC is generating clock,chipselect and data .
how to capture this data at the falling of the clock via the GPIO?
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 7:55 am
by joan
You could cast a magic spell.
Alternatively if you tell us the type of ADC we might be able to offer advice.
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 8:04 am
by vybhav
Hi
Here are the details on the ADC i am using when interfaced with RPi
The ADC works in two modes : Master and Slave mode
to configure the ADC in the respective mode i am using SPI0 i.e register write/read using SPI0.
If the ADC is configured in master mode it generated clock,chip_select and data.
The frequency of clock ranges from 750KHz to 24 Mhz
chip_select frequency ranges from 10khz to 375khz respectively
My aim is the capture the data from ADC to the RPi via the GPIO.
I configured the ADC in slave mode and interfaced it with SPI1 for data capture , unfortunately the chip_select frequency was not constant hence i got junk data .
And Rpi can only act as master in SPI protocol ,so for data capture i cannot use SPI and only option i have is to use the GPIO and sample the data from the at the falling edge of the clock with chip_select being low .
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 8:13 am
by DirkS
vybhav wrote: ↑Tue Aug 14, 2018 8:04 am
Hi
Here are the details on the ADC i am using when interfaced with RPi
I think posting the exact model and / or link to data sheet would be more useful.
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 8:18 am
by vybhav
I wish i could share the datasheet ,but due to confidentiality clause i am not allowed to share. Please let me know the specific details you are looking for ,i will try my best to share it.
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 8:23 am
by joan
If you want help we need the model number.
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 8:47 am
by vybhav
Re: Data capture via GPIO
Posted: Tue Aug 14, 2018 9:27 am
by PiGraham
How many channels do you intend to use at what sample rate, for how long?
What do you intend to do with the data? at 8 channels and 110kHz that's 2.64 Mbytes/s which may be possible but I think you would have to sample asynchronously and find the sync pulses in the data. You might also need to de-serialise the 24 data bits over 8 channels.
110,000 * 24 bits = 264000 bits/s and you need a sample rate at least twice that
You could start with Joan's
piscope which will grab the states of multiple gpio at up to 1 MHz, I think.
That will demonstrate if the Pi can capture the raw data for a short time.