Live data from Hacker News

Open-Sourcing our Firmware

frame.work

281–290 of 382 posts

Re: Open-Sourcing our Firmware

#281

Earlier quoted context omitted.

One way is a RC circuit - where the switch (the keyboard button) in series with a resistor then charges a capacitor. You specify the ratio of resistance to capacitance so it takes long enough for the switch to stop bouncing before the capacitor output rises to the sense level of your digital input. But if you want to reduce hardware cost, you can eliminate many capacitors and resistors by doing it in firmware instead…

I’m not too familiar with hardware, but would you be able to differentiate between the unpressed state with such a scheme?

Typically in a 5v system you'd treat capacitor output voltages under 2.3V as pressed and over 2.3V as released. There is a "pullup" resistor and the switch is wired to "pull down" the circuit towards ground, through the mentioned resistor.

Most Microcontrollers have the pullup resistor built in. Modern ones even let you turn the pull-up feature on and off per pin with a SFR (a special register /fixed memory address you can write to where you change hardware settings). Often you can also choose between reading a pin or driving it as an output.

The most important thing to know about debouncing is that any hardware switch bounces from 50-200 times over a very very short interval when you press it. You can use an oscilloscope to see that. The bouncing is not as bad on release but I imagine it still exists there too.

Another fun hardware trick is that when you turn off a magnet (like a relay) you can get a massive over-voltage pulse back (10x typical drive) for a moment. You need to protect yourself from that, for instance with a Schottky diode. Here's a discussion on that fun detail [1].

[1] https://forum.allaboutcircuits.com/threads/reduce-voltage-sp...

Re: Open-Sourcing our Firmware

#282
post #269

Earlier quoted context omitted.

Key bounce takes place at timescales far shorter than human reaction times. Typically you'd base the interval on the mechanical characteristics of the keypad. For instance, taking a look with a scope, if you observe that the signal stops bouncing after 3 milliseconds, it would be pretty safe to accept duplicate keypresses with a 10-ms guard interval.

You'd have to have two intervals though, one for on, one for off. It bounces both ways. Hardware is more elegant but obviously the tradeoffs depend on what you're implementing.

It bounces both ways but as long as you don't accept another keypress action (up or down) immediately after the first, you're fine.

Re: Open-Sourcing our Firmware

#283

Earlier quoted context omitted.

* crisp display * nice battery life * Linux friendliness Not elusive at all, you can find an M1 MacBook Pro at any Apple, Best Buy, or Costco store.

M1 are not Linux-friendly at all.

Run it in a VM. Works fine.

Re: Open-Sourcing our Firmware

#284
post #155

Earlier quoted context omitted.

Sorry for changing the topic but does anybody know the reason Intel has removed the seep states? It drives me absolutely nuts when I open my bag and feel the heat coming out of it, and my laptop is left with 20% charge.

I believe the push came from Microsoft. Apple has been able to do "clever" things while asleep, like waking up the wifi chipset periodically to check for email / messages / notifications / updates, so that when you wake up, everything magically feels ready to go instead of feeling like you just woke up from 1984 and have reams of crap to download. But this only works well because Apple does their own firmware for mos…

I believe it's configurable in firmware, as my ThinkPad e14 gen 2 has a BIOS option to set the sleep state behaviour. The options are labelled "Windows" and "Linux".

Re: Open-Sourcing our Firmware

#285
post #124

I've been so happy to see what Framework has been doing lately, and really want to support them, but I already have a desktop as my primary computer and two Thinkpads that are already set up nicely, but that I rarely use. I moved from 15" laptops to 14" when Lenovo added the numpad on the larger variant, and 14" is about as small as I want to go. I kind of want to buy a framework though, just to support them? But I h…

Sorry for changing the topic but does anybody know the reason Intel has removed the seep states? It drives me absolutely nuts when I open my bag and feel the heat coming out of it, and my laptop is left with 20% charge.

Have they? As far as I'm aware, sleep states are "supported" in hardware well enough, but doesn't prevent software/settings from not using them correctly.

