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.
- Plug the bare pyboard D-series into your computer.
- 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.
- Plug the pyboard onto the breakout board
- Plug 12V DC power into the breakout board
- 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.
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.
- Download the latest version of pyControl
- Download breakout_dseries_1_6.py and place it in the
devices\
directory - Download new_hardware_definition.py and place it in the
config\
directory. └─ pyControl ├ config │ └─ new_hardware_definition.py └─ devices └─ breakout_dseries_1_6.py
- Launch pyControl and press the "Connect" button to connect to the breakout board.
- Press the "Config" button and the "Load framework" button.
- Again, press the "Config" button. Press the "Load hardware definition" button and then select "new_hardware_definition.py" to upload.
- If successful, you should get a couple OK's confirming that the framework and hardware definition have been transferred.
- From the task dropdown, select "examples/hardware_test", then click "Upload".
- Click "Start". The houselight should turn on and nosepokes will now respond to pokes.