Hot answers tagged

3

I initially amended everything to put out a dummy first byte and then just started at the second one. This worked but I was not happy with it. Trawled the internet lots more. Tried many things. No difference. Noticed that compared to the MCU downstream communications, the I2C to PI was very slow. About half the speed. Editing /boot/config.txt and amending: ...


2

For GPIO 2/3 (pins 3/5) to operate as the I2C bus they must be in a GPIO mode called ALT0. They are set to this mode when the Linux I2C/SMBus driver is loaded. The RPi.GPIO module is changing the mode of GPIO 2/3 to INPUT. This stops the proper operation of the I2C bus. You need to again set the mode to ALT0 for GPIO 2/3 for the bus to operate again. As ...


2

The mode of each pin is either in, out or any of the other functions (I2C in this case). Pins 3 and 5 are in ALT0 mode by default after reboot if the I2C driver is active. Type gpio readall on the command line to see which pins are in which mode. To do the same as gpio mode 8 alt0 gpio mode 9 alt0 in code, you need to do something like GPIO.setup(3, ...


1

DO NOT use ANY pullups! All Pi models come with 1.8kΩ pullup to 3.3V.


1

pigpio only provides PWM and servo pulses to the Pi GPIO on the expansion header. For the Pis with the 40 pin header this means (Broadcom) GPIO 0-27 inclusive. In practical terms I doubt you will have much joy using a MCP23017 to provide servo signals. It will be extremely difficult to time synchronise accurately on/off pulses over the relatively slow I2C ...


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