Another Failure 20 with measurements and some test mode?


My new MK-312BT is also suffering from "Failure 20".

Because all the measurements and scope screenshots I decided to create a new topic - I hope it is OK.

To be honest I am lost. I cannot say I fully understand the signal generation and the test procedure. So debugging is quite a challenge for me.

I will be grateful for any suggestions or observations.

My PCB is 1.3B.
FW is mk312-bt/firmware/Custom Boot Message f005-MK312-BT/ElectrodesReady.bin.

I did few modifications to the MK-312BT but I don’t think any of them is “Failure 20” related.

  • R35 and R46 are 220k instead 200k (I guess 10% off is not the problem).
  • I didn’t use MAX232.
  • I didn’t use battery VREG – I am powering it from lab PSU directly to the battery input.
  • I added a reverse protection diode (inspiration from 1.3R).
  • I modified MIC input like it is in 1.3R.
  • I used 22pin IDC cable and used only 2GND pins (instead of 4).
  • I used 42TU200 transformers – some other user tested it and it is supposed to work just fine. Center tap output is not connected.
  • I used two 1R resistors in parallel for R30 – I also tried 3 and 4 in parallel to fight the 42TU200 lower DC resistance.

Sometimes the ATMEGA does not startup correctly. The LCD is not correctly initialized (I guess) the top row is full of rectangles, the backlight is ON. The crystal oscillator is ticking correctly at 8MHz. Fuse bytes are correct. I tried to add 100nF cap between RST and GND to slow down the startup time – It made it even worse. The power consumption is 55mA in this case. 5V and 9V rails are OK.

Question – with a “Failure 20” on the LCD the backlight is OFF – is this normal? Also every 10s or so the backlight and output LEDs flashes and nothing else happens.


Power consumption 42mA at 12V.
5V rail: 5.10V
9V1 rail: 8.92V (I might replace 9V VREGs for more precise ones in the future)
9V2 rail: 9.20V

**Signals after power up – Yellow = 5V rail, Red = signal

PB0: no signal

PB1: no signal



LTC1661 OUT A:

LTC1661 OUT B:

LTC1661 – Red = OUT A, Yellow = OUT B:

U10A output:

U10B output:

Red = OUT A, Yellow = U10A output:

Red = OUT A, Yellow = R30 current sensing resistor:

LTC1661– Red = DIN, Yellow = SCLK:

Red = Q1 gate, Yellow = Q2 gate (against ground):

Red = Q3 gate against 9V1 rail (floating scope):

Crystal when the ATMEGA does not startup correctly:

Crystal when the ATMEGA does startup correctly:

// OK, I found it is documented already
I also managed to enter some kind of a test mode. It happened when I tried to measure signal between ground and Q3 gate (floating scope). It also happens when the R30 value is too high – 1R instead of 0.5R. The MK-312BT then boots into this – see the photo. Buttons pressed change one number, Multi Adjust changes other number, and output intensity pots do nothing.


Test mode? When I disconnected one of two 1R in parallel (R30).

Can someone confirm these waveforms?

  • Is the voltage at R30 suppose to be so low - peaks are only 100mV?
  • Is the output coming from the DAC correct?
  • Is the output from U10A correct?

I am unable to measure impulses across transformer coil (floating scope) - it keeps getting into “test mode” - not sure how is this possible.

I will try to desolder and measure all FETs. But I measured each of them before soldering.

Any ideas, please?


[quote=“bumerang, post:1, topic:629”]
Question – with a “Failure 20” on the LCD the backlight is OFF – is this normal? [/quote]

I don’t know the unit well enough to answer the other questions (still fighting error 20 with one of my 2 units) but on my unit which is facing error 20 the backlight is on. So i guess it’s not normal that the backlight is off. It’s also constantly flashing the LEDs.


wow, that’s weird. Backlight is working and the ATMEGA is able to control it - it is on when in test mode.
What do you mean by “flashing the LEDs” - does it look intentional (I mean like for example 1Hz 50% duty cycle) or unintentional (like in my example ~0.1Hz and ~100ms flash)?

I will try to add few 1uF caps to 5V rail to each chip. It hurts when I see the super thin +5V copper trace. And the minimal copper pour clearance… why?!

I wonder if there is a way to identify the moment when ATMEGA restarts itself. When for example watchdog is activated - is the RST pin internally puled down so it is measurable?

My TODO list:

  • Add more decoupling C
  • Route +5V directly to ATMEGA with a wire
  • Try the other FW - HelloFriend.bin
  • Change R35 and R46 to 200k exactly
  • Desolder and meassure al FETs

  • Add more decoupling C
    - done - added 1uF ceramic + 220uF close to ATMEGA, added 4.7uF ceramic to the LCD board, added 4,7uF ceramic close to DAC

  • Route +5V directly to ATMEGA with a wire
    - done

  • Try the other FW - HelloFriend.bin
    - done

  • Change R35 and R46 to 200k exactly
    - done - one is 201.1k the other is 201.5k

  • Desolder and measure al FETs
    - done - all FETs are OK

