Questions tagged [bit-bang]

For questions pertaining to bit banging, a serial communication technique.

Bitbanging is a technique for serial communications using software instead of dedicated hardware.

25 questions
30
votes
3 answers

Can Raspberry Pi reliably bit bang a 9600 baud serial and is there example code?

I am wondering how feasible it is to use bitbanging to drive a 9600 baud serial via the GPIO pins on the Raspberry Pi. Obviously, Linux is not a terribly good platform for bitbanging, as there is a large number of drivers and other interrupts which…
Nakedible
  • 1,561
  • 1
  • 13
  • 18
9
votes
1 answer

How do I bit bang I²C master?

I've installed RPi.GPIO. It doesn't support I²C yet, but can I use it to bit bang I²C? I would just need the Raspberry Pi to be the master.
John La Rooy
  • 12,005
  • 9
  • 48
  • 77
7
votes
3 answers

How fast is GPIO+DMA? Multi I2S input

I want to connect multiple I2S ADCs to RaspberryPi and record multi-channel audio. I calculated that it requires copying GPIO input port to RAM at 3072kHz (or every 0.33µs). I want to do it using DMA. I know that PiBlaster (PWM) and PiFM (radio…
adiblol
  • 71
  • 1
  • 1
  • 3
7
votes
1 answer

Bit waveform clarification

I have been trying to learn more about bit transmission through the uart, and I have the following code in python to transmit information: import serial ser = serial.Serial( port='/dev/ttyAMA0', baudrate = 1000000, …
Helder Esteves
  • 217
  • 2
  • 6
6
votes
1 answer

I2C repeated start with BitBanging not working - Pigpio library on Raspberry Pi B+

First post here on the forum! Been getting a lot of help here from all the past posts and I am grateful for such a great community. I have been trying to use Repeated Start by using the PIGPIO library using bitbanging. However, I have not been able…
Thomas
  • 61
  • 1
4
votes
4 answers

Inconsistency in continuous data acquisition on RPi

I am using the RPi to continuously acquire voltage data from an external ADC. I am using MCP3201 ADC (12 bit, 10k SPS) in a bit banging approach to get voltage data to Raspberry Pi and write it to a USB disk. Unfortunately the data acquired has…
Krishna R
  • 41
  • 3
4
votes
3 answers

Multiplexing 4-digit 7-segment display is flickering

I connected a 4-digit 7-segment display to the GPIO-port. It uses 8 ports for the LEDs and 4 ports for multiplexing via PNP-transistors. It is running so far with a loop written in C program: while(1) { for(j = 0; j < 4; j++) { // Loop through 4…
Lukas
  • 151
  • 1
  • 5
4
votes
2 answers

Theoretical maximum data rate of GPIO pins

Is there a maximum data rate of the GPIO pins? I.e. if I wanted to bit-bang data through one of the pins, what kind of data rates could I achieve? Alternatively, what is the slew rate of a GPIO pin? I couldn't find any timing specifications or…
Drew McGowen
  • 141
  • 1
  • 3
4
votes
2 answers

Proper way to bit bang I2C

As already mentioned in this question Reading and writing with smbus package, there are chips that, apart for standard SDA and SCL lines, use a third communication line. This means that this "modified" I2C communication cannot be made using…
Pygmalion
  • 458
  • 2
  • 7
  • 25
3
votes
2 answers

Using bypass capacitors to reduce voltage spikes and noise causing I2C read/write errors

I'm trying to communicate with an old i2c device and I'm getting wrong read values, and possibly even some incorrect write values too. My logic analyzer shows random highs in the middle of a low. This happens mostly on software i2c but I get…
vaid
  • 381
  • 4
  • 13
3
votes
1 answer

Bit-banging with Python

I want to get and change the I²C address of MCP4728 chip. To do this, one has to coordinate I²C communication with another LDAC pin register. After posting the question here, Reading and writing with smbus package, I have realised that the only…
Pygmalion
  • 458
  • 2
  • 7
  • 25
2
votes
2 answers

How to read RHT03 sensor

I have this sensor: http://cdn.sparkfun.com/datasheets/Sensors/Weather/RHT03.pdf On page 3 there is an image showing how to communicate. I also attach an image of this here: In my understanding, the PI should send a "start signal" and then proceed…
UmaN
  • 123
  • 5
1
vote
0 answers

Writing to a sensor register using i2c bitbanging library not working - PiGPIO library on Raspberry Pi

I am trying to configure a sensor connected to Rpi over an i2c bus. I am using PiGPIO library with Python to do this. To configure the sensor, I need to write a certain value to some registers and that doesn't seem to be working. I am doing the…
1
vote
1 answer

pigpio library serial_wave confusion

I am trying to use joan's pigpio for python to try to write a command from a rpi3 GPIO pin to a peripheral device. the peripheral device uses UART and when it receives a data packet it will then perform the corresponding function. example …
1
vote
1 answer

High speed bit bang GPIO reading

I'm trying to establish a UART communication link by means of bit-banging. For the TX part, I am using the pigpio lib to form a 1Mbaud wave of bits (gpioWaveAddSerial). I have checked it and it with an oscilloscope and it performs as intended. The…
Helder Esteves
  • 217
  • 2
  • 6
1
2