Hi All,
I want to use the 4051 multiplexer with the Patch SM. I got it working on the Pod and to a certain point on the SM, but im getting some weird behaviour.
Channel 2 is the Pod, with the pin selection voltage going from 0 to 3.3v, all good. Channel 1 is the Patch SM going from about -.5 to 1.3v. it doesnt even flip the select pin on the mux.
On slect pin 3 there is also a weird drop.
Here is my initialization code, although its pretty much the same one I use for the Pod:
Any thoughts?
static constexpr dsy_gpio_pin DUMMYPIN = {DSY_GPIOX, 0};
static constexpr dsy_gpio_pin PIN_ADC_CTRL_1 = {DSY_GPIOA, 3};
static constexpr dsy_gpio_pin PIN_ADC_CTRL_2 = {DSY_GPIOA, 6};
static constexpr dsy_gpio_pin PIN_ADC_CTRL_3 = {DSY_GPIOA, 2};
static constexpr dsy_gpio_pin PIN_ADC_CTRL_4 = {DSY_GPIOA, 7};
static constexpr dsy_gpio_pin PIN_ADC_CTRL_5 = {DSY_GPIOB, 1};
static constexpr dsy_gpio_pin PIN_ADC_CTRL_9 = {DSY_GPIOA, 1};
/** Order of pins to match enum expectations */
dsy_gpio_pin adc_pins[] = {
PIN_ADC_CTRL_4,
PIN_ADC_CTRL_5,
PIN_ADC_CTRL_9,
};
/** ADC Init */
AdcChannelConfig adc_config[4];
for(int i = 0; i < 3; i++)
{
adc_config[i].InitSingle(adc_pins[i]);
}
adc_config[3].InitMux(PIN_ADC_CTRL_4,
8,
PIN_ADC_CTRL_1,
PIN_ADC_CTRL_2,
PIN_ADC_CTRL_3);
// Order of pots on the hardware connected to mux.
size_t pot_order[8] = {0, 1, 2, 3, 4, 5, 6, 7};
for(size_t i = 0; i < 8; i++)
{
knob[i].Init(adc.GetMuxPtr(3, pot_order[i]), AudioCallbackRate());
}
adc.Init(adc_config, 4);
/** Control Init */
for(size_t i = 0; i < 3; i++)
{
controls[i].Init(adc.GetPtr(i), callback_rate_);
}