Underskor

[SOLVED] No Response From AIN

7 posts in this topic

Hi there,

I am running an AIN module from Core32, with a single pot connected. I have the AIN_CHANNEL_MASK set to 0x1, and the remaining 7 AIN inputs on the first 4051 grounded. When the pot is adjusted, MIOS Studio reports no activity (APP_AIN_NOTIFYCHANGE() includes debug message listing pin + value).

Touching pins on J5C causes jitter activity.

Touching pins on AIN:J5 also causes activity.

Letting the pot's 4051 input float causes jitter as expected.

SmashTV instructed me on #midibox to force the ABC mux control lines to 001 (A>Vd, B+C>Vs) and testing that pin 3 and 13 of the 4051 read the same (unsure how to do so, multimeter on Vs & pin 3/13, or on AIN input 1 and pin 3/13?)

Have swapped a couple of 4051s in and out with no change.

Note: attached pic was taken before setting up the mux control lines.

Hope you guys can help :)

Thanks,

Tom

post-7486-0-11091900-1312465921_thumb.jp

Edited by Underskor

Share this post


Link to post
Share on other sites

Anyone? :(

Your cable from core to AIN looks very unstable. You should remake that cable and clamp it down this time so we can rule that out as the culprit.

Share this post


Link to post
Share on other sites

Have been away for a while, exams and stuff. Back into it now though. Clamped the cable down and set the mux control lines up.

http://dl.dropbox.com/u/1907812/Images/IMAG0297.jpg

Now unable to get any activity, even jitter from floating inputs.

Still not 100% on how to do this:

SmashTV instructed me on #midibox to force the ABC mux control lines to 001 (A>Vd, B+C>Vs) and testing that pin 3 and 13 of the 4051 read the same (unsure how to do so, multimeter on Vs & pin 3/13, or on AIN input 1 and pin 3/13?)

Anything I can try?

Share this post


Link to post
Share on other sites

At my wits end here, spent the last few nights trying different things but I can't get anywhere.

  • Removed all 4051s but J5.A0, and grounded AIN:J5.A1-A3
  • Reflowed all AIN joints.
  • Been over the board with a magnifying glass, scraped/brushed between connections cleaned to make sure there were no rogue solder trails (it was light - didn't damage traces)
  • Removed breadboard from the equation.

Still getting a large, constant stream of jitter. I am also now getting an "Unrecognised USB device - device has malfunctioned" tooltip on windows XP which I wasn't getting before, however if I use the J27 jumper and load the Bootloader, this notification does not occur.

Here is an extract of the jitter so you can get an idea of the volume (if that's relevant):


[4598.587] APP_AIN_NotifyChange(6, 63)

[4598.588] APP_AIN_NotifyChange(0, 75)

[4598.588] APP_AIN_NotifyChange(2, 65)

[4598.588] APP_AIN_NotifyChange(4, 71)

[4598.588] APP_AIN_NotifyChange(6, 65)

[4598.589] APP_AIN_NotifyChange(0, 70)

[4598.589] APP_AIN_NotifyChange(2, 64)

[4598.589] APP_AIN_NotifyChange(4, 69)

[4598.589] APP_AIN_NotifyChange(6, 63)

[4598.590] APP_AIN_NotifyChange(0, 75)

[4598.590] APP_AIN_NotifyChange(2, 65)

[4598.590] APP_AIN_NotifyChange(4, 71)

[4598.590] APP_AIN_NotifyChange(6, 65)

[4598.591] APP_AIN_NotifyChange(0, 70)

[4598.591] APP_AIN_NotifyChange(2, 64)

[4598.591] APP_AIN_NotifyChange(4, 69)

[4598.592] APP_AIN_NotifyChange(0, 69)

[4598.592] APP_AIN_NotifyChange(6, 63)

[4598.593] APP_AIN_NotifyChange(0, 75)

[4598.593] APP_AIN_NotifyChange(2, 65)

[4598.593] APP_AIN_NotifyChange(4, 71)

[4598.593] APP_AIN_NotifyChange(6, 65)

[4598.594] APP_AIN_NotifyChange(0, 70)

[4598.594] APP_AIN_NotifyChange(4, 69)

[4598.595] APP_AIN_NotifyChange(0, 69)

[4598.595] APP_AIN_NotifyChange(2, 64)

[4598.595] APP_AIN_NotifyChange(6, 63)

[4598.596] APP_AIN_NotifyChange(0, 75)

[4598.596] APP_AIN_NotifyChange(2, 65)

[4598.596] APP_AIN_NotifyChange(4, 71)

[4598.596] APP_AIN_NotifyChange(6, 65)

[4598.597] APP_AIN_NotifyChange(0, 70)

[4598.597] APP_AIN_NotifyChange(2, 64)

[4598.597] APP_AIN_NotifyChange(4, 69)

[4598.597] APP_AIN_NotifyChange(6, 63)

[4598.598] APP_AIN_NotifyChange(0, 75)

[4598.598] APP_AIN_NotifyChange(2, 65)

[4598.598] APP_AIN_NotifyChange(4, 71)

[4598.598] APP_AIN_NotifyChange(6, 64)

[4598.599] APP_AIN_NotifyChange(0, 70)

[4598.599] APP_AIN_NotifyChange(2, 64)

[4598.599] APP_AIN_NotifyChange(4, 69)

[4598.599] APP_AIN_NotifyChange(6, 63)

[4598.600] APP_AIN_NotifyChange(0, 75)

[4598.600] APP_AIN_NotifyChange(2, 65)

[4598.600] APP_AIN_NotifyChange(4, 71)

[4598.600] APP_AIN_NotifyChange(6, 64)

[4598.601] APP_AIN_NotifyChange(0, 69)

[4598.601] APP_AIN_NotifyChange(2, 63)

[4598.601] APP_AIN_NotifyChange(4, 75)

[4598.602] APP_AIN_NotifyChange(0, 71)

[4598.602] APP_AIN_NotifyChange(4, 69)

[4598.603] APP_AIN_NotifyChange(0, 69)

[4598.603] APP_AIN_NotifyChange(4, 74)

[4598.604] APP_AIN_NotifyChange(0, 70)

[4598.604] APP_AIN_NotifyChange(4, 69)

[4598.605] APP_AIN_NotifyChange(0, 75)

[4598.605] APP_AIN_NotifyChange(2, 65)

[4598.605] APP_AIN_NotifyChange(4, 71)

[4598.606] APP_AIN_NotifyChange(0, 69)

[4598.606] APP_AIN_NotifyChange(2, 63)

[4598.606] APP_AIN_NotifyChange(4, 75)

[4598.607] APP_AIN_NotifyChange(0, 71)

[4598.607] APP_AIN_NotifyChange(4, 69)

[4598.608] APP_AIN_NotifyChange(0, 69)

[4598.608] APP_AIN_NotifyChange(4, 75)

[4598.609] APP_AIN_NotifyChange(0, 71)

[4598.609] APP_AIN_NotifyChange(4, 70)

[4598.610] APP_AIN_NotifyChange(0, 69)

[4598.610] APP_AIN_NotifyChange(4, 75)

[4598.611] APP_AIN_NotifyChange(0, 71)

[4598.611] APP_AIN_NotifyChange(2, 65)

[4598.611] APP_AIN_NotifyChange(4, 70)

[4598.612] APP_AIN_NotifyChange(0, 69)

[4598.612] APP_AIN_NotifyChange(6, 63)

[4598.613] APP_AIN_NotifyChange(0, 75)

[4598.613] APP_AIN_NotifyChange(4, 71)

[4598.613] APP_AIN_NotifyChange(6, 65)

[4598.614] APP_AIN_NotifyChange(0, 70)

[4598.614] APP_AIN_NotifyChange(4, 69)

[4598.615] APP_AIN_NotifyChange(0, 69)

[4598.615] APP_AIN_NotifyChange(2, 64)

[4598.615] APP_AIN_NotifyChange(6, 63)

[4598.616] APP_AIN_NotifyChange(0, 75)

[4598.616] APP_AIN_NotifyChange(2, 65)

[4598.616] APP_AIN_NotifyChange(4, 71)

[4598.616] APP_AIN_NotifyChange(6, 65)

[4598.617] APP_AIN_NotifyChange(0, 70)

[4598.617] APP_AIN_NotifyChange(2, 64)

[4598.617] APP_AIN_NotifyChange(4, 69)

[4598.617] APP_AIN_NotifyChange(6, 63)

[4598.618] APP_AIN_NotifyChange(0, 75)

[4598.618] APP_AIN_NotifyChange(2, 65)

[4598.618] APP_AIN_NotifyChange(4, 71)

[4598.618] APP_AIN_NotifyChange(6, 64)

[4598.619] APP_AIN_NotifyChange(0, 70)

[4598.619] APP_AIN_NotifyChange(2, 64)

[4598.619] APP_AIN_NotifyChange(4, 69)

[4598.619] APP_AIN_NotifyChange(6, 63)

[4598.620] APP_AIN_NotifyChange(0, 75)

[4598.620] APP_AIN_NotifyChange(2, 65)

[4598.620] APP_AIN_NotifyChange(4, 71)

[4598.620] APP_AIN_NotifyChange(6, 64)

[4598.621] APP_AIN_NotifyChange(0, 69)

[4598.621] APP_AIN_NotifyChange(2, 63)

[4598.621] APP_AIN_NotifyChange(4, 75)

[4598.622] APP_AIN_NotifyChange(0, 71)

Here's the relevant code.
#ifndef _MIOS32_CONFIG_H

#define _MIOS32_CONFIG_H


#define MIOS32_AIN_CHANNEL_MASK 0x000f

#define MIOS32_AIN_OVERSAMPLING_RATE  1

#define MIOS32_AIN_DEADBAND 31

#define MIOS32_AIN_DEADBAND_IDLE 127

#define MIOS32_AIN_IDLE_CTR 3000

#define MIOS32_AIN_MUX_PINS 1


#define MIOS32_AIN_MUX0_PIN   GPIO_Pin_4 // J5C.A8 - 4

#define MIOS32_AIN_MUX0_PORT  GPIOC

#define MIOS32_AIN_MUX1_PIN   GPIO_Pin_5 // J5C.A9 - 5

#define MIOS32_AIN_MUX1_PORT  GPIOC

#define MIOS32_AIN_MUX2_PIN   GPIO_Pin_0 // J5C.A10 - 0

#define MIOS32_AIN_MUX2_PORT  GPIOB


#endif
extern "C" void APP_AIN_NotifyChange(u32 pin, u32 pin_value)

{

	// toggle Status LED on each AIN value change

	MIOS32_BOARD_LED_Set(1, ~MIOS32_BOARD_LED_Get());


	// convert 12bit value to 7bit value

	u8 value_7bit = pin_value >> 5;


	// send MIDI event

	//MIOS32_MIDI_SendCC(DEFAULT, Chn1, pin + 0x10, value_7bit);


	//Send debug message

	MIOS32_MIDI_SendDebugMessage("APP_AIN_NotifyChange(%u, %u)", pin, value_7bit);

}

Pictures:

http://dl.dropbox.com/u/1907812/Images/IMAG0302.jpg

http://dl.dropbox.com/u/1907812/Images/IMAG0301.jpg

Share this post


Link to post
Share on other sites

The sheer amount of data sent can cause the USB connection to become unstable. USB power and 3.3V AINs have a tendency to lead to jitter. Cranking up the deadband a bit more of manually filtering the values might be a suitable workaround. Cleaner (non-usb-)power would probably stop the jitter.

Share this post


Link to post
Share on other sites

Success! Sidmonster was on the right track but I remade the wrong cable. >_<

After much help from SmashTV (he's going to hate me for this), it turns out that the culprit was this guy:

Header.jpg

It was connecting the mux control lines from the Core to the AIN, and 2 of the pins was slightly bent and had not broken through the cable and made a connection, which is why my control lines were only ever set to Low/Low/High and stuck reading J1.A5, not reading the single pot I had connected at J1.A0 (I think).

To read the pot, I forced the lines on AIN.J6 to High/Low/High (A to Vd, B to Vs, C to Vd) which corresponds to pin 5 of the 4051 (as seen in datasheet - page 4 truth table). Pin 5 of the 4051 is J1.A0 - my pot!

Looks to be working! Very happy. Big thanks to SmashTV and the guys on #midibox, it was all them. Hope this thread helps someone out one day!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now