OK there's a lot on the NeoTrellis M4 - so hold tight while we take a tour
On the front side of the NeoTrellis is a 4x8 grid of NeoPixels and round gold inter-digit pads for elastomer buttons.
The NeoPixels are chained together, and connect in a zig-zag. The first pixel is in the top left, the last pixel is on the bottom right. In Arduino, the NeoPixels are on pin 10, in CircuitPython they are on on
You can use any NeoPixel library you like. Note that FastLED does not at the time of this writing, support the NeoTrellis M4. We do have a DMA NeoPixel library in Arduino that will take care of writes for you without processor time, and we recommend that!
The elastomer pads require buttons to sap on top. There's holes in the PCB that nubs from our Trellis pads fit into. You'll need two 4x4 pads:
The buttons are set up in a 4 x 8 matrix, there are 4 rows and 8 columns. Each button has a back-stop diode so you can press any/all keys at the same time without any 'ghosting'.
In CircuitPython, the rows/columns are on
In Arduino the 4 rows are on pin 14-17 and the 8 columns are on pins 2-9
(We recommend just using our libraries to read the matrix instead of DIYing)
Each NeoTrellis M4 comes with the main processor
- ATSAMD51 32-bit Cortex M4 core running at 120 MHz (32-bit, 3.3V logic and power)
- Hardware DSP and floating point support
- 512 KB flash, 192 KB RAM
At the top of the board there's a micro USB port, used for debugging/uploading code and is a native USB devices so it can act as a true USB MIDI device if you like. At the time of this writing only Arduino support has USB MIDI but we hope to add it to CircuitPython as well.
There is a 500mA fuse on the USB port which will throw when more than 1A is drawn, to protect any device you plug the NeoTrellis into.
For on-board storage of audio files, code, or whatever else you like, there's also a 8 MB QSPI FLASH chip. In general we tend to use this only in CircuitPython because it appears as a USB disk drive. However, you can use it in Arduino, you just will need to load CircuitPython temporarily if you want to drag-n-drop files on and off
Unlike most button boards, the NeoTrellis M4 has built in audio generation/output and input
The SAMD51 has a dual DAC - that's two 12-bit, 500KSPS 'true analog' outputs and we connected them to left and right on a standard headphone jack. You're not going to get audiophile-quality outputs from two 12-bit DACs but you can certainly play audio clips and make beeps and bloops. They are AC coupled with a 100uF capacitor, and have a small divider so that the output is about line level.
Since the DAC pins are also ADC pins you could also use the left/right for audio line level input if you so choose. In that case, the same DAC channels can be used in ADC mode, the inputs are AC coupled and then biased to a 1.65V center.
The left channel is on Arduino A1 or CircuitPython
board.A1. The right channel is on Arduino A2 or CircuitPython
If you want to have some audio inputs, the 4th pin on the headphone jack is for microphone or line in. If you have a classic 'mobile phone headset', the electret mic will go through a MAX4466 electret amplifier with 100x gain into an ADC pin. Again, it's not audiophile quality (we're talking about an electret mic here) but you can do audio recording and filtering on the mono input.
The raw un-amplified mic input is also connected to an ADC so you can read button presses on headsets that have a resistor-selector for their buttons, or some other 3.3V-max analog signal. In general, the DC bias will be about 2.5VDC when a microphone is plugged in. When pressed, the 'center' pause button on headsets will set the DC bias on this pin to ground.
If you have an Android (not Apple) headset with up/down buttons as well, the bias shift to 1.7V and 0.9V (approximately) so you can detect those button presses. Apple headsets send digital chirps on the up/down buttons and we don't have code or hardware to decode those!
On Arduino, the amplified microphone signal is on PIN_MIC and the raw DC signal is available on PIN_MIC_RAW. With CircuitPython use
If you want to plug in some custom hardware, we make it easy with a 4 pin JST hacking port, available for extra add-ons. It's STEMMA and Grove compatible, and provides GND, 3.3V power, and two pins that can be used for I2C, ADC, or a UART.
If you're using Arduino, the two GPIO are available on PIN_WIRE_SDA and PIN_WIRE_SCL for I2C usage, or A4 and A5 for analog reading.
On CircuitPython, you can use
There are also pads around the PCB which provide VIN, GND, SDA, SCL as well as a fifth pin, INT, in case you want to extend the NeoTrellis M4 with extra NeoTrellis boards. (This is advanced and we don't have any documentation/tutorials on how to do it)
To add more interactivity, a precision triple-axis accelerometer from Analog Devices, the ADXL343, is included as well, and provides sensor information on tilt, motion, or tapping. Great for adding another dimension of data input in addition to the button pads.
This sensor is on a separate I2C port, which is available in Arduino under Wire1 or in CircuitPython under
There's a small reset button on the back of the PCB, you can double-click it to enter the bootloader.
We also have a spot for an SWD port. We didn't solder this in because most people don't need it and it would keep the case from being nice n slim. You can solder a 2x5 0.05" connector if you like to use SWD debugging