Thank you Terry. Question; Are resistors required or can the FF be connected directly to Arduino pins. Powering circuit with +5 Volts.
@ Grumpy_Mike
I am using an External Watchdog I log every restart of Web server. Problem is I want to log each restart caused by the External Watchdog. External watchdog works and does reset the Arduino Mega perfectly. Hoping to latch the FF and monitor the State of Q, once reset has occurred; by using a reading an Arduino pin. After reading Q; I want to reset the FF.
Thought I read the SR FF is edge triggered. What did you mean by open Gate?
That circuit has two gates in front of the flip flop. Two of the inputs ( one on each gate ) are connected together, you can't do just that, there needs to be an output somewhere on that node.
This is not an edge triggered flop flop circuit. RS flip flops are not edge triggered. To get an edge triggering you need either a master / slave D-Type or a J/K flip flop.
Thanks for setting me straight. The two gates that are tried togather; can you connect a clock signal at this junction? What could the clock input be? I have a pulse that occurs every minute going to the External watchdog.
The two gates that are tried togather; can you connect a clock signal at this junction?
Yes that is what you should do.
However it is just used to sample the R & S signals, or stop them getting through until you want. I would not think you needed those front gates just to latch a signal. Note an RS flip flop input gates have two logic states, one is passive and the other is active or driving. You should only drive one of the inputs (R or S ) at any one time. If you drive both at the same time then the output is determinate, however if you remove the two signals at the same time the output of the flip flop is indeterminate, that is you can not determine what it will be. With those input gates you have more of a chance of getting that two driving states being removed at the same time and hence not getting a deterministic circuit.
In short, only reset the flip flop when it is not actively being set.
It is not really compatible with modern CMOS parts - like an Arduino!
Perhaps most to the point, why not just feed your watchdog directly to the Arduino and let the Arduino do the job of the latch? That is after all, what microcontrollers are for!
What would happen if the ClocK was tried High and S input went Low, R input is 1 -- would this make Q = 1?
If clock were tied high then the input gate would have no effect apart to invert the inputs.
So S would not be driving the flip flop but R would and Q would be a zero.
Why are you putting those gates on the input, the 74LS279 is just the flip flop triggered on a low, which is what you are after. Ditch those gates.
The 74LS279 is an obsolete part.
True.
It is not really compatible with modern CMOS parts - like an Arduino!
TTL is not directly compatible with the ATmega inputs - they require 3.0V or more for logic high,
74LS only guarantees 2.7V unless you use a pull-up resistor on the output - I doubt the built-in
pull-ups are strong enough though, I'd suggest 10k external for LS, 1k external for plain TTL.
Anyway just get a 74HC version of the chip in the first place!
SwitchDoc Lab's, Dual Watch Dog is directly connected to reset pin of the Arduino Mega. I am only trying the RS Flip-Flop to cature the event; so I can log the event to a file (Re-starts of the server from the Watchdog timer.) LOW only exists for ~200 millisecons --output from the Watchdog.
Here is my code; if that will help understand what I am trying to accomplish:
#define ArduinoQ A11 // pin for SR Flip-flop Q State
#define ArduinoReset A12// pin to reset SR Flip-flop (R Flip-flop input
int value = 0;
void setup()
{
//Creates an entry in "Server.txt" for every start; when Serial Monitor is opened.
SdFile serverFile;
serverFile.open("Server.txt", O_RDWR | O_CREAT | O_APPEND);
//JP3 of Dual Watchdog Timer is connected to the S input of the Flip-flop ((JP3 = LOW) and (R input = HIGH)) Q= HIGH
pinMode(ArduinoReset, OUTPUT); // pin A11 to OUTPUT
digitalWrite(ArduinoReset, HIGH); // pin A11 -- R input of flip-flop; toggles Q to 0
pinMode(ArduinoQ, INPUT);
value = digitalRead(ArduinoQ); //pin A12 -- Flip-flop = Q
Serial.begin(115200);
if (value = LOW ) //happens too fast!!!!
{
if (!serverFile.isOpen()) error("Watchdog Starting Server");
serverFile.println("Watchdog Starting Server " + dtStamp);
Serial.println("Watchdog Starting Server " + dtStamp);
serverFile.close();
digitalWrite(ArduinoReset, LOW); //pin A11 -- R input of Flip-flop ((JP3 = HIGH) and (R = LOW)) Q = LOW
}
else if (value = HIGH)
{
if (!serverFile.isOpen()) error("Re-Starting Server");
serverFile.println("Re-Starting Server: " + dtStamp);
Serial.println("Re-Starting Server " + dtStamp);
serverFile.close();
}
}
void loop()
{
}
I am trying to follow; a schematic would be helpful and beneficial to others finding this discussion.
MarkT:
It will often work, but not guaranteed === doesn't work when it most matters!
No Mark, look at the operating conditions for those figures, you are running them at the extreme when they don't match up. That is something that is not going to happen connecting one Arduino output to one TTL input.
@Techno500
What I don't understand is where that schematic you posted came from. As I said the extra gates are not needed just one quarter of that chip. Also don't make the pin connected to the R into an output until you want to reset the flip flop by giving it a zero on the R input.