I also measured resistance of all transformer windings - everything seems to be fine.

Nothing helped.

Any ideas what to do next?


According to this:$+1+0.000005+10.20027730826997+50+5+43 r+176+112+304+112+0+100000 v+448+352+448+80+0+0+40+5+0+0+0.5 r+160+320+160+160+0+200000 a+176+176+304+176+8+15+-15+1000000+4.499937501562461+4.5+100000 w+176+112+176+160+0 w+304+112+304+176+0 w+304+176+368+176+0 w+176+160+160+160+0 w+176+192+112+192+0 g+160+320+160+352+0 r+112+192+112+320+0+100000 r+112+80+112+192+0+100000 r+160+80+160+160+0+100000 w+112+320+160+320+0 R+160+80+160+48+0+0+40+5+0+0+0.5 R+112+80+112+48+0+0+40+9+0+0+0.5 o+10+64+0+4099+5+0.0001953125+0+2+10+3 o+4+64+0+4099+5+0.00009765625+1+2+4+3 38+0+0+1+101+Resistance

Voltages at U10A pin 2 and pin 3 both should be 4.5V when LTC1661 is disconnected.

Edit 2:
My voltages U10 are:

Pin 2 = 4.46V
Pin 3 = 4.44V
Pin 6 = 4.57V
Pin 7 = 4.60V

Pin 1 = 6.04V
Pin 7 = 6.39V

Outputs are suppose to be 6.25V I am few % off - I would say it is OK. Resistors around OPAMPs are OK, OPAMP is working.


Looks like I’m here alone :frowning:

Another try - adding 1R resistor to the center tap of the transformer to more closely mimic the DC resistance of the 42TL004. No luck.
I will try to find real 42TL004 somewhere.

@Cerb: would you be so kind and measure few points on the working unit with an oscilloscope?
all against ground

I am interested in test sequence so please use a single shot and trigger to the PB2 (rising, ~3V).

Also could you please upload the exact binary file you used for the working unit? Not just link to github, upload your file please.


How the f*ck is this possible?!

Red is Q1 drain, yellow is R30 current sensing - all against GND.

There is a voltage ramp which means DAC + U10A + Q3 is working.

There is a switching - the voltage is pulled down with each Q1 impulse to its gate - this means Q1 is working.

But there is no current flowing through the transformer - am I right? There is no significant voltage drop across R30 (check the yellow voltage scale it is 200mV/div!). I cannot explain why there is some voltage drop at the end of the signal. I don’t get it.

The only explanation is the transformer is broken somewhere inside - I measured it twice.
Or the 0.5R resistor (R30) is dead short (thus no voltage drop) which it should not be - there are two 1R in parallel - brown -. black - black - silver - brown… 1R 1%.


Not sure why you deleted your post but you are correct! They are suppose to alternate. I will investigate it further. Still it does not explain missing signal at R30.

Maybe (and this is big maybe based on absolutely nothing) because this is a test sequence the magnetic field canceling is desirable - you don’t want to shock anyone by this test.

Anyway big thanks for your (deleted) reply. I will investigate this.


I deleted the post because, just as you said it seems plausible that in a test sequence the cancelling of the magnetic field is desirable and aditionally it could not explain the low voltage drop at R30.

You could also check the current limit of Q3 (IRF9Z24). To my understanding this MOSFET is applied as current limiter (constant current source). If you can’t get enough current through R30 it may be too much limited, the voltage ramp (red) shows the open-circuit voltage, to my understanding there should always be around 9V at Q1, when not switched on. It seems that you may are at the very beginning of the characteristic curve when you not even have enough current to get the 9V on Q1.

This is also exactly what you see at the very end of the test sequence, where the red curve does stay at the 9V. That the current does increase slightly at the end could have some cause in any capacitance or inductance of the circuit.

Hope this helps more.


FUCK YEAH! It is working!

There is a difference between IRF9Z24PBF (VISHAY) and IRF9Z24NPBF (INFINEON).
You can not use IRF9Z24PBF!

IRF9Z24PBF (VISHAY) has Vt=3.58V.
IRF9Z24NPBF (INFINEON) has Vt=2.98V.

Apparently because this transistor is used in the linear segment this makes enough difference for the unit to go into the Failure 20 mode.

From IRF9Z24PBF (VISHAY) datasheet:

From IRF9Z24NPBF (INFINEON) datasheet:

They should be the same but they are not.

If there will be a demand - I will measure all important signals with a scope on a working unit and post it there. I think it will make future debugging much easier.


Good finding. I want to learn more about the signals.:pray:
I just finished building my MK312 and got the Failure 20 :open_mouth:


Hi Gary,
tell me which signals you need.

But first I recommend to go through this checklist:

  1. double check all resistor values around the DAC and the OPAMP feeding both IRF9Z24NPBF

  2. meassure Vt of your IRF9Z24NPBF (a simple component tester will do)

  3. check if you have the correct transformer

  4. check the transformer orientation

  5. check the value of the 0R5 current sensing resistor

