Grove

The Grove peripherals can be accessed on Pmod pins using the PYNQ Grove Adapter and on Arduino pins using the PYNQ Shield.

Block Diagram

Pmod

The first option for connecting Grove peripherals uses the Pmod PYNQ MicroBlaze. Grove devices can be connected to a board through the Pmod ports using the PYNQ Grove Adapter.

../_images/pmod_grove_adapter.jpg

On the PYNQ Grove Adapter G1 and G2 map to Pmod pins [0,4] and [1,5], which are connected to pins with pull-down resistors. Ports G1 and G2 support the SPI protocol, GPIO, and timer Grove peripherals, but not IIC peripherals. Ports G3 and G4 map to pins [2,6], [3,7], which are connected to pins with pull-up resistors and support the IIC protocol and GPIO peripherals.

../_images/adapter_mapping.JPG
Peripheral Grove Port
I2C G3, G4
SPI G1, G2

Arduino

The second option for connecting Grove peripherals uses the Arduino PYNQ MicroBlaze.

../_images/arduino_iop.jpg

Grove devices can be connected to a board through the Arduino interface using the PYNQ Shield.

../_images/arduino_shield.jpg

On the PYNQ Shield there are 4 IIC Grove connectors (labeled I2C), 8 vertical Grove Connectors (labeled G1-G7 and UART), and four horizontal Grove Connectors (labeled A1-A4). The SCL and SDA pins are connected to the SCL and SDA pins on the Arduino header.

The following table maps Grove Ports to communication protocols.

Peripheral Grove Port
UART UART
I2C A4, I2C (x4)
SPI G7, G6
GPIO UART, G1 - G7

A list of drivers provided for Grove peripherals can be found in pynq.lib.pmod Package for the PYNQ Grove Adapter and in pynq.lib.arduino Package for the PYNQ Shield.

Examples

In Base Overlay, two Pmod instances are available: PMODA and PMODB. After the overlay is loaded, the Grove peripherals can be accessed as follows:

from pynq.overlays.base import BaseOverlay
from pynq.lib.pmod import Grove_Buzzer
from pynq.lib.pmod import PMOD_GROVE_G1

base = BaseOverlay("base.bit")

grove_buzzer = Grove_Buzzer(base.PMODB,PMOD_GROVE_G1)
grove_buzzer.play_melody()

More information about the Grove drivers in the Pmod subpackage, the supported peripherals, and APIs can be found in pynq.lib.pmod Package.

For more examples using the PYNQ Grove Adapter, see the notebooks in the following directory on the board:

<Jupyter Dashboard>/base/pmod/

In Base Overlay, one Arduino PYNQ MicroBlaze instance is available. After the overlay is loaded, the Grove peripherals can be accessed as follows:

from pynq.overlays.base import BaseOverlay
from pynq.lib.arduino import Grove_LEDbar
from pynq.lib.arduino import ARDUINO_GROVE_G4

base = BaseOverlay("base.bit")

ledbar = Grove_LEDbar(base.ARDUINO,ARDUINO_GROVE_G4)
ledbar.reset()

More information about the Grove drivers in the Arduino subpackage, the supported peripherals, and APIs can be found in pynq.lib.arduino Package.

For more examples using the PYNQ Shield, see the notebooks in the following directory on the board:

<Jupyter Dashboard>/base/arduino/