Go to advanced search

by piras77
Sat Sep 09, 2017 1:50 pm
Forum: General discussion
Topic: DS18B20 Temperature Sensor with Raspberry Pi error 85
Replies: 28
Views: 5359

Re: DS18B20 Temperature Sensor with Raspberry Pi error 85

I guess it is a power issue. The TS' code runs fine on my Pi. If I disconnect Vcc, the output changes to "85.0" or to "0.0". The chip is still partially operational. 85 is the chip's default temperature value. Edit: I don't use the kernel module and was curious. Not quite sure why the driver goes to...
by piras77
Sat Sep 09, 2017 9:18 am
Forum: Deutsch
Topic: Speicher / DMA
Replies: 7
Views: 1773

Re: Speicher / DMA

Was spricht dagegen GPIO-Register anzugeben? Nichts, solange es dir nichts ausmacht, dass die Abstände zwischen den einzelnen Zugriffen unregelmäßig sind. Wenn es bspw. im Mittel 50ns sind, dann können die tatsächlichen Abstände schon Mal zwischen 40ns und 400ns schwanken. Schreib' dir ein Programm...
by piras77
Sat Sep 09, 2017 8:59 am
Forum: General discussion
Topic: DS18B20 Temperature Sensor with Raspberry Pi error 85
Replies: 28
Views: 5359

Re: DS18B20 Temperature Sensor with Raspberry Pi error 85

At which point in your code exactly do you get the "error" number? temp_output = lines[1].find('t=') if temp_output != -1: temp_string = lines[1].strip()[temp_output+2:] temp_c = float(temp_string)/1000.0 return round(temp_c,1) I'm not familiar with Python. Still, what exactly is returned if temp_ou...
by piras77
Thu Sep 07, 2017 6:35 pm
Forum: Deutsch
Topic: Speicher / DMA
Replies: 7
Views: 1773

Re: Speicher / DMA

Ich möchte einen Logikanalyser mit 32 Eingängen bauen der mit min. 15 Megasamples arbeitet. Bis auf die CM sind lediglich 28 Pins des SOCs auf dem Pin Header. Dafür ist jede höhere Programmiersprache zu langsam, es bleibt also nur Assembler oder eine Hardwarelösung übrig. Der Unterschied zwischen A...
by piras77
Wed Sep 06, 2017 11:01 am
Forum: C/C++
Topic: High speed rotary encoder reading
Replies: 12
Views: 11222

Re: High speed rotary encoder reading

Well, unless you want to argue that any userland thread can be suspended by the kernel for an arbitrary time, it will be kind of difficult to prove your "disagreement". ;-) Still, sampling 4 encoders with 8 signal lines (even at a low signal speed of 2400 pulses per second) over 30 minutes on a busy...
by piras77
Wed Sep 06, 2017 10:24 am
Forum: C/C++
Topic: High speed rotary encoder reading
Replies: 12
Views: 11222

Re: High speed rotary encoder reading

A rotary encoder provides for each discrete angle change a signal on (mostly) two wires. Is that really what you need at high revs? If so... I wrote some very simple code to read the encoders using interrupts with wiringPiISR. Everything 'works', but it is incredibly processor intensive. I'm not fam...
by piras77
Wed Sep 06, 2017 5:43 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9835

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

...going bare metal and utilizing low-level direct access to the GPIO registers and clocked that at almost 60mhz... Just to make sure and out of curiosity: you set GPSET0 & GPCLR0 registers in turn (in a counter loop?) and you got a valid logic output on the pin header for a 1:1 square wave at 60 M...
by piras77
Sat Sep 02, 2017 5:41 pm
Forum: Advanced users
Topic: I2C Unreliability
Replies: 4
Views: 1162

Re: I2C Unreliability

However, the I2C protocol seems to be unreliable with the Raspberry PI for certain transceiver types. As far as I see it, the Pi appears quite reliable. There are many projects that make use of I2C. The protocol works perfect reading and writing with the 'SFP' model transceiver and I can read and w...
by piras77
Tue Aug 29, 2017 6:15 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI or BitBang via GPIO to 5v device and vice-versa
Replies: 45
Views: 9835

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

