Skip to content

spi_bit_bang:

This is a config file reference. Click for instructions.

This page is reference material which explains every setting and option for this section of an MPF yaml config file. See the instructions for config files for formatting and other details. See our guide to config file examples for more examples of real configs in action.

Valid in
machine config files YES ✅
mode config files NO 🚫

The spi_bit_bang: section of your config is where you configure the How to use SPI Bit Bang in MPF platform.

Required settings

The following sections are required in the spi_bit_bang: section of your config:

clock_pin:

Single value, type: string name of a digital_outputs: device. Defaults to empty.

This output is used to clock the SPI chip.

cs_pin:

Single value, type: string name of a digital_outputs: device. Defaults to empty.

This output is used to chip select the SPI chip. It usually also triggers the parallel read of the chip.

miso_pin:

Single value, type: string name of a switches: device. Defaults to empty.

This input is read serially to determine the state of your inputs.

Optional settings

The following sections are optional in the spi_bit_bang: section of your config. (If you don't include them, the default will be used).

bit_time:

Single value, type: time string (secs) (Instructions for entering time strings). Default: 50ms

How long should the platform wait until reading the miso_pin. Depending on your platform it might need a while to settle. Especially if your platform is connected via USB. If your inputs are local (i.e. on a RPi) this might be very short compared.

clock_time:

Single value, type: time string (ms) (Instructions for entering time strings). Default: 1ms

How long should the clock pulse be? 1ms is the lower limit for most platforms and more than long enough for any chip so this should be good.

debug:

Single value, type: boolean (true/false). Default: false

Set to true to get more debug output.

inputs:

Single value, type: integer. Default: 8

How many inputs should the platform read? Reading less inputs will result in faster updates.


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results