jmamma / MegaCommand_Design

MegaCommand MIDI Controller
Other
74 stars 11 forks source link

MCL / button and encoder test fail #12

Closed zerkalo06 closed 3 years ago

zerkalo06 commented 3 years ago

Hello Justin and Yatao,

I create this issue after having a conversation with Justin on the elektronaut forum.

At first I had a problem with the sram test, but now after reflowing the ic everything is fine. I then tried the button and encoder test and I got nothing from the serial monitor, so I checked the SN74LS165AN chips and I got those results (those are in volt of course, even tho I didn't specify it) :

Results megacommand top_bottom

I maybe have to check again and de-solder again the male headers as I don't get the same results from those now, 0v all across apart for 47 and +5. Maybe it's just due to the amount of solder, my voltmeter is not that great. Isn't it strange the sram test is still working ?

Here are the pics of my pcb (I replaced one 0,1uf capacitor missing by another ceramic one I had left) :

20201124_161247 20201124_161258

Thanks for your help, and great great work you doing here !

zerkalo06 commented 3 years ago

a better quality for my results doc :

megacommand_1_0_2a12_top_bottom.pdf

jmamma commented 3 years ago

Better check the basics first.

After compiling MegaCommand Button & Encoder Test Firmware:

Sketch uses 2052 bytes (0%) of program storage space. Maximum is 253952 bytes. Global variables use 190 bytes (2%) of dynamic memory, leaving 8002 bytes for local variables. Maximum is 8192 bytes.

Serial Monitor should be set to 9600 BAUD.

zerkalo06 commented 3 years ago

I checked. Everything is has intended.

jmamma commented 3 years ago

megacommand_switching_circuit

Circuit diagram for reference

jmamma commented 3 years ago

Background:

The two shift registers are cascaded together to form a 16bit register. Each bit is representative of the state of a switch (encoder, encoder button or button). The 16 signals from each of the switches INS[0-15] are connected in parallel to the inputs across both shift registers.

The data is streamed serially to the arduino and read via pin PL0.

Troubleshooting:

1) Can you verify the orientation of resistor arrays R1 and R2. The circular mark on the resistor array(s) should be inline with the pin closest to the bottom of the board. The text should be visible from the right side of the board when viewed from above.

zerkalo06 commented 3 years ago

Thanks for the background infos !

If I understand you well R1 and R2 seems to be fine (english is not my first language, I might make mistakes).

20201126_111541

jmamma commented 3 years ago

yes they look okay.

jmamma commented 3 years ago

Next step is to verify the continuity of the traces between IC3 and the Arduino. The pin numbers for IC3 are located in the schematic above.

Compare with physical orientation of the chip in the datasheet below. https://www.ti.com/lit/ds/symlink/sn54ls165a-sp.pdf?ts=1606345017499&ref_url=https%253A%252F%252Fwww.google.com%252F

(Use your multimeter to measure resistance. make sure the traces read close to 0 ohms.)

Please check: PL0, PL1, PL2

Arduino Mega 2560 Pinouts

Please measure from the solder points on the MegaCommand, and on the arduino itself.

zerkalo06 commented 3 years ago

R1 and R2 pins are measuring approx. 0 ohms , so that's good.

I got PL0 = 0v PL1 = 4,80v PL2 = 3,92v

Orientation is good for IC3, and measures seems to match with INS (0v all across, apart for SH/LD (4,82v) and CLK (3,90v))

Also from CLK to PL2 = 0,86v

jmamma commented 3 years ago

I got PL0 = 0v PL1 = 4,80v PL2 = 3,92v

Voltages won't be much use here. You need to check the continuity of the traces on the PCB to check for damage. We need to see that there is a clear connection between IC3 and the Arduino.

(Use your multimeter to measure resistance. make sure the traces read close to 0 ohms.)

Please check: PL0, PL1, PL2

zerkalo06 commented 3 years ago

Sorry I didn't understand the first time.

So

PL1 = 0 / PL1 = 0 / PL2 = 0

But there is problems of connection from IC3 to the arduino. None of them are working (results = 1). There is a white kind of dot on the circuit near IC3. I don't think it's flux residue, it look more like paint, it's encrusted in the board. I may have to clean it, maybe it's what causing the connection problem.

