Go to advanced search

by piras77
Sat Sep 30, 2017 1:42 pm
Forum: Beginners
Topic: Reading from A/D
Replies: 1
Views: 301

Re: Reading from A/D

hamidmg wrote:
Sat Sep 30, 2017 12:38 pm
1. What's the maximum sample rate which RPi GPIO can handle?
About 30 MS/s on SPI0 MISO.
hamidmg wrote:
Sat Sep 30, 2017 12:38 pm
2. What type of programming provides the highest performance?
DMA.
by piras77
Thu Sep 21, 2017 11:30 am
Forum: Graphics, sound and multimedia
Topic: Sound recording on the raspberry pi Zero W
Replies: 14
Views: 10273

Re: Sound recording on the raspberry pi Zero W

I am more concerned about its sample rate rather than bit size; as it's only .5kHz, which will make the highest possible frequency I can record 250Hz if I am not mistaken? How do you figure 0.5 kHz? As far as I see it, the data sheet (Table 23. Input Sampling Frequency vs. Gain) tells that the samp...
by piras77
Wed Sep 20, 2017 8:09 pm
Forum: General discussion
Topic: RPI is not intended for serious projects because of its unreliability
Replies: 20
Views: 3857

Re: RPI is not intended for serious projects because of its unreliability

jamesh wrote:
Wed Sep 20, 2017 5:50 pm
I suspect Troll.
Yeah. Can't think of any other reason. Must be the first time that somebody got a problem. ;-)
by piras77
Wed Sep 20, 2017 9:09 am
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 24006

Re: I2S clocks, GPCLK0