First is the problem of not enough GPIO on the Pi... I would need some kind of GPIO expander or a device that allows me to communicate with it via SPI or bit-banging at very high speeds that can accommodate assembling 24-bits of data within the 1mhz clock-cycle Do you really need an expander? Most ...
by piras77
Mon Aug 28, 2017 1:03 pm
Forum: Bare metal, Assembly language
Topic: Reading from Multiple Encoders
Replies: 21
Views: 6321

Re: Reading from Multiple Encoders

This is straight forward. I added it this morning to my lib since I was also a bit curious. It should be quite clear from context: auto t0 = counter.clock() ; gpio.enable(mask,Rpi::Gpio::Event::Rise,true) ; gpio.reset(mask) ; // clears flags while (0 == (gpio.getEvents() & mask)) t0 = counter.clock(...
by piras77
Mon Aug 28, 2017 6:32 am
Forum: Bare metal, Assembly language
Topic: Reading from Multiple Encoders
Replies: 21
Views: 6321

Re: Reading from Multiple Encoders

You can't do it under linux the timing requirements are too strict. Sure you can, why shouldn't one? The period of a pulse is 4098us ( datasheet p.7). You have to detect the edges or sample-and-count. For example, with a tight busy loop you can scan the event detect register several million times p...
by piras77
Sun Aug 27, 2017 3:35 pm
Forum: Bare metal, Assembly language
Topic: Reading from Multiple Encoders
Replies: 21
Views: 6321

Re: Reading from Multiple Encoders

I think I'd look to using a dedicated microcontroller,,, Well, there isn't always this option. I would guess it is possible on a Pi, even in userland. Set up the Event Detect Register, poll for the edges (a tight loop manages 10M queries per second), and take the time. This will block the thread fo...
by piras77
Sun Aug 27, 2017 3:29 pm
Forum: Bare metal, Assembly language
Topic: Reading from Multiple Encoders
Replies: 21
Views: 6321

Re: Reading from Multiple Encoders

How do I read a square wave via GPIO programming By sampling the level or by edge detection (I feel like in school again). I assume I can do this with python, yes? You can try. Is it easy to do this with C++? Sure. Can I attach two encoders, power them both, and get unique data for them both? Absol...
by piras77
Sun Aug 27, 2017 2:25 pm
Forum: Deutsch
Topic: Relais schalten schon wenn sie als OUT registriert werden.
Replies: 5
Views: 3334

Re: Relais schalten schon wenn sie als OUT registriert werden.

Das Relay ist * entweder stromlos = nicht angezogen (COM is mit NC verbunden) * oder angezogen (COM ist mit NO verbunden). Das Relais zieht an (COM=NO) wenn * der Eingang (IN) 0 Volt ist * und ca. 2mA bereit stellt. Anderenfalls ist das Relais nicht angezogen (COM=NC). Wenn du vom Input Mode auf den...
by piras77
Sun Aug 27, 2017 9:44 am
Forum: Deutsch
Topic: Relais schalten schon wenn sie als OUT registriert werden.
Replies: 5
Views: 3334

Re: Relais schalten schon wenn sie als OUT registriert werden.

https://www.amazon.de/gp/product/B01CQ10YXI/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 Dort steht: Das Relais schaltet bei anliegendem GND auf dem Eingang. Solche habe ich auch: Low = "Ein" (Relais zieht hörbar an), High = "Aus". Da der Ausgang ein Umschalter ist, kannst du selbst entscheiden wann...
by piras77
Sun Aug 27, 2017 6:16 am
Forum: Networking and servers
Topic: GPIO control via listener server guidance
Replies: 3
Views: 1058

Re: GPIO control via listener server guidance

(1a) It appears you want to control your pins by HTTP, so you are going to need to set up some kind of web server. Apache is quite popular. Maybe there are other ones around which are lightweight and more user-friendly (for your simple task). Ask the Forum. (1b) Then you need to configure your web s...
by piras77
Sun Aug 27, 2017 5:15 am
Forum: General discussion
Topic: making I/O pulses
Replies: 8
Views: 3523

Re: making I/O pulses

I need to generate pulses on 8 different I/O pins. The pulse time is 0.5 to 2 seconds. You can do that basically with any GPIO library since your timing requirements are very moderate. Set a pin's value, start some kind of timer, reset the pin's value when the alarm goes off. However, now and then ...
by piras77
Sat Aug 26, 2017 4:50 pm
Forum: C/C++
Topic: DMA ISR
Replies: 1
Views: 933