20201128_165938

yatli commented 3 years ago

What do you mean by results = 1?

yatli commented 3 years ago

Also, I recommend using the continuity mode (the "beep mode") if your multimeter has one. Put the two probes on the two target pins and it will beep if the two pins are connected by a path. The signal path is a thing between two locations in a circuit, so that's why I don't understand your result=1 thing -- result=1 against which pin?

Currently you should measure that the correct pairs of locations are connected together: PL1 <-> IC3 SH/LD: image

PL1 <-> IC2 SH/LD: image

PL0 <-> IC3 QH: image

PL2 <-> IC2 CLK: image

PL2 <-> IC3 CLK: image

If all of these are connected well, you'll at least get something out of the serial console.

zerkalo06 commented 3 years ago

1 means its disconnected, and 0 that the path is connected, on ohm mode as my multimeter don't have continuity mode. I hope I use it properly. Only did few electronic pedals before this project, working with sound for troubleshooting, so I'm not used to it. Thanks for taking the time, and being patient : )

So

PL1 <-> IC3 = 0
PL1 <-> IC2 = 0
PL0 <-> IC3 = 0
PL2 <-> IC2 = 0
PL2 <-> IC3 = 0

IC2 SER <-> arduino GND = 0 IC2 A <-> INS 0 = 1 IC2 B <-> INS 1 = 1 IC2 C <-> INS 2 = 1 IC2 D <-> INS 3 = 1 IC2 E <-> INS 4 = 1 IC2 F <-> INS 5 = 1 IC2 G <-> INS 6 = 1 IC2 H <-> INS 7 = 1 IC2 INH <-> C1 = 0,01

IC2 QH <-> IC3 SER = 0

IC3 SER <-> arduino GND = 0 IC3 A <-> INS 8 = 1 IC3 B <-> INS 9 = 1 IC3 C <-> INS 10 = 1 IC3 D <-> INS 11 = 1 IC3 E <-> INS 12 = 1 IC3 F <-> INS 13 = 1 IC3 G <-> INS 14 = 1 IC3 H <-> INS 15 = 1 IC3 INH <-> C2 = 0,01

jmamma commented 3 years ago
PL1 <-> IC3 = 0
PL1 <-> IC2 = 0
PL0 <-> IC3 = 0
PL2 <-> IC2 = 0
PL2 <-> IC3 = 0

Did you measure these from the solder points on the Arduino Mega?

jmamma commented 3 years ago

--

If the above criteria are met, then by process of elimination that suggest either

yatli commented 3 years ago

IC2/IC3 orientation looking good:

image

zerkalo06 commented 3 years ago

Yes, I measured from the solder point of the pcb and the arduino.

yatli commented 3 years ago
IC2 SER <-> arduino GND = 0
IC3 SER <-> arduino GND = 0

IC2 out and IC3 serial input shorted to ground.

zerkalo06 commented 3 years ago