Not that I blame them, there are many different sleep states from core/package level [0] that map onto system/platform level sleep states [1]. Fucking confusing, and I'm sure something is waking it up. Have you checked Windows Task Scheduler? My college laptop had a Norton Antivirus scan wakeup at 5am every day and would be re-enabled every Windows Update, similar pain to you

[0] https://www.intel.com/content/www/us/en/support/articles/000... [1] https://www.tenforums.com/tutorials/63346-sleep-states-avail...

Re: Open-Sourcing our Firmware

#286
post #165

I checked the keyboard debouncing logic [0] and it was fine. Some keyboards from other manufacturers, notably Lenovo Thinkpads, have absurd debouncing algorithms that scramble keys or add delays, so it's good to see Framework has a correct solution. [0]: https://github.com/FrameworkComputer/EmbeddedController/blob...

I want to produce a keyboard switch which needs no debounce.

Re: Open-Sourcing our Firmware

#287
post #266

Earlier quoted context omitted.

One way is a RC circuit - where the switch (the keyboard button) in series with a resistor then charges a capacitor. You specify the ratio of resistance to capacitance so it takes long enough for the switch to stop bouncing before the capacitor output rises to the sense level of your digital input. But if you want to reduce hardware cost, you can eliminate many capacitors and resistors by doing it in firmware instead…

Yeah, I get where you're coming from, but a few dozen SMD caps and resistors ordered in that kind of bulk probably raises the cost by a penny. Of course you do technically have more points of failure I guess.

I had clients who were going to bargain for less than a penny

Re: Open-Sourcing our Firmware

#288
post #124

I've been so happy to see what Framework has been doing lately, and really want to support them, but I already have a desktop as my primary computer and two Thinkpads that are already set up nicely, but that I rarely use. I moved from 15" laptops to 14" when Lenovo added the numpad on the larger variant, and 14" is about as small as I want to go. I kind of want to buy a framework though, just to support them? But I h…

What? I have a Tiger Lake ThinkPad , an X1 Extreme Gen 4, and https://i.imgur.com/RUI9rnd.png it definitely supports S3 sleep, it's a simple BIOS setting. You can go to https://download.lenovo.com/bsco/index.html and see for yourself, it's their BIOS simular.

Re: Open-Sourcing our Firmware

#289

Earlier quoted context omitted.

It looks like he keyboard state is read by the driver, rather than the keyboard sending the state to the OS. How would you denounce on a hardware level with such a setup?

One way is a RC circuit - where the switch (the keyboard button) in series with a resistor then charges a capacitor. You specify the ratio of resistance to capacitance so it takes long enough for the switch to stop bouncing before the capacitor output rises to the sense level of your digital input. But if you want to reduce hardware cost, you can eliminate many capacitors and resistors by doing it in firmware instead…

Computer keyboards tend to have switches in a matrix so that only (columns + rows) number of GPIO pins would be needed on the keyboard controller. Each column gets strobed at once in turn, and the rows sensed.

Cherry once made a software/hardware hybrid but it didn't have any advantages compared to software debouncing, and it needed more power, so there was only one model.

If I understand it correctly, debouncing with a capacitor delay events somewhat. With software debouncing (done right) you are only required to have a minimum time between the press and release events.

Re: Open-Sourcing our Firmware

#290
post #124

I've been so happy to see what Framework has been doing lately, and really want to support them, but I already have a desktop as my primary computer and two Thinkpads that are already set up nicely, but that I rarely use. I moved from 15" laptops to 14" when Lenovo added the numpad on the larger variant, and 14" is about as small as I want to go. I kind of want to buy a framework though, just to support them? But I h…

Sorry for changing the topic but does anybody know the reason Intel has removed the seep states? It drives me absolutely nuts when I open my bag and feel the heat coming out of it, and my laptop is left with 20% charge.

Maybe they made a hardware bug in suspend circuit, and decided to simply fuse it out?
Post reply on HN