Also the PCB design is problematic, I am not trying to be rude, but it seems the PCB was designed by a programmer - not an electronic engineer. Grounding seems to be the main issue - and I know grounding with 2-layer PCB is always a problem.

I was facing frequent restarts of the processor - it was awful. It restarted itself after just few seconds of working. Sometimes after a button pressed. Garbage…
More decoupling caps did not helped. 5V rail is rock solid.

There are these issues I had with the board:

  1. grounding - I had to route several external ground wires to critical parts of the circuit

  2. ATMega reset pin should have RC circuit connected or at least external pullup (this is not the root cause of restarts)

  3. there are no pull-ups for the buttons! There are no pull-ups in the 4066 - how does it even work? Some parasitic current? God? Add pull-up and 100nF cap for each button. It seems the self-restarts were caused by this 4066 and floating buttons. Buttons without pull-ups are sensitive to interference -> 4066 creates some bullshit signals -> ATMega freezes (or maybe processing of this bullshit signals takes too long) -> watchdog -> restart

  4. there is a resistor in the audio input section which is not even connected on one side?!


Hello Bumerang,

Thanks for your suggestion.

I have check the resistor values around the DAC and the OPAMP and nothing odd at all.

I had order IRF9Z24NPBF and IRL520NPBF at element14 but it turn out IRL520NPBF out of stock and I have source it again from china seller.
When I purchase IRL520NPBF, I also purchase the IRF9Z24NPBF as well but I suspect I got inferior counterfeit. I checked them both with component tester. IRF9Z24NPBF VT=2.0V C=685pf |AND|
IRL520NPBF VT= 1.8V C=1.83nF

I using the 42TU200 transformers as same as you. I don’t want to have too many wires flying around and I connect 3 wire only (Have not connect the Transformer P side because I think the output side is direct connect to 3.5 output jack only and AVR will know nothing regarding the final output.

The 1/2 watt 0R5 is good. I check it value with LCR meter.

I google the IRF9Z24NPBF and IRL520NPBF image and try to located what the genuine chips exactly look like. I found tons of different image, beyond 10+ different outlook. That’s horrible, I have no idea which one is genuine now.

Please do me a favor and share the image of working IRF9Z24NPBF and IRL520NPBF. I want to know how the working one look like. Please also check them with component tester and let me know all the measurement value you got from the tester.



IRF9Z24NPBF (Infineon) purchased from TME has Vt=2.98V. I think this might be the problem.
There should not be a problem with the IRL520NPBF because they operate in fully saturated mode. Mine has also Vt around 1.8V.


Note - after all the trouble I decided to buy ridiculously expensive 42TL004 transformers from Ebay and I build completely new unit.


Thanks for the picture.

I got this IRF9Z24N from element14. It have a small circle at the bottom left to indicate it’s the first PIN, which match with the PCB. Everything looks legit.


Below two are from China seller.

IRL520N = Apparently they don’t have the correct font for IR Logo :rofl:
IRF9Z24N = Look legit but the small circle is in the middle. The VT did not match with Yours. :thinking:

The IRF9Z24N you got have a small circle in bottom center instead of bottom left. I am really confuse about the small circle location. It should be represent PIN1, right ?
If you google about the image of IRF9Z24N, You will find tons of different small circle location :joy:


I always thought the dimple has something to do with the plastic injection process. It is pretty hard/stupid to put TO-220 backwards. I dont think it is the “pin 1” indicator as with IC packages.
Try IRF9Z24N from a different vendor.
As I said there should not be a problem with IRL520N.

Maybe stupid idea - are those Chinese fakes even pin compatible?


I just found this :disappointed_relieved:

Counterfeit IR mosfet have a smaller size in die

Counterfeit IR mosfet performance issue :cold_sweat:

Anyway, I have order the new mosfet from mouser directly and they are on the way now. I will report back either the new mosfet solve the problem.:sunglasses:


Replaced all of the counterfeit mosfet with genuine one and problem solved. No longer having failure 20.


Gary, do you experience any random restarts?
Do you experience problems with buttons (for example multiple presses are read by the MCU) - did you use pull-up resistors for the buttons?


I still waiting for the 42TL004. The flying wire to 42TU200 is really annoying and therefore I haven’t test it completely.

I had forward the problem you mention to engineer and here is the answer.

Buttons are multiplexed with the LCD pins, the program switches these pins to the internal pull-ups when polling the input which is 40K or so. More than likely the long ribbon cable is causing these issues which are now solved with the repositioning of J10 so that it is approximately 2.5 inches long now.

You should use a shorter cable. The shorter the better.


Buttons are multiplexed through 4066 which is “CD4066B CMOS Quad Bilateral Switch”.

Yes, there is an internal pull-up in the AVR but how the pullup can act through the 4066? You pulling HIGH the processor side of the 4066 -> so the button side of the 4066 is also HIGH.
Then you press the button -> it pulls the button side of the 4066 LOW but at the same time the processor side of the 4066 is still pulled HIGH (with the internal pull-up)… you input the signal from both sides.

I am really confused how the 4066 acts when you feed some signal from both sides at once.