Nooo, don't write directly to the hardware - you can get all sorts of atomicity problems, and it's not the Linux way. In general I would agree. However, we're talking here about a Pi were the TS want's to tap a certain pin for a configurable clock pulse (that is at least what I understand he wants ...
by piras77
Wed Sep 20, 2017 8:34 am
Forum: Bare metal, Assembly language
Topic: Why is toggling GPIO pins not a race condition?
Replies: 12
Views: 4348

Re: Why is toggling GPIO pins not a race condition?

I'm sure there's something fairly basic I'm just misunderstanding here, but if anyone could help me to get my brain around this, it would be greatly appreciated. Many thanks. Laurie Often there is a one-to-one relation between a bit and the peripheral port's pin value. And all the port's pins are s...
by piras77
Tue Sep 19, 2017 8:50 pm
Forum: Device Tree
Topic: I2S clocks, GPCLK0
Replies: 62
Views: 24006

Re: I2S clocks, GPCLK0

I'm not sure about what you are actually want to achieve... ...a description of the GPIO clocks is available in the peripheral datasheet https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf ...all register for the clock manager are described on the eLinux project http://elinux...
by piras77
Tue Sep 19, 2017 7:34 am
Forum: Graphics, sound and multimedia
Topic: Sound recording on the raspberry pi Zero W
Replies: 14
Views: 10273

Re: Sound recording on the raspberry pi Zero W

- Go the ADC tour, which opens the hunt for a good adc. My latest find is: https://thepihut.com/collections/raspberry-pi-hats/products/adc-pizero . The MCP3424 they use does only permit up to 240 samples per second. You might try an AD7705 breakout board. These are quite cheap, though the AD7705 ha...
by piras77
Mon Sep 18, 2017 4:45 am
Forum: C/C++
Topic: interrupt o multithreading
Replies: 3
Views: 1250

Re: interrupt o multithreading

My problem is the following: I would like to run a program (launch a process) that can do more things simultaneously to download the computational load of the CPU and be more efficient in running the programs. I have to admit, I didn't get it completely. It sounds as if you are thinking about to ru...
by piras77
Thu Sep 14, 2017 3:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

There are two different peripheral registers to set/clear the output level. This is very unfortunate for DMA operations. AFAIK he tries to work around this by using strides and/or CB chains, which isn't that promising. There is another way: writing to one of the Function Select register. You would s...
by piras77
Thu Sep 14, 2017 6:35 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

AnthonyPaulO wrote:
Wed Sep 13, 2017 9:02 pm
50 mhz though? I'd love to see your results!
The external counter would just serve as time reference with 20 ns increments (instead of the ARM Counter with 4 ns increments).
by piras77
Thu Sep 14, 2017 5:11 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

No, not really. However, I was thinking about a slow 2nd DMA transfer that records in turn the time and the present SOURCE_AD of the 1st DMA transfer. So the 1st DMA transfer (to sample data) could work at full speed (not interrupted by CB reloading). While the 2nd DMA transfer provides the data to ...
by piras77
Thu Sep 14, 2017 4:37 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

At that rate system activity (in particular video) will perturb the timings because of memory bus contention (I think). If I remember right, you use CB chains in order to record time stamps too. Such CB chains are quite memory intensive. Another reason to limit the sampling rate is that the accessi...
by piras77
Thu Sep 14, 2017 4:31 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

what the heck is the Pi spending all its cycles on? After all, at 1.1ghz the Pi can perform 1100 instructions each 1us; I should have plenty of bandwidth to spare but that doesn't seem to be the case here I guess you confuse CPU clock and bus clock. It takes much (!) longer to query a peripheral th...
by piras77
Wed Sep 13, 2017 5:47 pm
Forum: Deutsch
Topic: Speicher / DMA
Replies: 7
Views: 1772

Re: Speicher / DMA

Habe einen Test gemacht. Die Abweichungen scheinen doch nicht sooo schlimm zu sein wie ich in Erinnerung hatte.

viewtopic.php?f=44&t=191949&p=1210657#p1210655

Durchschnittliche Sample Rate 12 Ticks. Schwankungen zwischen 11 Ticks und 21 Ticks. (1 Tick = 4 ns)
by piras77
Wed Sep 13, 2017 5:44 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

When I feed it a 1mhz signal the low and high numbers fall into the single digits, which means only a few cycles are left for any logic; any faster than that and I'm sure to miss something. Well, if I understand you correctly, you want to sample an incoming signal at one bus-cycle, process it, and ...
by piras77
Wed Sep 13, 2017 5:24 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Since I was curious, I ran a brief DMA test (I did that already several months ago, but didn't remember the exact results). I work in Raspbian userland, so CPU access is no option for steady sampling anyway. The test runs on a Pi-0 with VC's 2nd Level cache enabled for the ARM core (default Kernel)....
by piras77
Tue Sep 12, 2017 9:34 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

He can sample the Level register all he wants, but unless it actually contains data it's useless. I would love to see if he can achieve those rates with, say, a teensy feeding data to the Pi via GPIO at Mhz speeds. I don't know what you mean. Are you implying that the sampling rate drops when the l...
by piras77
Tue Sep 12, 2017 8:57 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

For pacing I read the rising and falling edge events; two of them count as one cycle, then I keep going until a certain number of iterations. I then calculate the sampling rate based on how long it spent in real-time and how many cycles it completed. So you don't sample at fixed 1 MHz but on an ave...
by piras77
Tue Sep 12, 2017 8:52 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

If I don't send/receive any data via the GPIO and all I do is read the register in a tight loop then yes, you can achieve amazing speeds... useless, but amazing. In §11 it samples the Level register and saves it to memory in blocks up to a few MB at a rate of 14 MS/s (11 MS/s on Pi-2). I'm actually...
by piras77
Tue Sep 12, 2017 7:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9832

Re: SPI or BitBang via GPIO to 5v device and vice-versa

Okay, after a lot of experimentation and testing I've managed to confirm that I can reliably read an incoming 1mhz signal using a Pi 3 via GPIO; The maximum average rate for reading the GPIO Level register is far beyond that. https://github.com/ma16/rpio/blob/release.1/doc/Throughput.pdf So what ex...
by piras77
Mon Sep 11, 2017 1:20 pm
Forum: Troubleshooting
Topic: Async Rising/Falling Edge hanging on 1mhz signal
Replies: 6
Views: 1206

Re: Async Rising/Falling Edge hanging on 1mhz signal

is there a way to disable this? You can set the interrupt registers of the peripheral directly (that is what I used to do). See pp. 113 in https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf. My Raspbian intercepts following interrupts: VC: 3 16 18 32 49 50 56 57 / ARM: 1 2 ...
by piras77
Mon Sep 11, 2017 7:27 am
Forum: General discussion
Topic: DS18B20 Temperature Sensor with Raspberry Pi error 85
Replies: 28
Views: 5358

Re: DS18B20 Temperature Sensor with Raspberry Pi error 85

bensimmo wrote:
Mon Sep 11, 2017 6:33 am
Is that a pause to allow the device/devices to charge up (it has a capacitor on it iirc to power the module)...
I don't think so. A parasite-powered circuit needs explicit power switching on the bus wire (for certain operations as described in the datasheet).
by piras77
Mon Sep 11, 2017 6:12 am
Forum: Troubleshooting
Topic: Async Rising/Falling Edge hanging on 1mhz signal
Replies: 6
Views: 1206

Re: Async Rising/Falling Edge hanging on 1mhz signal

Some older Raspbian caught the related GPIO interrupt which practically freezes the system at such high rates. I think the newer newer ones don't anymore.
by piras77
Sun Sep 10, 2017 11:32 am
Forum: Raspberry Pi OS
Topic: Kernel seems to reset the Event Detect Status Register
Replies: 1
Views: 436

Kernel seems to reset the Event Detect Status Register

Hi there, It appears to me that the Raspbian kernel (4.4.50+ Feb 20 2017 on Pi Zero) resets occasionally the event detect status register. The use case: I wait for a falling edge which (even it is there) occasionally isn't reflected in the event's status bit. The setup is reliable: * The event detec...
by piras77
Sat Sep 09, 2017 2:23 pm
Forum: General discussion
Topic: DS18B20 Temperature Sensor with Raspberry Pi error 85
Replies: 28
Views: 5358

Re: DS18B20 Temperature Sensor with Raspberry Pi error 85

The problem you refer to is a bug. The thing I mentioned above is a minor issue: A <20ms sleep appears to be intentionally placed after each reset/presence sequence for reasons I don't know. /OT

Go to advanced search