After a power cycle the program only starts if I push the reset button

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

After a power cycle the program only starts if I push the reset button

Jump to solution
2,041 Views
joao_ribeiro
Contributor IV

Hello,

I am facing a problem that I am not able to solve, that is after a power cycle I can only start the program on my Kinetis K64F micro controller after pushing the reset button. I have been searching the forum for this topic and after reading about the EzPort ( Disabling EzPort on NXP Kinetis to Solve Power-On Issues | MCU on Eclipse  ) and how to flash with PE micro (https://community.nxp.com/docs/DOC-99609 ) I continue to struggle with this issue.

I can debug the firmware without any problem using the PE micro programmer. But if I try to flash the firmware with the MCUxpresso GUI flash tool it will only start if I push the reset button, although it flashes successfully.

It should be some simple configuration at the project configurations, I believe, but I am struggling to find it .

I also have access to an old firmware developed on KDS IDE , that works fine without the need for pushing the reset button after a power cycle, therefore the issue is not on the board side, I believe.

Do you have any idea regarding this issue.

Thank you in advance

Regards 

1 Solution
1,807 Views
myke_predko
Senior Contributor III

Hi João,

Intteresting to see that the HSMG-C190 LED has a forward voltage of 2.2V which, when you take it away from 3.3V, it's 1.1V or Vaio(0.3V)+Vhysh(0.8V) which means that you're probably going to get the problem you describe.  This was pure bad luck.  

As I said in my previous post, you shouldn't have multiple drivers on the reset (or any other) net.  If I were designing the system, rather than use a level shifter to pass reset from the +5V side to the MK64's side, I would use a non-inverting open collector/open drain output buffer like the ON NL27WZ07DFT2G (Link to Datasheet) - it's cheap and works with a wide variety of voltages.  

You should probably get rid of the 100k (or 300Ohm+LED) pull up, the reset switch and cap on the MK64 side of the application and just take the reset signal from the other/main board.  There's a button on the +5V side so you just have one control of the reset signal - the issue is here is that during power up you have two drivers (the RC networks on either side of the level shifter) and you may get some strange power up/manual reset situations.  Just having one RC delay for reset (on the +5V side) will always give you a good power up.  

Good luck!

myke

View solution in original post

8 Replies
1,807 Views
joao_ribeiro
Contributor IV

Hello Myke,

Thank you for all the help given. We appreciate it and we are implementing your notes to our new revision.

Thank you for the support.

Regards

1,807 Views
myke_predko
Senior Contributor III

What is the hardware that you're using?  

From your description, you should be looking at the reset circuitry - What is the value of the pull up on the reset line and do you have any capacitance or a voltage monitor on it as well?  

Good luck.

1,807 Views
joao_ribeiro
Contributor IV

Hello Myke, thankyou for your question.

I am using a MK64FN1M Kinetis micro controller on a proprietary circuit board. I am using MCUxpresso and a PE micro programmer.

I have a 3.3V pullup 300 Ohm resistor with an LED on the reset pin and a push button to ground. 

Thank you

Regards

0 Kudos
1,807 Views
myke_predko
Senior Contributor III

Hi João,

I am assuming that your 300 Ohm resistor and LED are in series, attached at one end to 3V3 and the other to the reset (RESET_b) pin line which has the button to ground. 

Looking at the datasheet, I suspect the problem is with the voltage across the LED which brings the voltage at RESET_b to below the Vaio+Vhysh (This is the reset low level and power up hysteresis value) but *above* Vaio+Vhysl (reset low level and low voltage hysteresis value).  This would mean that the processor is held in reset during power up, but would execute after you press the reset button - there is a 20mV differenced between Vhysh & Vhysl.  

The best solution is to remove the 300Ohm and LED from the circuit and replace them with a 100k pull up resistor (I recommend 100k so that you can work with debuggers and the 100k won't interfere with their operation) and, if you still want to have an LED indication that the board is reset, use a FET buffer to drive the LED.  

I suspect that you're using a green/blue LED which has a high forwards voltage, you might want to try an LED with a lower forward voltage (like a red one) and see if that fixes your problem (and validates my hypothesis of what your problem is).  

Good luck and let me know how you make out.

1,807 Views
joao_ribeiro
Contributor IV

Hello Myke Predko, thank you for your reply and help.

You are right on your hypothesis as I managed to prove it by (as you said) changing the LED by a shunt and the 300 Ohm resistor for a 100 k instead. It now works fine and after a power cycle the program starts without any problem.

Although, please let me share another aspect regarding this issue. I went a bit further on the schematic, following the reset line and found that my LED and 300 Ohm resistor were in fact in parallel with an 4k Ohm pullup resistor inside a level shifter. Let me explain: We have the main board with the MK64 Kinetis and its reset cluster of LED, 300 Ohm resistor and button to ground. Then this main board is connected to a second board with another reset button and pull up resistor of 50k. But this second button is driven by the 5V rail so it is passing through an level shifter from 5V to 3.3V before connecting to the main board. This level shifter (TXS0108) has an pullup resistor of 4k when driving high. So I think that in fact our micro controller have the reset pin connected to a parallel of a 4k resistor with a series of LED and 300 Ohm resistor.

I managed to power the main board alone ( board with LED plus 300 Ohm resistor) and it runs after the power cycle.

What is your view about this added information?

Thank you in advance for the help.

Regards

0 Kudos
1,807 Views
myke_predko
Senior Contributor III

Hi João,

Could you provide me with a schematic of the reset circuitry?  

As a hard rule, you should not have any push-pull drivers on the reset line - there should only be a pull up along with open drain/collector outputs or a normally open switch (as you have) pulling reset to ground on the line.  This is normally called a "dotted-AND" bus and has a pull up and multiple devices which can pull the line low without driving current onto it.  The most important reason for keeping current drivers off the line is to allow debuggers to be used in the circuit.  

I'd recommend taking out the level shifter on the other board and converting it to an open drain/collector driver.  If you can't do that, then on your board you should take the output from the level shifter and use it to drive a single transistor.  

When I see the schematic I can make a better recommendation.  

myke

1,807 Views
joao_ribeiro
Contributor IV

Hello Mike, thank you for your reply and help,

I am attaching the reset portion of our schematic as you asked (the doted line represent the connection between the two boards; board with Kinetis micro controller and the second board with the level shifter)

Unfortunately we will not be able to change the board with the level shifter, therefore I think that the only change that we can make is swapping the LED for a 100k resistor in order to overcome the 4k resistor inside the level shifter (TXS0108). I have tested this hypothesis and it overcome the issue of being stopped at a power cycle. 

After reviewing the schematic and the hypothesis tested, would you recommend any other precaution?

Thank you so much for the help given.

RegardsReset_schematic_v1.PNG

0 Kudos
1,808 Views
myke_predko
Senior Contributor III

Hi João,

Intteresting to see that the HSMG-C190 LED has a forward voltage of 2.2V which, when you take it away from 3.3V, it's 1.1V or Vaio(0.3V)+Vhysh(0.8V) which means that you're probably going to get the problem you describe.  This was pure bad luck.  

As I said in my previous post, you shouldn't have multiple drivers on the reset (or any other) net.  If I were designing the system, rather than use a level shifter to pass reset from the +5V side to the MK64's side, I would use a non-inverting open collector/open drain output buffer like the ON NL27WZ07DFT2G (Link to Datasheet) - it's cheap and works with a wide variety of voltages.  

You should probably get rid of the 100k (or 300Ohm+LED) pull up, the reset switch and cap on the MK64 side of the application and just take the reset signal from the other/main board.  There's a button on the +5V side so you just have one control of the reset signal - the issue is here is that during power up you have two drivers (the RC networks on either side of the level shifter) and you may get some strange power up/manual reset situations.  Just having one RC delay for reset (on the +5V side) will always give you a good power up.  

Good luck!

myke