Connect with us

Logic Gate Sanity Check

Discussion in 'General Electronics Discussion' started by Fish4Fun, Oct 13, 2021 at 1:01 PM.

Scroll to continue with content
  1. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    469
    107
    Aug 27, 2013
    I am trying to use a single uC i/o Pin To toggle a PWM output between two mosfets ... Easily done with 5 NAND gates, but I would like to achieve it with a single 74xxxx IC and the logic is killing me ;-)

    Here is the Logic I need:
    Code:
    ; A | B | Out1 | Out2 |
    ;---|---|------|------|
    ; 1 | 1 |   1  |   0  |
    ;---|---|------|------|
    ; 0 | 1 |   0  |   1  |
    ;---|---|------|------|
    ; x | 0 |   0  |   0  |
    ;---|---|------|------|
    
    
    Goal would be a single 74xxxx IC (doesn't have to be a NAND gate) ... Don't want to use a PLA ... a second Logic IC or a uC with more i/o Pins ... It may not be possible ... I just thought I would see if anyone could at least tell me if it is NOT possible before I waste a whole day on it.

    Thanks in Advance!

    Fish
     
  2. PETERDECO

    PETERDECO

    185
    45
    Dec 19, 2019
    I use a PIC16F73 to feed 2 PWM outputs to 2 MOSFETS.
     
  3. Harald Kapp

    Harald Kapp Moderator Moderator

    11,702
    2,717
    Nov 17, 2011
    If it has to be 74xx: You can use multiplexers as logic gates like so:
    upload_2021-10-13_16-23-30.png
     
    Kabelsalat likes this.
  4. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    469
    107
    Aug 27, 2013
    Thanks Harold!

    That's EXACTLY what I needed ... I knew I was making it more difficult than I needed to .... I am an idiot. I am already using a pair of 4052's on the PCB ....

    Thinking on it, I can connect the PWM output to the "inh" pin on the 4052's and this will eliminate needing to combine the PWM signal with the digit select.

    Again, Thanks!

    Fish
     
  5. Harald Kapp

    Harald Kapp Moderator Moderator

    11,702
    2,717
    Nov 17, 2011
    There's a catch with using only one output of the microcontroller: the dead band between Out1 and Out2 when they change states is very narrow (1 or 2 ns), This may lead to both transistors that are driven by these outputs to conduct for a short time (e.g. transistor driven by Out1 turns off but is not yet fully off while at the same time the transistor driven by Out2 already starts conducting). This can be avoided by using 2 outputs from the µC and setting the dead band as required.
    See for example here.
     
  6. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    469
    107
    Aug 27, 2013
    Thanks Harald!

    I was trying too hard to make a single ATTINY2313 read 4 x DS18S20 Digital Thermometers and Display the output on 4 x 4-Digit 7-Segment LED displays (Total of 16 7-Segment Digits) ... AND log the data to an external storage device ... While I am confident I could eventually get it to work, I finally decided it was more effort than it was worth ... I decided I would be better off to simply use 1 ATTINY2313 per DS18S20 & 4-Digit 7-Segment display ....

    (Yes, I thought about using serial segment drivers, but they cost more than the ATTINY2313s, LoL.)

    At the end of the day I have a bin full of ATTINY2313s that I only paid ~$0.50 each for ... just doesn't make sense to try to minimize how many I use for this one-off project. This approach also greatly simplifies the code, prototyping and de-bugging.

    Thanks!

    Fish
     
    Harald Kapp likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-