Connecting the OPL3 Duo! - DhrBaksteen/ArduinoOPL2 GitHub Wiki

The OPL3 Duo! can be used together with a lot of development platforms. Below you will find how to connect the board to your platform of choice.

The OPL3 Duo! works on either 5v or 3.3v. Make sure that the VCC voltage matches with the logic level voltage of your development board. For example 5v for Arduino and 3.3v for Teensy or Raspberry Pi.

Board type A21 A11 A01 MOSI SCK /WR1 /IC1
Arduino 6 7 8 11 or ICSP4 13 or ICSP3 10 9
Teensy2 6 7 8 11 13 10 9
Raspberry Pi / Orange Pi3 22 18 16 19 23 15 13
NodeMCU4 SD1 CLK

1 Pins A2, A1, A0, /WR and /IC can be remapped to other digital IO pins when you initialize the library. Pin numbers shown here are library defaults.

2 Teensy pinouts per board can be found at https://www.pjrc.com/teensy/pinout.html

3 On Raspberry Pi and Orange Pi the 3.3v and GND pins are located at pin 1 and 6 respectively of the GPIO header. You can also run ./connecting to get the pinout specifically for your Pi. By default SPI is disabled on most PIs. You can enable it in config by running sudo raspi-config and enabling SPI in the 'Interfacing Options' menu. Numbers shown in the table are the pin numbers of the GPIO header.

4 - On NodeMCU you need to manually configure the pins that are left blank in the table. For example you can use pins D4 through D8.

Other platforms

If your platform is not listed, but it is 100% Arduino compatible then you may still be able to use it with your OPL3 Duo board.

  1. If your board used 3.3v logic levels then I recommend connecting the VCC of the OPL3 Duo! with the 3.3v output of your development board.
  2. The SPI connections MOSI and SCK of the OPL3 Duo! should be connected to the first SPI bus of your development board. These may be called MOSI and SCK as well, or MOSI0 and SCK0 for example.
  3. The remaining pins of the OPL3 Duo! board (A0, A1, A2, /WR, /IC) can be connected to any free digital pins on your developement board. You can either look for the pins that are equivalent to the Arduino Uno pins from the table above, or you can map them to different pins when you create the OPL3Duo instance in the code. For example to map pin A2 to digital pin 2 on your development board, A1 to pin 1, A0 to pin 0, /WR to pin 3 and /IC to pin 4 the library instance is created as follows:
// OPL3Duo(byte a2, byte a1, byte a0, byte latch, byte reset);
OPL3Duo opl3Duo(2, 1, 0, 3, 4);
⚠️ **GitHub.com Fallback** ⚠️