Wow, I designed those into counting circuits about 45 years ago.....
Wow, I designed those into counting circuits about 45 years ago.....
Nice chip! I did not knew that one although I am of the CMOS era!
Anyway, since you master the art of software, I think is waste of money to add hardware when you can debounce in software.
Plenty of ways to do that and as you said, going into production, will save you a lot of money and complexity.
One example. Read all buttons in an array. After a period of say 10ms, read again and compare all the buttons. One pass, reading and debouncing all buttons.
Ioannis
I also found the MAX6818 debouncer, but it's $4.37 for 8-bit at JLCPCB.
More like master of none.
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.
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!
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
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:
(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!
What a magic tool Oscilloscope is, right?
Ioannis
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!
I know. But I haven't started coding yet and don't know exactly how burdened my processors will be. I prefer to start with hardware debounce, and then see as I advance. It's a lot easier to take stuff off a PCB, than to add it all later.
...insert drum roll and trumpets here...
I present to you, the Encoder Driver v1: 24 encoders, 1 switch, debounced according to Bourns, inverted via 74HC14 Schmitt triggers, in a 30mm x 160mm vertical package. I have 180° pins on the design, but it'll be 90° pins on the final product.
![]()
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!
Hmm, too many wires to connect switches and encoders. Have you thought about that? For a production this is very time consuming.
Ioannis
No more wires. It's unrealistic.
I changed to a single main board for all switches. The ADC, MCP (switches and LEDs) and encoder drivers will be placed around the perimeter with headers.
So now I'm down to just soldering the switches, pots and encoders.
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!
Bookmarks