Generic Calculator Shield for Arduino Photo-journal
|
03-24-2015, 07:50 PM
Post: #41
|
|||
|
|||
RE: Generic Calculator Shield for Arduino Photo-journal
Nice trick mattiaspaul.
I've found another link. At first glance, it may support n-key rollover with only n diodes. And using open collector I/O when available will ease software design (no need to select input or output !) Regards. JCH |
|||
03-25-2015, 12:38 AM
Post: #42
|
|||
|
|||
RE: Generic Calculator Shield for Arduino Photo-journal
(03-23-2015 05:29 PM)matthiaspaul Wrote: Well, Marcus, there are some rather "unorthodox" design decisions in your proposed solution...hi matthias, good to hear from you... thank you for your ideas! The idea for this 'unorthodox' design is the kiss principle; keep it simple sweetheart! (03-23-2015 05:29 PM)matthiaspaul Wrote: The first is your choice of an analog readout of the keyboard. While this may work for a few keys, it would become unreliable if you'd need to work with more keys per row. Also, it needs hardware or software calibration or active compensation to make it work over a large batch and long time frame and with different voltages.Not really. True, there needs to be enough resolution on the analog input, which of course the edison and the arduino do brilliantly. Mathematics (simple arithmetic) handles the callibration... even between 1v8, 3v3, and 5v. It works famously. (03-23-2015 05:29 PM)matthiaspaul Wrote: It is prone to EMI problems (you will get misreadings near EMI sources), is slow compared to a digital readout and it consumes more energy. All this would make it unsuitable for "commercial grade" applications in mobile devices like calculators, I'm afraid.As I stated earlier, its is VERY unreliable (that's a given). This is a 'little' like TCP/IP... which is by definition a VERY unreliable protocol (that's the beauty of it). We compensate for the inherent flaws of the hardware (kiss principle) by creating quality firmware to handle the eventual and predictable failures... works famously, and keeps things very simple and easy to build (for DIY community). (03-23-2015 05:29 PM)matthiaspaul Wrote: I understand that you need to save I/Os, however, if the current board does not have enough I/Os, perhaps it's not the best possible choice for the job - after all, there are controllers with lots of I/Os.Saving I|O lines on the Due or the Edison is not an issue... the issue is that this calculator shield is generic and general purpose... is being designed to run on multiple boards, with multiple firmwares (from 4 banger to programmable plotter). (03-23-2015 05:29 PM)matthiaspaul Wrote: While a typical keyboard matrix reduces the number of necessary I/Os for (N/2)^2 keys to N already, using some diode tricks you can increase the number of necessary keys to N^2-N.Interesting idea. I am using four I|O lines and one interrupt line. Polling is not an option. Do you have a proposed schematic; more details would be good. (03-23-2015 05:29 PM)matthiaspaul Wrote: Since you are following a distributed controller paradigm anyway, you might also have a look at dedicated keyboard matrix scanner ICs to reduce the number of necessary I/Os on your main controller.This is a good idea... a dedicated AVR for keyboard handling is essentially the way all PC keyboards work... (03-23-2015 05:29 PM)matthiaspaul Wrote: On the software side, you should better draw a clear line between code executed inside and outside of interrupt context. . . stuff the read values into a circular buffer and leave the evaluation and interpretation of the values in the ring buffer to code executed outside interrupt context, so it won't block anything.Yup. The actual interrupt routines are far from 'ready'. My simple 'driver' code is meant only as proof of concept on a very simple, if 'unorthodox' approach to click-button key encoding. There will be scads of revisions along the way, I'm sure of that. Thanks again, I'll keep all of this in mind... and I'm gonna want to investigate the diode idea. Thanks. Cheers, marcus Kind regards, marcus |
|||
03-25-2015, 01:12 AM
(This post was last modified: 03-25-2015 01:20 AM by MarkHaysHarris777.)
Post: #43
|
|||
|
|||
RE: Generic Calculator Shield for Arduino Photo-journal
(03-12-2015 07:23 AM)Marcus von Cube Wrote:(03-11-2015 10:58 PM)MarkHaysHarris777 Wrote: But still, even at that, with all 24 bars 'ON' my little display is drawing about 184 mA. Even limiting the current a dual twelve digit seven seg display would draw a little more than 1.3 amp---I'm not aware of any seven segment display device that is not multiplexed. The human eye is so slow that you will not notice a flicker unless you move the device in front of you. Multiplexing will reduce the power requirements to what a single digit or segment (depending how far you go with multiplexing) draws. Greetings, well, its Christmas at my house again (also with lights!) as some kind soul has shipped to me (free as in free beer!) a pair of JTRON PN297686 8 digit seven segment multiplexed display units utilizing two(2) 74HC595 built-in shift registers. I'm very impressed that I may actually have a workable solution to my proposed Wang 700c replica (in the sometime near future, but that's another story). This little display draws a whopping 12 mA with all bars on (multiplexed) and although flickering slightly can be maintained by the Raspberry PI (while doing other things). If I actually put them in my Royal (and I might) I will program an Atmega328 AVR dedicated to the job of MCU over these little gems. A BIG FAT 'Thank You!' to whomever sent these beauties to me... they arrived in the mails yesterday, and I spent some hours over-night writing some python code to handle them. Hi-res pics first, and some code... then some comment: You can read my seven segment python driver code on-line, or in-line here: Code:
To actually use these little gems requires programming a dedicated AVR that handles the 'large' data shift register internally and also handles the fast display refresh; a dedicated ATmega328 would do very nicely. Its on my back burner. Thanks again to the person who sent these displays to me. I really appreciate it.. and I've had a ton of fun working with them. Somebody at the Raspberry PI foundation will appreciate it too, I'm sure... passing the part numbers and python code along for somebody to enjoy. Thanks! Cheers, marcus Kind regards, marcus |
|||
04-09-2015, 01:00 PM
(This post was last modified: 04-09-2015 01:10 PM by MarkHaysHarris777.)
Post: #44
|
|||
|
|||
RE: Generic Calculator Shield for Arduino Photo-journal
Greetings, you can review post 34 and 35 for the back-story... I have updated the analog keyboard somewhat (taking Matthias' comments to heart, regarding the hardware reliability and the interrupt handler complexity); the hardware is now very reliable, and the interrupt handler is now very simple.
The schematic and basic idea have not changed; however, I compressed the voltage divider some (replaced 1k at the top end with 3 k). The biggest change is the addition of a one-shot interrupt pulse generator via a 555 timer circuit. I reworked the bread-board with hi-res Fritzing to make things a bit clearer: Essentially, the LM339 (shared by all four input lines) 'senses' when the keyboard is pressed and sends a ground-shot to pin 2 of the 555 timer. The 555 has been setup as a one-shot monostable circuit which, when triggered, produces a *very clean* rising edge interrupt strobe of about 235 mS. The RC circuit is a 2M resistor into a .05 mF cap. The output on 555 pin 3 eliminates contact bounce for the interrupt completely and gives the Edison a very nice hysteresis which has so far by my testing been flawless. Green lines on the pic are ground potential while red are Vcc 5v. The orange lines are the comparison lines from the voltage divider, the yellow line is the trip wire to the 555, the white line is the interrupt line to the Edison --to read the ADC block (via i2c), and the blue line(s) is sense-data line read in by the interrupt handler. The interrupt routine with this mod does only two thing very rapidly: 1) sets the key analog registers for later, and sets a flag in my i2c_bus struct, then blows out. A later routine sees the flag, and processes the command line|key entry / I will include the code, a screen shot or two, and some tips|updates relevant to the Edison on my other blog|journal. As for the Arduino(s) its a fairly easy analog read --- the blue line goes to A5 on the Arduino and the Arduino pulls back a number between 0 - 1023. On the Edison things are a little dicier since it has not got an on-board ADC block... we need to read the ADC via i2c, and that's fairly tricky. PS I'm really pumped about the analog keyboard at this point... only two lines (not counting Vcc and gnd) and absolutely reliable; so, unorthodox or not, I'm going with it--- its going to be way cool. Cheers, marcus Kind regards, marcus |
|||
04-23-2015, 06:22 AM
(This post was last modified: 04-23-2015 06:23 AM by MarkHaysHarris777.)
Post: #45
|
|||
|
|||
RE: Generic Calculator Shield for Arduino Photo-journal
Greetings, I have begun work on the actual analog keyboard and hope to be testing on both the Arduino and the Edison by the weekend, or early next week... The red-boards are still back-order from Sparkfun so I may have to punt and either make my own, or find another vendor who can deliver them.
I am also taking a look at the recommended LCD and keyboard scanner IC from Texas Instruments / that little guy might be promising at some point. But I'm getting ahead of myself somewhat because I need to become an expert at reflowing my own Hirose 70 pin connectors, without becoming a full lab. I've been talking to guys who have converted a toaster; one guy uses a fry pan... and Dave F on this site said that the convection oven will be just fine... (and I need a test bed... ) I have continued to test with the analog keyboard prototype (that thing is stable, solid, and error free). The worst I have been able to 'make' it do is to fail to register a keystroke when hit fast and also very close together; I'll put it this way... my HP35s and my WP34s both fail more frequently than the analog prototype board, under the same conditions! I'm beginning to think that the prototype board may actually be able to roll-over and buffer keystrokes (if that were necessary). The interrupt mechanism has not failed (since adding the 555 timer). ... since the time of the output pulse is not really critical I think I can get by with ceramic caps. Cheers, marcus Kind regards, marcus |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)