seanshpark / at89c2051

play with AT89C2051 and AT89C4051
Apache License 2.0
0 stars 0 forks source link

I2C software implementation as "target" #13

Open seanshpark opened 3 days ago

seanshpark commented 3 days ago

Use 2051/4051 as I2C client.

seanshpark commented 3 days ago

Although running on 24MHz, normal C code implementation doesn't catch I2C speed. With RPi software I2C, user defined clock speed is available.

Add this to /boot/firmware/config.txt

dtoverlay=i2c-gpio,bus=6,i2c_gpio_sda=22,i2c_gpio_scl=23,i2c_gpio_delay_us=100

100 will give about 2KHz clock.

Read /boot/firmware/overlays/README i2c-gpio section about the parameters.