New project - MSFS C++ USB interface


+ Reply to Thread
Results 1 to 40 of 170

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    455


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    You shouldn't leave the inputs of the HC14 floating... the outputs will be unknown.

    Also, an ST gate really won't debounce anything if that's what you're trying to do.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Yes, inputs should not be in the air.

    Also despite being ST inputs, the resistor and a cap should still be added. Tubleweed is very right about that.

    Ioannis

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by tumbleweed View Post
    You shouldn't leave the inputs of the HC14 floating... the outputs will be unknown.
    ....
    I wish I had seen that before sending that order to JLCPCB. I'm gonna have a resistor jumper on my brand spanking new circuit (only printed 5 to test).

    Name:  74HC14 input.png
Views: 6455
Size:  686.1 KB


    Quote Originally Posted by tumbleweed View Post
    ...
    Also, an ST gate really won't debounce anything if that's what you're trying to do.
    I'm trying to get a cleaner signal like he explains here at "Hysteresis: The Full Fix".

    Are you saying this doesn't work as he explained?

    https://hackaday.com/2015/12/09/embe...uttons-part-i/
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    It will work if you included the RC network also. But NOT as in your post #69, where switch go directly to the HC14 input.

    Ioannis

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Question Re: New project - MSFS C++ USB interface

    I really shouldn't work until the wee hours in the morning. That rotary switch circuit was totally not finished.

    I've updated my pushbutton circuit.

    Name:  Circuit B3F-4055 w 74HC14.png
Views: 6951
Size:  52.2 KB


    And my rotary switch circuit. (CORRECTED VERSION IN NEXT POST)

    Name:  Circuit SR25 SP4T w 74HC14.png
Views: 6915
Size:  97.5 KB


    1. Do you see any other mistakes?

    2. Do I still need a cap at the MCU pin when it's a signal from a 74HC14?



    EDIT: Hmmm, just noticed my pull-ups on the rotary switch are between the 10K and 74HC14. Gonna go change that.

    Thanks!
    Last edited by Demon; - 13th January 2024 at 23:19.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Here's my corrected rotary switch with corrected pull-ups.

    Name:  Circuit SR25 SP4T w 74HC14 corrected.png
Views: 12538
Size:  82.1 KB
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Well, better but not perfect I suspect.

    The HC14 inputs are at High (~5V) level when not triggerd by the switch/encoder.

    When the switch is at ground, the HC14 sees the voltage divider of two 10K resistors, so the voltage is at 2.5Volts.

    According to the datasheet, this will lead to not clearly defined state of low or high. Will depend on the HC14 type, brand and temperature.

    I would strongly recommend to increase the 10K pull up to 100K.

    Ioannis

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Couldn't you knock out all the stuff, Schmitt ic, r's, c's ...... and just use 1pause for say 2 milliseconds when check switch....... check sw-if change or if zero- pause 2 ( or 3 or 5 milliseconds) check again..... very simple routine ?

  9. #9
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    ...When the switch is at ground, the HC14 sees the voltage divider of two 10K resistors, so the voltage is at 2.5Volts.
    ...
    I would strongly recommend to increase the 10K pull up to 100K.

    Ioannis

    I'm going to test this using 10K pull-up and a 1K res and see what that turns out (I'd like to do the math, but my hair hurts ).
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    ...
    When the switch is at ground, the HC14 sees the voltage divider of two 10K resistors, so the voltage is at 2.5Volts.

    According to the datasheet, this will lead to not clearly defined state of low or high. Will depend on the HC14 type, brand and temperature.

    I would strongly recommend to increase the 10K pull up to 100K.

    Ioannis

    I can't do math since I can't remember squat. It's faster for me to pull out the breadboard and test it out. This is what I got:

    (corrected cause I'm senile)

    Name:  RC circuit.png
Views: 12642
Size:  937.3 KB


    And this is the specs for the 74HC14 that I'm using:

    Name:  74HC14 thresholds.png
Views: 8451
Size:  88.2 KB


    It looks like I'm better off using 100K-1K-100K or 10K-1K-10K to be sure to be in 2.5V range. I didn't check current consumption.

    I suppose the dude on that link used the 74HCT14 (at the bottom of specs). The positive-going threshold is about 1.5V, depending on VCC.
    Last edited by Demon; - 15th January 2024 at 03:23.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by tumbleweed View Post
    You shouldn't leave the inputs of the HC14 floating... the outputs will be unknown.

    ...

    Oooops. I've since added a pull-down for the input I was using.


    I'm seeing several comments on google about connecting the unused pins to ground. If I'm not using their output, can a floating input disturb the other circuits?


    EDIT: I've googled some more and found this explanation:

    "...random charges accumulating there can/will cause unpredictable internal behavior in the chip, including oscillation and high power dissipation."

    https://electronics.stackexchange.co...-inputs-outpus
    Last edited by Demon; - 15th January 2024 at 04:26.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. USB interface
    By Frozen001 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th December 2011, 19:37
  2. Host for USB interface?
    By Carrasco in forum Off Topic
    Replies: 4
    Last Post: - 3rd August 2007, 23:59
  3. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  4. USB interface from PIC16F877 to PC
    By headshouter in forum USB
    Replies: 0
    Last Post: - 26th February 2006, 04:58
  5. USB project
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 18th January 2005, 21:59

Members who have read this thread : 11

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts