Scanning encoder debounce on new scope


+ Reply to Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    Quote Originally Posted by Demon View Post
    I might still go for that. But I'd really like to avoid any debounce on the PICs so they are free to USART with the main USB PIC.
    This can work just fine:

    1. Set up a timer interrupt at 10ms. Or even at 1ms and after ten int's do step 2.

    2. Every interrupt read the buttons into the arrays. You can use a low priority interrupt if the PIC supports it.

    3. Either with or without interrupt use the hardware USART to communicate. If you choose interrupt driven USART, use it as high priority, or Disable as long as you do serial, the timer interrupt.

    Problem solved.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    I wanted to see just how sharp a Schmitt trigger could clean up a signal.

    This is using a MR0102 with rocker actuator, followed by the Bourns RC debounce circuit, and then inverted with a TCC74HC14 Schmitt trigger, followed by LED/330R resistor:

    Name:  Debounce with Schmitt Trigger.jpg
Views: 454
Size:  428.6 KB

    (text on image has been corrected)


    Datasheet says negative threshold is 1.6V at 4.5V. This is USB 5V, so 1.8-1.9V seems ok to me.
    Last edited by Demon; - 11th June 2024 at 04:02.
    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!

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    What a magic tool Oscilloscope is, right?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    Darn tootin' right.

    It's nice to finally use it as a diagnostic/testing tool. The scope has always been a mystery to me. I've always wanted to use one, but never had any electronics training. So it's slow; getting old and a worsening memory doesn't help, but help from you folk make it fun.

    One thing is for sure, I wouldn't hire me to do this stuff.
    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!

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    Your waveforms seem to indicate that you might benefit from adjusting the trimmer capacitor on your probe(s).

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


    Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    Quote Originally Posted by HenrikOlsson View Post
    Your waveforms seem to indicate that you might benefit from adjusting the trimmer capacitor on your probe(s).
    I noticed that "rhythmic pulse" too. I figured it might be the breadboard.

    I wanted to enjoy my scope for a few days before tweaking it and messing it up.
    😄
    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
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Scanning encoder debounce on new scope

    OK, if you just want to see squiggly lines on the screen :-)
    But you're not going to mess it up. It's part of verifying that it actually works as it should.
    Compensating the probe, or at least veryfying its compensation, should ideally be done whenever you move a probe from one channel to another - which is another great reason to use the color coded rings on the probes so that the same probe gets used on the same channel each time.

    Without a properly compensated probe your scope will not display a "true" representation of the waveform and things like automatic risetime and peak-to-peak voltage measurements might be incorect.

    I'm sure there's a section, close to the beginning, in the manual on how to perform the probe compensation.

Similar Threads

  1. Keypad with hardware debounce
    By Demon in forum General
    Replies: 3
    Last Post: - 27th December 2014, 02:47
  2. Continueous ADC scanning using DT interupts
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th March 2010, 22:18
  3. scanning BCD switches
    By dsicon in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 8th June 2008, 17:57
  4. Debounce PULSIN?
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 6th March 2005, 14:45
  5. 3x4 keypad scanning problem and others
    By pt3rg in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd December 2003, 02:21

Members who have read this thread : 12

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