Skip to main content
16 votes

Raspberry as an I2C SLAVE

Since this topic is very poorly covered and Sebastião's snippet and helped me to solve this problem I want add a complete solution on how to setup a RaspberryPi right here (tested on a RPi 3 and Zero ...
LinusCDE's user avatar
  • 161
7 votes
Accepted

Raspberry as an I2C SLAVE

This is almost identical to your previous question. You probably should have edited that rather than asking a new question. You need the bscXfer to be within the while loop. That is how the xfer ...
joan's user avatar
  • 71.4k
7 votes
Accepted

Is there a way to read the pullup status of a GPIO pin in python with, or if not, without pigpio?

It is not possible. Page 100 of BCM2835 ARM Peripherals GPIO Pull-up/down Register (GPPUD) SYNOPSIS The GPIO Pull-up/down Register controls the actuation of the internal pull-up/down ...
joan's user avatar
  • 71.4k
6 votes
Accepted

gpiotest problem and gpio 30

That is a fault in pigpio/gpiotest and/or the hardware revision returned by the Pi Zero W. gpiotest relies on pigpio to tell it which GPIO are safe to write. pigpio relies on the hardware revision ...
joan's user avatar
  • 71.4k
6 votes
Accepted

Is there a GPIO current limit function available, and where is the documentation?

Yes. The definitive source for RPi hardware documentation is the Raspberry Pi Foundation. The Foundation updated their published documentation to include programmable GPIO current limits recently (Jan,...
Seamus's user avatar
  • 22.6k
6 votes

Is there a way to slow down servo movement speed?

This may work as an example, give it a start and end position, and the time(seconds) you want it to take to move there. It will break the movement up into 100 incremental moves this will slow down ...
Chad G's user avatar
  • 1,063
5 votes

How to use piscope from my pigpio library on python

If you are running piscope on a Pi enter the following commands. sudo pigpiod # Start the daemon if not already running. piscope & # Run piscope in the background. The main piscope display will ...
joan's user avatar
  • 71.4k
5 votes
Accepted

How does pigpio's wave_chain() method happen in hardware?

The Raspberry Pi has 16 hardware DMA (Direct Memory Access) channels. Using DMA you can copy the contents of memory from one memory address to another memory address without software involvement. ...
joan's user avatar
  • 71.4k
4 votes
Accepted

Does pigpiod feature a verbose / debug mode?

Errors are reported to /dev/pigerr on the Pi running the daemon. So cat /dev/pigerr may provide useful information. You can enable tracing of the API by using the pigs csi command. Numbers 1 to 7 ...
joan's user avatar
  • 71.4k
4 votes
Accepted

High Impedance state for GPIO

Tri-state output circuitry as used for most computer busses can be set Low, High or HiZ. In fact many circuits actually have 4 states as they can be set as Inputs. The state of a bus (consisting of a ...
Milliways's user avatar
  • 61k
3 votes

2 pigpio programs at the same time

Only one program linked against the C library (pigpio) can be running at any one time. This program in effect becomes the pigpio daemon. Many programs can talk to the pigpio daemon at the same time ...
joan's user avatar
  • 71.4k
3 votes
Accepted

Measure rpm using hall sensor and pigpio

Q1 I don't remember but the code may well use a rolling average to calculate the RPM. This helps smooth the data. Q2/3 The code as given is instantiated with p = read_RPM.reader(pi, RPM_GPIO) ...
joan's user avatar
  • 71.4k
3 votes

How to stop pigpio daemon from running at system start

It depends on how it was started in the first place: If it was started as a service on Raspbian use the following command: sudo systemctl disable pigpiod Assuming you followed this description to ...
Ghanima's user avatar
  • 15.9k
3 votes

pigpio Can't lock /var/run/pigpio.pid

You need to find out which other process is using it. Then kill that process. This issue is documented on the FAQ page linked below: http://abyz.me.uk/rpi/pigpio/faq.html#...
user566245's user avatar
3 votes

pigpio servo control

The only problem I can see with the code is that it terminates straight away. When the program ends the pigpio library will shut down so servo pulses will stop. I suggest you add a time_sleep(10) or ...
joan's user avatar
  • 71.4k
3 votes
Accepted

High speed bit bang GPIO reading

I do not remember why the limit is 250k rather than say 500k or 1000k. I expect there was a reason. It may simply have been there was too much jitter at the higher bit rates to reliably clock the ...
joan's user avatar
  • 71.4k
3 votes
Accepted

pigpio spiXfer in C++

Using a char type to hold bytes is fairly common in C. char is one of the basic C types and holds one byte. Here is some C code to read channel 0 of the MCP3008. The example should make clear how ...
joan's user avatar
  • 71.4k
3 votes

Two data parsing frames for SPI reads of MCP3008 ADC, any advantages or disadvantages of either one?

The difference is whether you put the padding on the left or the right side of the data. The Adafruit implementation seems to start sending data immediately, which leaves the last 7 bits as padding, ...
btharper's user avatar
  • 119
3 votes

Any way to add more GPIOs to the AIY Voice Kit?

You can use a break-out board like the Black HAT Hacker or Pico HAT Hacker. Alternatively, connect another Pi Zero as a USB gadget and use the GPIO expander.
ben_nuttall's user avatar
  • 2,461
3 votes
Accepted

pigpiod callback is exiting my code

As the code is written in your question, it is creating an unlimited number of callbacks. Eventually the system will fall over because of a lack of resources. Also a pigpio callback receives a set ...
joan's user avatar
  • 71.4k
3 votes

Segmentation faults on every GPIO STR

You get the error because you didn't map the IOBASE address range to your process' address space. Accessing an unallocated address is exactly what a SEGFAULT is. Check the source code of any GPIO ...
Dmitry Grigoryev's user avatar
3 votes
Accepted

Full duplex SPI communication with an ADC using the pigpio library

If you want to send 8 NOP bits send a byte containing 0xFF. count, rx_data = spi_xfer(handle, [0xff]) If you want to send 16 NOP bits send two bytes containing 0xFF. count, rx_data = spi_xfer(handle, [...
joan's user avatar
  • 71.4k
3 votes
Accepted

How fast are C & Python libraries

I wrote programs for a number of libraries, both c and python. These just toggle a GPIO pin as fast as possible. NOTE In case anyone misunderstands I am aware this is an artificial test with no real ...
Milliways's user avatar
  • 61k
3 votes
Accepted

How to correctly identify the pin addresses in the Pi4J 2.2.1 GPIO API?

There are 3 pin numbering conventions in use on the Pi; BCM, Physical (or Board) and WiringPi. BCM is the native numbering (and is the only convention understood by the SoC). Board numbers correspond ...
Milliways's user avatar
  • 61k
3 votes
Accepted

How can I restore the hardware state after pigpio wave output?

There is no way provided by pigpio. pigpio takes over the PWM and PCM clocks when you use waves. There is no provision made by pigpio to restore the clocks to the previous state.
joan's user avatar
  • 71.4k
2 votes

Thread working with I2C blocked

You need to find out what, if anything, is blocking. In my experience Linux driver I2C problems usually return IO error 5. The pigpio i2c* functions use the Linux I2C driver. The pigpio bb_i2c* ...
joan's user avatar
  • 71.4k
2 votes

Max frequency can created by wave function in pigpio library

piscope uses the services of the pigpio library to provide GPIO timings. By default pigpio samples the GPIO every 5µs (200 thousand times per second). The pigpio sample rate is at most once every µs ...
joan's user avatar
  • 71.4k
2 votes

Pigpio initialization failing with init mbox zaps failed

If the code is running as a daemon, then I have seen this error appear in my syslog due to an improper shutdown - that is, without calling pigpio.terminate() on receiving shutdown signals, or not ...
saraf's user avatar
  • 571
2 votes
Accepted

Error occurred "unhandled signal 11, terminating" in executing code with PIGPIO

Two points. The crash is caused by attempting to write to unassigned memory. You declare errstr as a pointer to memory but don't point it anywhere and don't allocate any memory for where you would ...
joan's user avatar
  • 71.4k
2 votes

Using the ds18b20, why are you limited on pins you can use? GPIO4 only one that seems to work

The DS18B20 is a (Dallas) 1-wire bus temperature sensor. It uses one wire for control and data. Early versions of Pi software only allowed for the 1-wire bus to be started on GPIO4. You are looking ...
joan's user avatar
  • 71.4k

Only top scored, non community-wiki answers of a minimum length are eligible