Go to advanced search

by jayben
Tue Aug 11, 2020 6:01 pm
Forum: Advanced users
Topic: Extreme High speed pulse counting
Replies: 11
Views: 363

Re: Extreme High speed pulse counting

True; I didn't actually answer the OP's question, but the principle still applies: to get a pulse count, use the SPI input, and count the transitions in the data. Incidentally, with any of these approaches, there will be a problem around zero speed, since a small amount of back-and-forth vibration c...
by jayben
Tue Aug 11, 2020 1:56 pm
Forum: Advanced users
Topic: Extreme High speed pulse counting
Replies: 11
Views: 363

Re: Extreme High speed pulse counting

Use SPI input. Run the interface at 1MHz (or more), connect the SPI data input to your signal, and ignore the clock, data output & chip select. You will get a stream of zeros, followed by a stream of ones, then another stream of zeros, and so on. Count the number of transitions in a given number of ...
by jayben
Tue Aug 11, 2020 10:21 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: DMA SRC_INC not working as (I) expected
Replies: 7
Views: 989

Re: DMA SRC_INC not working as (I) expected

In my DMA experimentation ( https://iosoft.blog/raspberry-pi-dma-programming/ ) I did occasionally have problems where non-incrementing memory transfers didn't behave as expected, but peripheral transfers always worked OK. I was able to work around the issue, and assumed it was due to bugs in my cod...
by jayben
Tue Aug 11, 2020 9:48 am
Forum: Automation, sensing and robotics
Topic: Relative position
Replies: 3
Views: 125

Re: Relative position

You can determine the distance between 2 or more units using Ultra Wideband, see https://iosoft.blog/real-time-location-ultra-wideband/ Alternatively, with a few cameras, you could do optical triangulation of LED markers or fiducial tags: https://iosoft.blog/position-measurement-low-cost-cameras-ope...
by jayben
Mon Aug 10, 2020 8:35 am
Forum: Automation, sensing and robotics
Topic: Using LM358 Op Amp to step up clock output from gpio
Replies: 2
Views: 106

Re: Using LM358 Op Amp to step up clock output from gpio

An op-amp amplifies the difference between the signals at its '+' and '-' terminals. Furthermore, many op-amps will only amplify signals if they are significantly above ground potential, and below the supply potential (unless it has a 'rail-to-rail' capability). So if you tie the the negative pin to...
by jayben
Mon Aug 10, 2020 8:01 am
Forum: Python
Topic: Real Time GUI help on loops
Replies: 5
Views: 170

Re: Real Time GUI help on loops

Yes, you do need to create a separate thread for the data acquisition, but to start with, I'd ignore the OPC UA application, and just create a data acquisition thread that generates some simple dummy data, such as reporting the time every second. Then the question is how your display thread accesses...
by jayben
Wed Aug 05, 2020 7:25 pm
Forum: Automation, sensing and robotics
Topic: Pi controlled multiple solar charged lamps project
Replies: 4
Views: 191

Re: Pi controlled multiple solar charged lamps project

I don't know of any specific information, but when searching for it, the first decision you'll face is whether to use general-purpose communications between the units (e.g. emulating a serial link), or just use simple on/off commands from a controller to I/O pins on the module. The former could be a...
by jayben
Tue Aug 04, 2020 6:55 pm
Forum: Automation, sensing and robotics
Topic: Pi controlled multiple solar charged lamps project
Replies: 4
Views: 191

Re: Pi controlled multiple solar charged lamps project

What you are proposing is complicated, expensive, and well worth stealing! I'd take the opposite tack, and modify some dirt cheap solar lights to include a simple 433 or 868 MHz wireless module from RF Solutions https://www.rfsolutions.co.uk/ They'll have much lower power consumption & greater range...
by jayben
Tue Aug 04, 2020 6:28 pm
Forum: Other projects
Topic: rtl-sdr not working - Any ideas?
Replies: 3
Views: 143

Re: rtl-sdr not working - Any ideas?

How about a program to disable & re-enable the USB ports, as in viewtopic.php?t=172313

That might have the same effect as re-plugging... or could just crash the USB drivers. Let us know which!
by jayben
Thu Jul 30, 2020 8:57 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPi4, Receiving 1-5Mbps bit rate data signals via GPIO
Replies: 4
Views: 272

Re: RPi4, Receiving 1-5Mbps bit rate data signals via GPIO

You could try SPI, which can transfer up to 50 Mbit/s, see https://iosoft.blog/fast-data-capture-raspberry-pi/

Or, if you want a parallel interface, SMI goes up to 640 Mbit/s, see https://iosoft.blog/raspberry-pi-smi/
by jayben
Tue Jul 28, 2020 9:10 am
Forum: C/C++
Topic: Polling Keyboard
Replies: 6
Views: 454

Re: Polling Keyboard

by jayben
Tue Jul 28, 2020 8:57 am
Forum: Advanced users
Topic: New physical addresses on rpi3 a+
Replies: 3
Views: 190

Re: New physical addresses on rpi3 a+

I've described the 3 address spaces in my DMA blog post, see https://iosoft.blog/raspberry-pi-dma-programming/ If you ever decide that coding in asm is too much like hard work, the C code in there might be useful, and in the ADC follow-up https://iosoft.blog/fast-data-capture-raspberry-pi/ since all...
by jayben
Sun Jul 19, 2020 2:27 pm
Forum: Compute Module
Topic: Mutli-drop, Shared "GPIO Bus" Across RPi CMs?
Replies: 7
Views: 550

Re: Mutli-drop, Shared "GPIO Bus" Across RPi CMs?

The 6 address lines could certainly be used to select one of several chips, or different functions within a chip, such as an FPGA. The device number only selects 1 of 4 timing registers, to rapidly switch the timing for different devices on the parallel bus - it is an internal configuration, not an ...
by jayben
Sat Jul 18, 2020 9:15 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Secondary Memory Interface
Replies: 12
Views: 803

Re: Secondary Memory Interface

Thanks very much for the comments; having spent a month staring at SMI registers, it is good to think the code might be of some use. I'm just a bit concerned at the catastrophic failure of SMI on the Pi 3 and 4 when the DMA doesn't keep up. The ZeroW fails gracefully under these circumstances, just ...
by jayben
Fri Jul 17, 2020 3:09 pm
Forum: Compute Module
Topic: Mutli-drop, Shared "GPIO Bus" Across RPi CMs?
Replies: 7
Views: 550

Re: Mutli-drop, Shared "GPIO Bus" Across RPi CMs?

If you use SMI (Secondary Memory Interface) on an 8-bit shared bus, you should get a sustained transfer rate of at least 25 Mbyte/s. There would need to be some logic to handle bus contentions, maybe a simple CPLD.

See https://iosoft.blog/raspberry-pi-smi/ for examples of SMI driving an ADC and DAC.
by jayben
Fri Jul 17, 2020 9:51 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Secondary Memory Interface
Replies: 12
Views: 803

Secondary Memory Interface

The Secondary Memory Interface (SMI) is available on every Pi version, and offers a very fast parallel interface - over 80 megabytes per second on a ZeroW. It is very rarely used, due to the lack of publicly-available documentation; I've tried to rectify that, by posting detailed information and C c...
by jayben
Thu Jul 16, 2020 3:50 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Grounding the pinouts
Replies: 1
Views: 151

Re: Grounding the pinouts

Not sure why you are focusing on the wire type and grounding - it is generally better to identify the source of the problem first. You need to explain what the noise is (radiated or conducted, high or low frequency, pulsed or continuous etc.) and how it is being detected (jitter on display, erratic ...
by jayben
Thu Jul 16, 2020 8:09 am
Forum: Bare metal, Assembly language
Topic: Is DMA memory "atomic"?
Replies: 5
Views: 440

Re: Is DMA memory "atomic"?

Take a look at my blogs https://iosoft.blog/raspberry-pi-dma-programming/ and https://iosoft.blog/fast-data-capture-raspberry-pi/ Plenty of examples in C to experiment with, but to answer your original question, the DMA controller normally does 32-bit transfers, so any one of the transferred 32-bit ...
by jayben
Fri Jul 10, 2020 6:46 pm
Forum: General discussion
Topic: SPI via DMA
Replies: 8
Views: 334

Re: SPI via DMA

Here is an example of SPI DMA programming: https://iosoft.blog/fast-data-capture-raspberry-pi/

However, it is in the C language. I'm not aware of a Python implementation, but if you really need high speed, you may have to code the whole thing in C anyway.
by jayben
Thu Jul 02, 2020 10:32 am
Forum: General discussion
Topic: PIGPIOd custom DMA CB.
Replies: 4
Views: 195

Re: PIGPIOd custom DMA CB.

Thanks very much for giving my iosoft.blog a name-check, and the techniques I describe can certainly be used to modify the GPIO configuration on the fly - I'm actually doing this in my parallel ADC code, which will feature in the next blog post. However, this is a high-risk operation, and the smalle...
by jayben
Tue Jun 30, 2020 8:37 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using Optoisolators at 115200 baudrate
Replies: 4
Views: 267

Re: Using Optoisolators at 115200 baudrate

It could just be the value of the pullup / pulldown resistor; 10K is much too large. The reason is that the transistor has quite a lot of charge-storage, so it acts a bit like a capacitor that is discharged when the opto LED is on, and charged via the pullup resistor when the LED is off. The data sh...
by jayben
Mon Jun 29, 2020 6:18 pm
Forum: General discussion
Topic: spi and pigpio questions
Replies: 8
Views: 337

Re: spi and pigpio questions

I've done data acquisition with the SPI interface clocked at 40 MHz, so 3 MHz should be no problem, see https://iosoft.blog/fast-data-capture-raspberry-pi/ This was achieved by direct-programming SPI & DMA in C, so the code is more complicated than using the normal device-drivers, but you get much h...
by jayben
Mon Jun 22, 2020 6:14 pm
Forum: Python
Topic: Data transfer over SPI is slow
Replies: 1
Views: 148

Re: Data transfer over SPI is slow

I'm not surprised at the results you are getting, and suspect that getting accurately-timed 5 kHz data is impossible with Python and the standard drivers - but would be really happy to be proved wrong. I have been able to get 2.6 megasamples per second from an SPI ADC using a Pi Zero (with negligibl...
by jayben
Fri Jun 12, 2020 1:46 pm
Forum: Automation, sensing and robotics
Topic: Numeric Keyboard Emulator/hacking
Replies: 1
Views: 161

Re: Numeric Keyboard Emulator/hacking

I assume that when a button is pressed, it links 1 of 4 outputs to 1 of 3 inputs (or vice-versa). In theory you work out the scan time, then trigger a timer on the first scan output, and set one of the inputs after a suitable delay, but it happens that the Pi doesn't have any general purpose timers,...
by jayben
Thu Jun 11, 2020 10:51 am
Forum: Beginners
Topic: DAQ on RPI
Replies: 2
Views: 218

Re: DAQ on RPI

I managed 2.5 megasamples per second on a Pi Zero.

See https://iosoft.blog/fast-data-capture-raspberry-pi/ for full details and C source code.
adc_test1a.png
Capture of composite video at 2.5 MS/s
adc_test1a.png (4.09 KiB) Viewed 104 times

Go to advanced search