1

There are two events I plan to log; using no switches or requiring manual input of some kind. One of the events is whenever the Arduino Serial Monitor is opened; the other, is when external event occurs that causes a Arduino RESET. Second event produces a LOW pulse used to CLK the J-K Flip-flop. digitalRead of J-K Flip-flop Q; using a conditional statement, if Q = HIGH log to SD Card as event1 date/time stamp else log to SD Card as event2 date/time stamp. I need the J-K Output Q to be STORED thru the Arduino RESET, so Q can be read.

After reading Q, will need to clear Q; plan to do this from running sketch with a DigitalWrite

74HC73 is the chip I plan to use; it is triggered with a negative going CLK.

What needs to happen with the J and K inputs? Will this work in toggle mode; with both J and K tried to +5 volts?

  • I am only looking to log when a LOW condition at Q output. When I open the Arduino Serial Monitor with the way the 74HC73 is wired now, it immediately toggles, need to HOLD the status of Q until the J-K Flip-flop is reset. Work finished so far: tinyurl.com/jkflipfop includes testing code and wiring diagram. – William Feb 24 '16 at 18:07
0

Rather than having events that set 1Q or 2Q, consider having the external events take 1R\ or 2R\ low, to reset 1Q or 2Q. When your sketch starts up, it would read 1Q and 2Q. If one or the other is low, its event occurred and you can log it. Then the sketch sets both Q's by dropping the CP lines with J's wired high and K's wired low. You'd use three I/O pins: two for reading 1Q and 2Q, one for strobing the CP lines to set the Q's after reading them.

Arduino AVR pins default to inputs on Reset so the Arduino can reset without affecting the 74HC73's state. A 10 to 20KΩ resistor to passively pull the CP lines high is reasonable.

Edit: Note, 1R\ and 2R\ operate asynchronously, and are independent of clock inputs. This leads to simpler interface requirements for your external events. However, it may also increase sensitivity to electrical noise; if your system is in a noisy environment a different approach might be needed.

  • Using with an external watchdog circuit that sends a LOW pulse to reset the Arduino; this is what I am trying to aquire by reading Q. The reading of Q takes place in Setup portion of sketch. Okay, will read 1Q and 2Q, external event to 1R and strobe CP. Can I use the strobing from input of the external, watchdog? Are there any specific requirements for strobe at CP? – William Feb 9 '16 at 1:01
  • @William, see edit. CP is relevant when your program is setting 1Q, 2Q after reading them. CP is not relevant to 1R\, 2R\ lines -- they operate asynchronously. At 5V and 25℃, nQ goes low within 15 ns of nR going low; see Table 7 in nxp specsheet. – James Waldby - jwpat7 Feb 9 '16 at 1:54
0

My resolution: Status Bit Memory

This is the code for logging Arduino RESET and WDT RESET. Plus the code for resetting the J-K Flip-Flop.

 /////////////// J-K Flip-Flop 74HC73,  Status of Q Monitor ///////////////////////////////////////

 delay(10);

 getDateTime();

 if(value == 1)
 {

      //Creates an entry in "Server.txt" for every RESET cause by "Dual Watchdog Timer"
      SdFile serverFile;
      serverFile.open("Server.txt", O_RDWR | O_CREAT | O_APPEND);

      if (!serverFile.isOpen()) error("Watchdog Start Server");

      serverFile.println("Watchdog RESET:  " + dtStamp);
      serverFile.close();
      Serial.print("Watchdog RESET  ");
      Serial.println(dtStamp + "  ");
      Serial.println("Listening for connections...  ");
      //Serial.println(value);

 }
 else
 {

      //Creates an entry in "Server.txt" for every RESET; caused by opening Serial Monitor
      SdFile serverFile;
      serverFile.open("Server.txt", O_RDWR | O_CREAT | O_APPEND);

      if (!serverFile.isOpen()) error("Manual Start Server");

      serverFile.println("Manual RESET:  " + dtStamp);
      serverFile.close();
      Serial.print("Manual RESET  ");
      Serial.println(dtStamp + "  ");
      Serial.println("Listening for connections...  ");
      //Serial.println(value);

 }
 //Sends LOW to RESET the 74HCT73, JK Flip-flop
 digitalWrite(RESET, LOW);
 delay(10);
 digitalWrite(RESET, HIGH);
 delay(10);
 digitalWrite(RESET, LOW);

///////////////////////////////////////////////////////////////////////////////////////////////

William Lucid 12/22/2016

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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