MIDIbox Hardware Platform, AINSER8 Module
MBHP_AINSER8 is a reduced version of the MBHP_AINSER64 module without 1-to-8 multiplexers and on-board VR, and only supported by MIOS32!
It is based on the 8-channel ADC MCP3208 from Microchip. It can be used to scan pots and/or faders with 12bit resolution between 0 and 5V.
The accuracy and especially the signal/noise ratio is much better compared to the internal ADCs of STM32 or LPC17 for insignificantly higher costs (+ 3 EUR).
Another advantage is the improved scalability. While with the previous MBHP_AIN module the maximum number of scannable inputs was limited by the number of on-chip ADC channels, the new approach allows to access multiple MBHP_AINSER64 and MBHP_AINSER8 modules from the same microcontroller.
The ADC is accessed via SPI (e.g. J19 of the MBHP_CORE_LPC17 or MBHP_CORE_STM32F4 module).
Multiple MBHP_AINSER8 (or MBHP_AINSER64) modules are connected to J19 in parallel, and accessed by strobing dedicated chip select lines. J19 provides two chip selects (called "RC1" and "RC2"), if more modules should be scanned, common IO pins could be used for the same purpose (e.g. available at J5). To programmers: alternatively, AINSER* modules could be chained, or a 3-to-8 MUX could be used for accessing 8 modules via 3 IO pins of the microcontroller.
Accuracy: if directly powered from the MBHP_CORE_LPC17 module, values are jittering by ca. +/-1..2 LSBs (for comparison: the on-chip ADCs of STM32 and LPC17 are jittering by at least +/- 16). Accordingly, the effective resolution which can be used for MIDI controller purposes is 10 bit. Such a high resolution is especially useful for PitchBender and NRPN messages.
Powering the module via USB (provided at J19 by the core module) is sufficient. It's recommended to use a "selfpowered" USB Hub like this one from Reichelt. It also decouples the power from the (noisy) PC supply, and allows to run the MIDIbox without a PC connection.
Following interfaces are provided by the AINSER64 module:
||No. of pins
||Serial input which is usually connected to J19 of the MBHP_CORE_LPC17 or MBHP_CORE_STM32F4 module.|
||Serial output which could be used to chain multiple MBHP_AINSER* modules.
Please note: the standard AINSER driver for MIOS32 doesn't support this method! Instead it expects that multiple modules are connected to J19 in parallel, and that they are using dedicated chip select lines (selected via jumper J4)!
||A jumper has to be connected to this port to select the first or second chip select line of J2 for accessing the ADC.
||8 analog inputs and 5V (=Vd) / Ground (=Vs) connections.
Please note: all unused analog inputs have to be clamped to ground (Vss), otherwise your MIDIbox will send out a lot of random MIDI events!
Solder following components:
Important: the jumper have to be stuffed to get the module working!
- R1 = 10 Ohm
- C4, C6 = 100 nF
- C5 = 10 uF (check the polarity!)
- Red "Supply" LED (polarity! Long leg is + (Anode)), it shows to the 470 Ohm resistor
- the 16 pin socket for the MCP3208
- the three 2x5 DIL headers J2, J3 and J6
- the 3-pin SIL header J4 for chip select
Usually J4 selects Chip Select line 1.
Finally connect your finished AINSER64 module to J19 of the core module with a ribbon cable.
This can be done during runtime ("hot plug&play"), a reboot isn't required.
After J2 of the AINSER8 module has been connected to J19 of the core module, the red "supply" LED should turn on. If it stays off, check the voltage between the Vs and Vd pin of J2 with a multimeter, it should be ca. 5V. Yes: check that the LED has been soldered with the right polarity (the long leg is anode and should be soldered with the pin which is marked with + and should show to the 470 Ohm resistor).
Sidenote (for the case this isn't obvious to you): the outer pins of a pot have to be connected to +5V (Vd) and Ground (Vs) - this voltage is available at the J6 port. The middle pin of the pot has to be connected to one of the A0/A1/...A7 pins of J6.
Please keep also in mind that all unusued analog inputs have to be clamped to ground, otherwise the application will flood the MIDI monitor with random CC values!
The next step is to upload an application for testing the analog inputs. At the MIOS32 Download Page you will also find a diagnosis application which measures the jitter for each analog input. It allows to check the quality of the power supply that you are using. After the upload of "ainser_jitter_mon" the MIOS Terminal will periodically output the minimum and maximum value which has been converted in between 1 second (1000 samples) + the difference (-> the jitter):
Although this application has been originally developed for the MBHP_AINSER64 module, it can also be used for MBHP_AINSER8.
Most important terminal commands:
- check_module: type "check_module 1" to check the first module, or "check_module 2" to check the second module
- check_mux: type "check_mux 1" ... "check_mux 8" to select the analog input pin (and *not* a multiplexer):
1=J6.A0, 2=J6.A1, 3=J6.A2, 4=J6.A3, 5=J6.A4, 6=J6.A5, 7=J6.A6, 8=J6.A7
- help: to display all available commands
Last update: 2017-04-09
Copyright © 1998-2017, Thorsten Klose. All rights reserved.