Skip to content

Using#

What To Get#

Qty Description Order Link Required
1 D-series Breakout Board Build your own Yes
1 pyboard D-series Microcontroller Micropython Yes
1 12V DC Power Supply Digi-Key Yes
1 USB cable Digi-Key Yes
1 DIN Rail Digi-Key
2 DIN Rail Adapter Digi-Key
4 M3 screws Digi-Key

First Time Setup#

Important HS USB setup

The breakout board is designed to use the pyboard's high speed USB interface. To ensure the correct usb mode is being used, we make a change to the boot.py file.

  1. Plug the bare pyboard D-series into your computer.
  2. It should appear as a flash drive on your computer. Edit the boot.py file to have the following:
    import pyb
    pyb.usb_mode('VCP',port=1)
    

This change to boot.py is required, otherwise the pyboard won't be found by the pyControl software when it is connected through the breakout board!

You are now ready to connect to the D-series Breakout board.

  1. Plug the pyboard onto the breakout board
  2. Plug 12V DC power into the breakout board
  3. Connect the breakout board to your computer with the USB

Connecting Peripheral Devices#

Refer to the table below when considering where to plug in devices. Fill up the top row first with standard devices that just need inputs or outputs. Use the second row for devices that require special communication (UART or I2C).

Note on interrupts

The pyboard microcontroller is limited to 16 separate interrupt vectors. All of the DIO pins on the top row of the breakout board (Ports 1-6) are on separate interrupt vectors, so if you have a lot of input devices, plug them into the top row where there is a guarantee of no interrupt vector collisions.

Note on SPI

If you need to connect to a peripheral using SPI, take a look at Micropython's machine.SoftSPI

The hardware SPI pins are unfortunately not grouped together on a single RJ45 jack on this breakout board, but instead are split up among multiple ports. If you absolutely need to access the hardware SPI pins, you can plug in multiple port adapters to expose the pins.

The following table desribes hardware SPI pin mapping.

SPI functionCPU namePin nameother pin nameD-series breakout portport function
SPI(1)SCKA5x6W68C
MISOA6x7W104A
MOSIA7x8W149B
SPI(2)SCKB13y6W492C
MISOC2y7W531A
MOSIC3y8W571B
https://store.micropython.org/media/products/PYBD_SF2_W4F2_ds2.jpg https://store.micropython.org/media/products/WBUS_DIP68_ds1.jpg

Example Task#

The following instructions will enable you to run the hardware_test.py task file that comes with pyControl. The task uses 3 nosepokes plugged into ports 1-3 and a houselight plugged into port 4.

  1. Download the latest version of pyControl
  2. Download breakout_dseries_1_6.py and place it in the devices\ directory
  3. Download new_hardware_definition.py and place it in the config\ directory
    .
    └─ pyControl
       ├ config
       │  └─ new_hardware_definition.py
       └─ devices
          └─ breakout_dseries_1_6.py
    
  4. Launch pyControl and press the "Connect" button to connect to the breakout board.
  5. Press the "Config" button and the "Load framework" button.
  6. Again, press the "Config" button. Press the "Load hardware definition" button and then select "new_hardware_definition.py" to upload.
  7. If successful, you should get a couple OK's confirming that the framework and hardware definition have been transferred.
  8. From the task dropdown, select "examples/hardware_test", then click "Upload".
  9. Click "Start". The houselight should turn on and nosepokes will now respond to pokes.