i2c_remarks.txt             2024-12-12

Setup
=====
1. RPi-400
   Ethernet with DHCP network
   Power
2. HDMI LCD screen
   see: 192.168.0.80
3. remote:
   # mcedit /ets/hosts
   192.168.0.80   rpi400
4. $ ping rpi400
   $ ssh pi@rpi400 : pi
   $ vncviewer
5. Remote Thonny:
   Thonny | Tools | Options | kind = Remote Python 3 (SSH),
   host = rpi400, user name = pi, interpreter = /home/pi/work/venv311/bin/python
   OK
   see: Python 3.11.2 ... on rpi400 >>>


RPi Linux
=========
1. # apt install i2c-tools
   $ i2cdetect -y 1
   (connect PCF8574 to Pin-1 3V3 .. Pin-9 Gnd)
2. connect led between Pin-6 GND and Pin-8 GPIO-14
   depricated: use of /sys/class/gpio = sysfs interface from debian bookworm
   # echo 14  > /sys/class/gpio/export           enable GPIO-14
   # echo out > /sys/class/gpio/gpio14/direction
   # echo 1   > /sys/class/gpio/gpio14/value
   # cat        /sys/class/gpio/gpio14/value
   # echo 14  > /sys/class/gpio/unexport
3. $ ls /dev/gpiochip*
   (openSUSE: # zypper install libgpiod)
4. $ gpiodetect
   $ gpioinfo gpiochip0
5. $ gpioset gpiochip0 14=1
   $ gpioset 0 14=1
   $ gpioset 0 14=0
6. $ gpioget 0 9



RPi Python:
   RPi.GPIO         # no real time                    sysfs file based GPIO, depricated
   pigpiod          # typ 50 uSec  RPi4 @ 1.5 GHz     C GPIO client/server
   libgpiod         # typ  7 uSec  RPi4 @ 1.5 GHz     gpiod memory access
Micropython:
   native           # typ  2 uSec  Esp32s2 @ 240 MHz  module machine

standard mode   = 100 kHz
fast     mode   = 400 kHz
fast mode plus  = 1 MHz
high speed mode = 3.4 MHz

maximum length (standard mode)
   load      : < 100 pF
   connectors: 50 pF, cable 20 pF / meter
   length    : 1 .. 2.5 meter
   extend:
      current pull-up rather then resistors
      drivers to bridge sections
