Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

1 Input 2 Output on/off switch Gate

Status
Not open for further replies.

Prince Charming

Member level 2
Member level 2
Joined
Jul 10, 2022
Messages
45
Helped
0
Reputation
0
Reaction score
2
Trophy points
8
Activity points
575
Hello, I want to make a latch that has 1 input and 2 outputs.

The working of this latch must be like:
1 - When the input is high output will be 10
2 - The input will be zero for some time
3 - When the input is high again output will be 01
4 - The input will be zero for some time
and it continues like this, it is like a single button that can do "on" and "off" both.

The switching frequency will be at most 120 Hz. But there will be instances where the off time is just 1 microsecond.

The latch will have a 5V input and 5V output

How can I implement this? It is for an Arduino and it will drive two MOSFET drivers.

Thank you.
 

1) What happens to the output values, eg. 01 an 10 ? What form do they take, a byte value
or a flag or.....?

2) off time 1 usec, is that for deadtime between the two MOSFETs to keep them both off ?

3) The off time comes from where ? Its a value or variable or hardware or....?

4) "for some time", what is the range of time ? From what to what ?

5) Accuracy of timing needed ?


Something like this -

1658875291008.png


mBlock takes user block configurations and generates Arduino code.
1 uS off time may be issue however with this approach. However
one can use MOSFET drivers that have internal deadtime control.

Regards, Dana.
--- Updated ---

Primarily a HW approach, single chip, many resources left for other stuff, see resources below.
ISR loads off time into PWM when input toggles.

1658877275306.png


1658877320560.png



Regards, Dana.
 
Last edited:

What happens to the output values, eg. 01 an 10 ?
1 for 5V, 0 for 0V
2) off time 1 usec, is that for deadtime between the two MOSFETs to keep them both off ?
Yes, more like letting the previous MOSFET couple turn off fully before the other starts.
The off time comes from where ?
Off time will come from an Arduino
It is like, the duty cycle of the PWMs will vary and the dead time caused by them is usually enough but when the duty cycle is 1 then there will be no delay between turn on and off of MOSFET couples. To avoid the danger I will purposefully add a microsecond delay form the code.
4) "for some time", what is the range of time ? From what to what ?
0.5 seconds to 1/120 seconds but also sometimes 1 microseconds. Basically depends on frequency and duty cycle. The minimum frequency is 1 Hz and 2 PWM signals occur at each period so the input=0 state wont be longer than 0.5 seconds. There will be no output when input=0 btw. It just has to remember the previous output configuration and do the opposite when the new input comes.
5) Accuracy of timing needed ?
It will determine the average voltage for an AC motor, It doesn't need to be too accurate.

I just wanted a basic circuit with gate elements (NOR,AND....) that will allow me to create 2 PWM signal from a single Arduino pin. The two PWM signals will be delayed and inverted version of each other. My plan is to invert every other PWM signal with circuit components. That's why I wanted a 10 and 01 configuration.

The simulation stuff you sent me are too complex, I am sorry, may I have a circuit diagram please. I saw few that are not exactly what I wanted for example D latch or Push on off latching circuit.

Requires push button and duty cycle would cause problems:
1658880930230.png


Requires enable button and not I wanted anyway:
1658880992011.png


Thank you.
 

Those were not simulations, they were the IDEs, first one mBlock, second
PSOC Creator. Both drag and drop GUI solutions.

Dismiss mBlock, thats not suitable to get the timing you need.


Regards, Dana.
 

Hi,

the circuit in the video has a lot of issues:
* no power supply capacitors
* never leave (unused) inputs floating!
* CD4013 is mature
* bjt connected as emitter follower loses a lot of drive voltage
* CD4013 output current is rather limited (just 0.5mA for V_OH = 4.6V)
* the circuit violates CD4013 clock rise/fall time specification

Klaus
 

no power supply capacitors
My power supply will be an Arduino pin so I guess no problem?
never leave (unused) inputs floating!
I can ground them all
CD4013 is mature
Do you mean old? Well can you give any better IC recommendations?
bjt connected as emitter follower loses a lot of drive voltage
Aah I wasn't going to use the BJTs, I was going to directly connect the Q and Qnot to IR2110. I guess you mean the base current will be affected by the emitter resistance. Yeah good point.
CD4013 output current is rather limited (just 0.5mA for V_OH = 4.6V)
I think MOSFET drivers don't require much current but voltage, the datasheets says it.
the circuit violates CD4013 clock rise/fall time specification
This concerned me. In the datasheet:
1658923012493.png

Soo, I think clock rise and fall time is close to zero as the clock signals come from a PWM signal generated by Arduino. What is wrong with the time can you explain?

Thanks.
 

Hi,

Mind: I referred to the circuit in the video.

capacitors:
No. It makes no differnce what supply you use.
Good practice is to use a capacitor at each supply pin of each IC.
So many of PCBs (professional industry devices) have more than 100 of these capacitors.

output current:
You are right about static current. But at every edge you need to charge/discharge (stray) capacitors. So with just 0.5mA your edges may go slow. It depends a lot on your ciruit and the PCB layout.

He calculates the current limiting resistor for the LED as if there was 5.0V at the output. But even with just 1.5mA the output voltage may drom from ideal 5V down to 2.5V. But a standard LED is made for 15...20mA.

rise/fall times:
Again: I referred to the circuit in the video. The falling clk edge is in the region of 100us. So it is too slow, intermediate oscillation may occur and the ouput stat may cange to a random state after releasing the pushbutton.
Just the fact that this does not happen in the video is no guarantee that it will not happen when you rebuild his circuit.

I just want to say: This video is not the best choice to learn from.

Klaus
 

Hi,

Page 11 of the attached datasheet has a CD4013 toggling latch circuit schematic and description.
 

Attachments

  • cd4013b.pdf
    1.2 MB · Views: 185

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top