vybhav
Posts: 7
Joined: Thu Mar 22, 2018 7:15 am

Data capture via GPIO

Tue Aug 14, 2018 7:53 am

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?

User avatar
joan
Posts: 14686
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Data capture via GPIO

Tue Aug 14, 2018 7:55 am

You could cast a magic spell.

Alternatively if you tell us the type of ADC we might be able to offer advice.

vybhav
Posts: 7
Joined: Thu Mar 22, 2018 7:15 am

Re: Data capture via GPIO

Tue Aug 14, 2018 8:04 am

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 .

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Data capture via GPIO

Tue Aug 14, 2018 8:13 am

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.

vybhav
Posts: 7
Joined: Thu Mar 22, 2018 7:15 am

Re: Data capture via GPIO

Tue Aug 14, 2018 8:18 am

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.

User avatar
joan
Posts: 14686
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Data capture via GPIO

Tue Aug 14, 2018 8:23 am

If you want help we need the model number.

vybhav
Posts: 7
Joined: Thu Mar 22, 2018 7:15 am

Re: Data capture via GPIO

Tue Aug 14, 2018 8:47 am


PiGraham
Posts: 3714
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Data capture via GPIO

Tue Aug 14, 2018 9:27 am

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.

Return to “Troubleshooting”