Re: DMA ISR

I am working with real time streaming data and now I want to trigger an ISR upon completion of each DMA transfer. ISR will manipulate the data and move it to another buffer. I would like to keep latency less than 50 microseconds. i.e. less than 50 microseconds between DMA interrupt firing and begin...
by piras77
Sat Aug 26, 2017 7:20 am
Forum: Deutsch
Topic: LEDs mit externer Stromversorgung dimmen
Replies: 6
Views: 5148

Re: LEDs mit externer Stromversorgung dimmen

Habe mal an einem Zero 5 x 82 und 6 x 68 Ohm (hatte gerade nicht mehr) an roten Leds (ausgemessen: IF ~10mA @ UF ~2,0V) angeschlossen. Pads auf default Werte belassen. Die Spannung der Pins fällt von 3,3V auf 2,9V (82 Ohm / 9mA) und 2,8V (68 Ohm / 12mA). Zieht in Summe also etwa 330mW. SOC ist stabi...
by piras77
Fri Aug 25, 2017 10:49 pm
Forum: Deutsch
Topic: LEDs mit externer Stromversorgung dimmen
Replies: 6
Views: 5148

Re: LEDs mit externer Stromversorgung dimmen

Mit dieser Aussage wäre ich vorsichtig. Prinzipiell stimme ich dir zu. Allerdings ist der Pi ziemlicht schlecht dokumentiert (im Vergleich zu anderen SOCs), so dass man quasi gezwungen ist zu experimentieren, Praktisch sehe ich keine Probleme mit 8 x 16 mA, weder im Spannungsregler noch im SOC. Da ...
by piras77
Fri Aug 25, 2017 6:49 pm
Forum: Deutsch
Topic: LEDs mit externer Stromversorgung dimmen
Replies: 6
Views: 5148

Re: LEDs mit externer Stromversorgung dimmen

Hallo Thomas, Jetzt stoße ich jedoch an einen Punkt, an dem ich mir nicht sicher bin. Ich möchte über den Raspberry Pi einige LEDs auf Knopfdruck dimmen und automatisiert wieder aufhellen. Ich habe mir dazu ein entsprechendes Python Script gebastelt. Das funktioniert mit einer einzelnen LED super. O...
by piras77
Fri Aug 25, 2017 8:42 am
Forum: HATs and other add-ons
Topic: Controlling WS2812B from RPi 3b
Replies: 10
Views: 11783

Re: Controlling WS2812B from RPi 3b

If you read the data sheet you will find that the data line will detect high from 0.7v to 5.6v so the 3.3v signal line from the RPi is fine. The datasheet states VIH=0.7 VDD, which is 3.5V at VDD=5V. These particular RGB LEDs are a little bit of a pain to use with RPi because there isn't a clock li...
by piras77
Thu Aug 24, 2017 5:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: max SPI speed on PiZero
Replies: 3
Views: 5147

Re: max SPI speed on PiZero

Since the (default) base clock is 250 MHz, a divider of 64 would result in 3,90625 MHz. You may try decrementing the divider in steps of two: i.e. 62, 60, 58... (it doesn't have to be a power of two, just even). btw: The Pi-0 and Pi-3 do "overclock" the base clock up to 400 MHz on load. And it may c...
by piras77
Wed Aug 23, 2017 5:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: DMA and SPI documentation
Replies: 5
Views: 2126

Re: DMA and SPI documentation

With DMAEN it will be always 32-bit word transfer. So you have to pad. Still, since DMALEN is given in bytes, the last 0-3 bytes are going to be ignored. And yes, 1:n a.s.o are 32-bit words. I made some notes the time I wrote my code. Maybe there are some useful pointers. No guarantees, though. ;-) ...
by piras77
Wed Aug 23, 2017 5:16 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: DMA and SPI documentation
Replies: 5
Views: 2126

Re: DMA and SPI documentation

I did this (in userland) with four CBs per record. This works fine as long as the MISO/MOSI sequence fits into the SPI fifo: 1st CB to setup the SPI control register (1:1). 2nd CB to transfer MOSI (n:1). 3rd CB to read the Timer (1:1). 4th CB to transfer MISO (paced with PERMAP=7, 1:n). Then I have ...

Go to advanced search