NAME
hm2_rpspi - LinuxCNC HAL driver for the Mesa Electronics SPI Anything IO boards, with HostMot2 firmware.SYNOPSIS
loadrt
hm2_rpspi
- config [default: ""]
- HostMot2 config strings, described in the hostmot2(9) manpage.
- spiclk_rate [default: 31250]
- Specify the SPI clock rate in kHz. See SPI CLOCK RATES below.
- spiclk_rate_rd [default: -1 (same as spiclk_rate)]
- Specify the SPI read clock rate in kHz. Usually you read and write at the same speed. However, you may want to reduce the reading speed if the round-trip is too long (see SPI CLOCK RATES below).
- spiclk_base [default: 400000000]
- This is the SPI clock divider calculation fallback value.
Usually, the base rate is read from
/sys/kernel/debug/clk/vpu/clk_rate and used in the divider
calculation (for the Rpi3 it should be 250 MHz). The
spiclk_base is only used as a fallback if the system's
cannot be read. It is normally safe (and recommended) that you leave this
parameter as is.
- spi_pull_miso [default: 1 (pull-down)]
- spi_pull_mosi [default: 1 (pull-down)]
- spi_pull_sclk [default: 1 (pull-down)]
- Enable or disable pull-up/pull-down on the SPI lines. A value of 0 disables any pull-up/down on the pin. A value of 1 means pull-down and 2 means pull-up. The chip enable line(s) are always pull-up enabled.
- spi_probe [default: 1]
- Probe SPI port and CE lines for a card. This is a bit-field
indicating which combinations of SPI and CE should be probed:
- 1 = SPI0/CE0,
- 2 = SPI0/CE1,
- 4 = SPI1/CE0,
- 8 = SPI1/CE1,
- 16 = SPI1/CE2. The probe is performed exactly in above order. Any boards found will be numbered 0...4 in the order found. See also INTERFACE CONFIGURATION below. It is an error if a probe fails and the driver will abort. The SPI0/SPI1 peripherals are located at GPIO pins (with 40-pin I/O header pin-number in parentheses):
- SPI0: MOSI=10(19), MISO=9(21), SCLK=11(23), CE0=8(24), CE1=7(26)
- SPI1: MOSI=20(38), MISO=19(35), SCLK=21(40), CE0=18(12), CE1=17(11), CE2=16(36)
- spi_debug [default: -1]
- Set the message level of the running process. The message level is set if spi_debug is set to a positive value between 0 and 5, where 0 means no messages at all and 5 means everything. A value of -1 does not touch the current message level. Caveat Emptor: changing the message level is process-wide and all modules within the process will spit out messages at the requested level. This may cause quite some clutter in your terminal.
DESCRIPTION
hm2_rpspi is a device driver for the Raspberry Pi 2/3 that interfaces Mesa's SPI based Anything I/O boards (with the HostMot2 firmware) to the LinuxCNC HAL. This driver is not based on the linux spidev driver, but on a dedicated BCM2835-SPI driver.INTERFACE CONFIGURATION
Up to five devices (7i90 boards) are supported. Two on SPI0 and three on SPI1. It is recommended that you, at most, use two devices and each device connected to a separate SPI port. You can choose which CE lines you prefer or fit the design and setup the spi_probe parameter to instruct the driver where to search for the board(s).REALTIME PERFORMANCE OF THE BCM2835-SPI DRIVER
TBD.SPI CLOCK RATES
The maximum SPI clock of the BCM2835-SPI driver and the 7i90 is documented over 32MHz. The SPI driver can provide frequencies well beyond what is acceptable for the 7i90. A safe value to start with would be 12.5 MHz (spiclk_rate=12500) and then work your way up from there.- 62500 - 62.500 MHz,
- 41667 - 41.667 MHz,
- 31250 - 31.250 MHz,
- 25000 - 25.000 MHz,
- 20834 - 20.833 MHz,
- 17858 - 17.857 MHz,
- 15625 - 15.625 MHz,
- 13889 - 13.889 MHz,
- 12500 - 12.500 MHz,
- 11364 - 11.364 MHz,
- 10417 - 10.417 MHz,
- 9616 - 9.615 MHz,
- ....
echo -n 1200000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo -n performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
SEE ALSO
hostmot2(9)LICENSE
GPL2017-06-05 | LinuxCNC Documentation |