Go to advanced search

by wietjes
Mon Apr 25, 2016 3:34 pm
Forum: C/C++
Topic: sample speed with pigpio
Replies: 12
Views: 2270

Re: sample speed with pigpio

Thanks for your reply, much appreciated!
by wietjes
Mon Apr 25, 2016 2:41 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: LTC2315 (three-wire ADC) with pigpio
Replies: 0
Views: 345

LTC2315 (three-wire ADC) with pigpio

I'm trying to read values from the LTC2315 ADC with pigpio. This ADC only has D_out. I have a working example with an MCP3008 but now I want a faster ADC. I have problems figuring out the structure though. The ADC has no D_in so you have to use a MIMO (master in - master out). How do you connect the...
by wietjes
Mon Apr 25, 2016 1:44 pm
Forum: C/C++
Topic: sample speed with pigpio
Replies: 12
Views: 2270

Re: sample speed with pigpio

Joan I have another question about the pigpio-library. As I understand it, the results are stored in the rxBuffer and are constantly overwritten. Is there a way to reserve a piece of the RAM and store all the values there? The goal of my experiment is to read a signal and process it with a fast four...
by wietjes
Mon Apr 25, 2016 9:18 am
Forum: C/C++
Topic: sample speed with pigpio
Replies: 12
Views: 2270

Re: sample speed with pigpio

What do you think would be the maximum sample rate with the LTC and pigpio?
by wietjes
Sat Apr 23, 2016 11:31 am
Forum: C/C++
Topic: sample speed with pigpio
Replies: 12
Views: 2270

Re: sample speed with pigpio

The datasheet says the mcp3008 supports 3,6 Mhz @ 5V, which make sense.
The LTC2315 supports an 87.5MHz data clock.
I don't think the RPI 2 or 3 can handle that speed?
by wietjes
Sat Apr 23, 2016 10:29 am
Forum: C/C++
Topic: sample speed with pigpio
Replies: 12
Views: 2270

Re: sample speed with pigpio

Hi Joan, thanks for the fast reply! yes I changed it to 3, the posted code was just a draft. I can lower the clockspeed so i get 80 Ksps and I know the results are going to be ok. But next week I'm doing the same with a LTC2315, which can deliver 5Msps. How do i know what clockspeed is acceptable to...
by wietjes
Sat Apr 23, 2016 9:30 am
Forum: C/C++
Topic: sample speed with pigpio
Replies: 12
Views: 2270

sample speed with pigpio

I'm using pigpio to read the values from a mcp3008. I want to know what my sample rate was so i use this code: start = time_time(); for (i=0; i<loops; i++){ txBuf[0] = 1; txBuf[1] = 0x80; txBuf[2] = 0; spiXfer(h, txBuf, txBuf, 2); } diff = time_time() - start; printf("sps=%.1f @ %d bps (%d/%.1f)\n",...
by wietjes
Mon Apr 11, 2016 11:25 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Faster SPI
Replies: 24
Views: 8665

Re: Faster SPI

Hi joan, I've put some prints in the code to see where it stalls. Looks like the SpiXfer function doesn't react... the print I put under the function doesn't get printed. This is what it looks like.. spiXfer(speed, 0, mode, 0, txBuf, rxBuf, msglen, 0); So I'm trying to read values from a MCP3008. Th...
by wietjes
Fri Mar 25, 2016 12:28 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Faster SPI
Replies: 24
Views: 8665

Re: Faster SPI

So i'm trying to do apply your code for the mcp3008 but I can't make it work.. this is my edit: int read_mcp3008(unsigned speed,unsigned spi_channel,unsigned mode,unsigned adc_channel){ const int msglen = 3; char txBuf[msglen]; char rxBuf[msglen]; int a2dVal; txBuf[0] = 1; txBuf[1] = 0x80; txBuf[2] ...
by wietjes
Thu Mar 24, 2016 4:51 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Faster SPI
Replies: 24
Views: 8665

Re: Faster SPI

Hi joan , I was wondering if you could tell me what this piece of code does: int read_mcp3202( ... txBuf[0] = 1; if (adc_channel == 0) txBuf[1] = 0x80; else txBuf[1] = 0xC0; txBuf[2] = 0; spiXfer(speed, spi_channel, mode, 0, txBuf, rxBuf, msglen, 0); /* SPI xfer */ return ((rxBuf[1]&0x0F)<<8) + rxBu...
by wietjes
Fri Feb 26, 2016 2:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Faster SPI
Replies: 24
Views: 8665

Re: Faster SPI

Hi joan, how can I use the PIGPIO library to obtain these speeds? I'm trying this with an MPC3008 where do I have to change the code you posted? Would this also work with the LTC2315-12? It's a faster ADC but doesn't has a MISO.. Thanks in advance! I incorporated that code into pigpio. For those so...
by wietjes
Thu Feb 25, 2016 12:24 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Faster SPI
Replies: 24
Views: 8665

Re: Faster SPI

Hi joan, how can I use the PIGPIO library to obtain these speeds? I'm trying this with an MPC3008 where do I have to change the code you posted? Would this also work with the LTC2315-12? It's a faster ADC but doesn't has a MISO.. Thanks in advance! I incorporated that code into pigpio. For those so...
by wietjes
Wed Feb 17, 2016 11:01 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO: Analog Input?
Replies: 16
Views: 112918

Re: GPIO: Analog Input?

I've done EXACTLY this with an MCP3008 over SPI, and am even in the process of writing C software for it. Breadboarded MCP3008: (sorry for the grubby state of the breadboard, it gets a LOT of use): http://i.imgur.com/NVXbyBr.jpg The software: http://i.imgur.com/kbOdHgC.png (sampling a 2kHz clock si...
by wietjes
Wed Feb 17, 2016 9:20 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Faster SPI
Replies: 24
Views: 8665

Re: Faster SPI

Hi joan, how can I use the PIGPIO library to obtain these speeds?
I'm trying this with an MPC3008 where do I have to change the code you posted?
Would this also work with the LTC2315-12? It's a faster ADC but doesn't has a MISO..

Thanks in advance!

Go to advanced search