0
\$\begingroup\$

I'm trying to implement a digital output that would hold its state while the microcontroller resets. I'm using a 74hc74 and a Particle Electron board. I can latch in the data, but if I reset the board with a high state on the output of the latch, the latch changes state. The low state is persistent during MCU resets. The worst part is that the flip flop changes state while the RESET pin is active, not during reboot.

What could be the cause ? What is the best practice to implement a persistent output while avoiding unwanted state changes ? (both software and hardware aspects) Should I consider some other type of latch instead ?

\$\endgroup\$
2
  • \$\begingroup\$ The 74xx74 D flip flops can be very sensitive to glitches on the preset and clear lines. Is the D input coming from the MCU? \$\endgroup\$ Commented Feb 13, 2017 at 15:39
  • \$\begingroup\$ Yes. Both the D and the CLK inputs are coming from the MCU. \$\endgroup\$ Commented Feb 14, 2017 at 9:32

2 Answers 2

1
\$\begingroup\$

One option is to use an external flip flop that require a more complex signal pattern to change state. For example, this I2C expander require a valid I2C command so transients on reset should not flip it's state.

http://www.ti.com/lit/ds/scps069f/scps069f.pdf

(and if you have the spare time you can implement one yourself using one of those 8 pin tiny MCUs).

\$\endgroup\$
2
\$\begingroup\$

You really need to provide a schematic of what the heck you are trying to do with the flip-flop.

Some things to think about:

  1. Does the power stay active to the flip-flop when the MCU is reset?
  2. When the MCU goes into reset have you looked at what the CLK pin is doing?
  3. What have you done with the PRE or SET pin of the flip-flop?
  4. What have you done with the CLR or RST pin of the flip-flop?

These questions should make you aware that a schematic is essential.

Also be aware that the GPIO pins on the MCU may not stay in nice clean states when the MCU goes into reset unless you have made some careful design decisions on how to handle the connections to the flip-flop correctly. Once again little direct help can be offered without seeing how you have everything hooked up.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.