Sorry, that's just a typo, that's what I meant (I verified, it's still good)

yatli commented 3 years ago

So, IC3 SER <-> arduino GND = 1, correct?

IC2 SER <-> GND=0 is fine.

zerkalo06 commented 3 years ago

Yes, that's correct

and IC2 QH <-> IC3 SER = 0

yatli commented 3 years ago
IC2 A <-> INS 0 = 1
IC2 B <-> INS 1 = 1
IC2 C <-> INS 2 = 1
IC2 D <-> INS 3 = 1
IC2 E <-> INS 4 = 1
IC2 F <-> INS 5 = 1
IC2 G <-> INS 6 = 1
IC2 H <-> INS 7 = 1

IC3 A <-> INS 8 = 1
IC3 B <-> INS 9 = 1
IC3 C <-> INS 10 = 1
IC3 D <-> INS 11 = 1
IC3 E <-> INS 12 = 1
IC3 F <-> INS 13 = 1
IC3 G <-> INS 14 = 1
IC3 H <-> INS 15 = 1

These are suspicious. Should be all 0. But it isn't quite possible that none of these are connected...

zerkalo06 commented 3 years ago

When we're talking about INS1 INS2 etc, we are talking about those ones right ? I checked everything again, same results.

20201129_085925

yatli commented 3 years ago

No, these are arduino pin numbers, which we're not using. Instead we are using the RAW ATMega2560 pin numbers, as shown by @jmamma.

INS pins for the encoders:

image

yatli commented 3 years ago

INS pins for the buttons:

image

zerkalo06 commented 3 years ago

Okay my bad. Here we go :

IC2 A <-> INS 0 = 0 IC2 B <-> INS 1 = 0 IC2 C <-> INS 2 = 0 IC2 D <-> INS 3 = 0 IC2 E <-> INS 4 = 0 IC2 F <-> INS 5 = 0 IC2 G <-> INS 6 = 0 IC2 H <-> INS 7 = 0

IC3 A <-> INS 8 = 0 IC3 B <-> INS 9 = 0 IC3 C <-> INS 10 = 0 IC3 D <-> INS 11 = 0 IC3 E <-> INS 12 = 0 IC3 F <-> INS 13 = 0 IC3 G <-> INS 14 = 0 IC3 H <-> INS 15 = 0

zerkalo06 commented 3 years ago

Soooo, I don't understand everything seems good ...

I tried the test again but still nothing on the serial monitor.

yatli commented 3 years ago

Measure the resistance between these two: image

Ensure it's neither 0 or infinite, but something around 10K. Check your multimeter and ensure you're on the right scale. Can you shot a picture of your multimeter?

We still have a few measurements to make before deciding that this is a magical failure :)

zerkalo06 commented 3 years ago

ooof thank god I was ready to cast a spell on that circuit

I get 9.98k for the resistance.

My multimeter is cheap, I'm planning to get a better one soon :

20201129_095742

yatli commented 3 years ago

Okay, resistor array is installed correctly.

yatli commented 3 years ago

Next, we should isolate the problem of IC, and the buttons/encoders. Securely connect the Arduino, give it power with USB. Turn your multimeter to DC voltage 20.

Put the probes to the marked locations, and press the button marked in purple:

image

And see if the voltage changes.

zerkalo06 commented 3 years ago

The voltage doesn't change, it stays at 0v. (It does change when in ohms, from 13.40 ohms to 0 ohms)

yatli commented 3 years ago

With 0v for the button IN, it's more likely a button/board problem rather than a faulty IC. Disconnect USB and arduino, check all INS <-> GND Note: you can keep the black probe at the marked black arrow. It's connected to the arduino GND.

zerkalo06 commented 3 years ago

I got :

0 INS <-> GND = 14.99 ohm 1 INS <-> GND = 14.99 ohm 2 INS <-> GND = 14.99 ohm 3 INS <-> GND = 15 ohm 4 INS <-> GND = 14.99 ohm 5 INS <-> GND = 0 ohm 6 INS <-> GND = 14.99 ohm 7 INS <-> GND = 0 ohm 8 INS <-> GND = 14.99 ohm 9 INS <-> GND = 15 ohm 10 INS <-> GND = 14.99 ohm 11 INS <-> GND = 14.99 ohm 12 INS <-> GND = 15 ohm 13 INS <-> GND = 15 ohm 14 INS <-> GND = 15 ohm 15 INS <-> GND = 15 ohm

jmamma commented 3 years ago

Did you measure the voltage on R1, and R2 resistor arrays.

On each array, the pin closest to the bottom of the board should read 5V with respect to GND.

yatli commented 3 years ago

I got :

0 INS <-> GND = 14.99 ohm 1 INS <-> GND = 14.99 ohm 2 INS <-> GND = 14.99 ohm 3 INS <-> GND = 15 ohm 4 INS <-> GND = 14.99 ohm 5 INS <-> GND = 0 ohm 6 INS <-> GND = 14.99 ohm 7 INS <-> GND = 0 ohm 8 INS <-> GND = 14.99 ohm 9 INS <-> GND = 15 ohm 10 INS <-> GND = 14.99 ohm 11 INS <-> GND = 14.99 ohm 12 INS <-> GND = 15 ohm 13 INS <-> GND = 15 ohm 14 INS <-> GND = 15 ohm 15 INS <-> GND = 15 ohm

