Discussion:
Raspberry pi 3b+ i2c
(too old to reply)
Gene Heskett
2021-10-22 20:40:03 UTC
Permalink
Hello,
I have installed debian 11 (Bullseye) 64 on my RPI 3b + and want to
use the i2c bus on the GPIO pins.
I2C can probably be done, but its not I2C thats the star on gpio pins,
its SPI, which can talk to a peripheral at 41 something megabaud using a
32bit packet format, and reading the 32 bit packet response at 25
megabaud. On either a pi3b or a pi4b.

It does use transmission line critical terminations but in 4 years of
running a 1500 lb industrial lathe with it, I have yet to log a mistaken
packet.
Is there a tutorial that covers installing the necessary files?
Get a modified buster install for arm64 dvd iso from linuxcnc.org is one
possibility, but you'll need a preempt-rt kernal, but I am useing a pi
built realtime preempt kernal on a raspian buster install.

I have spare blood, so I'm also running the master version of LinuxCNC,
updated at least daily, either self built from github, or from the
linuxcnc buildbot. Its pretty easy, the surprise to most is that I'm 87
yo.

Here is the sign--on showing the com rates when talking to a mesa 7i90HD
interface card over that SPI bus:
***@rpi4:/media/pi/workspace $ linuxcnc -l
LINUXCNC - 2.9.0-pre0-4830-gfaab5f10e
Machine configuration directory
is '/home/pi/linuxcnc/configs/sheldon-lathe'
Machine configuration file is '7i90-axis.ini'
Starting LinuxCNC...
Found file(REL): ./hm2-7i90-stepper.hal
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
hm2_rpspi: Platform: Raspberry Pi 4 Model B Rev 1.1
hm2_rpspi: Base address 0xfe000000 size 0x01800000
hm2_rpspi: Mapped peripherals from 0xfe000000 (size 0x01800000) to
gpio:0x0xb4200000, spi:0x0xb4204000, aux:0x0xb4215000
hm2_rpspi: SPI0/CE0 clock rate: 41666000/25000000 Hz, VPU clock rate:
500000000 Hz
hm2_rpspi: SPI0/CE0 write clock rate calculated: 41666666 Hz (clkdiv=12)
hm2_rpspi: SPI0/CE0 read clock rate calculated: 25000000 Hz (clkdiv=20)
hm2_rpspi: SPI0/CE0 Valid cookie matched
hm2_rpspi: SPI0/CE0 Base: hm2_7i90.0
hm2/hm2_7i90.0: Low Level init 0.15
hm2/hm2_7i90.0: MD 2: 3x IOPort v0: accepted, using 3
hm2/hm2_7i90.0: MD 0: 1x Hostmot2 DPLL v0: accepted, using 1
hm2/hm2_7i90.0: MD 1: 1x Watchdog v0: accepted, using 1
hm2/hm2_7i90.0: MD 3: 4x Encoder v2: accepted, using 4
hm2/hm2_7i90.0: MD 4: 2x PWMGen v0: accepted, using 1
hm2/hm2_7i90.0: MD 5: 4x StepGen v2: accepted, using 4
hm2/hm2_7i90.0: MD 6: 1x LED v0: accepted, using 1
hm2/hm2_7i90.0: 72 I/O Pins used:

That card goes on to define what those 72 i/0 pins are used for, but that
would be another 80 lines to decipher when not familiar with the
language...
Greetings,
Christian
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>
Uwe Kleine-König
2021-10-23 21:10:06 UTC
Permalink
Hello,
I have installed debian 11 (Bullseye) 64 on my RPI 3b + and want to use
the i2c bus on the GPIO pins.
Is there a tutorial that covers installing the necessary files?
Which peripheral do you have connected to which i2c bus? Assuming there
is a already a driver in den Debian kernel for your device the only
thing you need to do is to create an device-tree overlay, put it into
the firmware partition and let it apply by the right spell in config.txt.

Best regards
Uwe

Loading...