These should all read infinite, but now 2 of them read 0 and the others read 15.

Edit: it's possible that INS5 and INS7 are grounded because they are encoder pins. But still, the other 15ohm readings are strange.

zerkalo06 commented 3 years ago

I got nothing from from R1 and R2, 0v. Solder seems alright, maybe I need to try with another multimetre.

yatli commented 3 years ago

I got nothing from from R1 and R2, 0v. Solder seems alright, maybe I need to try with another multimetre.

What pins have you attached the probes to?

yatli commented 3 years ago

If they're all 0v it means that your VCC is shorted to GND... This is not quite possible, if your Arduino is still operable, and you can run the SRAM test.

zerkalo06 commented 3 years ago

GND on the pin under the 0 that appear on the left side of the array, and the other on the last pin on the right. I also tried from GND of the board to the 0 of the array.

The multimeter is on the 20v.

SRAM test is working.

Am I doing it right ?

It might be my multimeter, I'll try to get a new one tomorrow to test that.

yatli commented 3 years ago

When measuring voltages in this situation you should always put the black probe to GND -- the probe itself isn't called GND -- it's just the negative end of your measurement.

The true GND of the board is marked by the black arrow in my screenshot. So, just stick the black probe in there, and use the red probe to tap the pins to measure. You should have 5V on most pins of R1 and R2.

yatli commented 3 years ago

SRAM test is working. I got nothing from from R1 and R2, 0v

These two contradict each other. So please do the measurement again :)

zerkalo06 commented 3 years ago

Hi ! I receive a new multimeter and did the measures again, oorah.

SRAM test still working.

For R1 <-> GND (without usb connected) :

All pins = 0v

or

Pin 1 = 5 kΩ Pin2, 3, 5, 6, 7, 8, 9 = 15 kΩ Pin4 = 0,2Ω

R1 <-> GND (with usb connected) :

1, 2, 3, 5, 6, 8, 9 = 3,6v 4, 7 = 0v

R2 <-> GND (without usb connected) :

All pins = 0v

or

Pin 1 = 5 kΩ Pin 2, 3, 4, 5, 6, 7, 8, 9 = 15 kΩ

R2 <-> GND (with usb connected) :

1, 2, 3, 5, 6, 7, 8, 9 = 3,6v 4 = 0v

Regarding the measures for the encoders (voltage without usb connected, GND <-> INS) I got 0v everywhere.

Also :

IC2 H <-> GND = 3,6v to 0v(with button pushed)

zerkalo06 commented 3 years ago

I redid the soldering on R1 and R2 and the encoders. Nothing new with the resistors.

I then checked the continuity of the encoders and INS1, INS2, INS3, INS4, INS5, INS8, INS9, INS10, INS11, INS12, INS13, INS14, INS15 don't seem to be connected.

I'll tried to re-solder them but I'm a bit worried that I'll damage the circuit by doing it a forth time.

jmamma commented 3 years ago

I then checked the continuity of the encoders and INS1, INS2, INS3, INS4, INS5, INS8, INS9, INS10, INS11, INS12, INS13, INS14, INS15 don't seem to be connected.

Highly unlikely. How did you measure this ?

zerkalo06 commented 3 years ago

By attaching black probe to gnd and red probe to each encoders INS pins on the continuity mode, and with the arduino connected. It beeped for only two of them. I had four of them before I re-soldered their pins ...

jmamma commented 3 years ago

Black probe to GND, and red to INS pin.

Did you push the corresponding button to complete the circuit when testing the continuity ?

jmamma commented 3 years ago

To recap.

Did you measure the voltage on R1, and R2 resistor arrays.

On each array, the pin closest to the bottom of the board should read 5V with respect to GND.

Are you still reading 0V on the resistor arrays ?

Which pin on the mega command circuit board are you connecting the black probe to measure GND?

zerkalo06 commented 3 years ago

Okay thanks, my bad I didn't push the encoder while checking the continuity. They all good.

For R1 and R2 I get only 3,7v on all pins when moving the encoders.

I get GND from the point indicated above by yatlin, near button 2 and marked by a GND sign on the pcb.