Post Reply 
[WP 34S] Enhanced Y register display: fractions, bugfixes etc.
02-11-2014, 03:35 AM
Post: #25
RE: [WP 34S] Enhanced Y register display: fractions, bugfixes etc.
(02-07-2014 01:58 AM)Bit Wrote:  
(02-06-2014 06:10 PM)Jeff O. Wrote:  The only other comment I have is, is it my imagination, or is response to keystrokes a little sluggish? When entering a multi-digit value, it seems like the numbers appear in the display relatively slowly, especially if I am using both thumbs to key in the value. Not a big deal, just wondering if it is really there.
It's not your imagination. I consider it a bug: a regression like that is unacceptable. I'll look into it once I have the time.

Several factors contributed to the slowness of the new Y register display code when running on a 30b (it's impossible to observe it on a PC).

1. The WP 34S firmware stores the two fonts (big and small) in a clever compressed form to save space. In order to find individual characters in the compressed data, it needs a bit offset table. The offset table isn't stored in the firmware (space is tight), instead it's reconstructed (see findlengths()) in RAM every time the dot matrix display is updated. This is quite slow, and the Y register display made it worse: Instead of having to reconstruct just one offset table (either for the big or the small font), it may have to reconstruct offset tables three times for a single display update because it's switching back and forth between the big and small fonts.

This could be improved by reconstructing both offset tables and keeping them in memory (in stack) while the set_status_sized() function is running. I might do that later if I can establish that the increased stack space requirement doesn't conflict with anything else.

2. In order to find out how many digits can be displayed in the dot matrix display and whether to switch to exponent notation, a simple iteration is performed in annunciators(). This is not much of a problem for the original WP 34S as it displays a second number only after complex operations, but with Y register display a more efficient solution is worth the effort. A near constant time algorithm could probably be devised but it'd further increase the size of the firmware. Therefore I only added some simple logic to decrease the number of iterations. My rough estimate is that the typical number of iterations has been reduced by 50% and the worst case by 60%.

3. The original WP 34S updates the entire screen every time a key is pressed and then again every time a key is released. This is too slow with Y register display enabled.

3.1. When a digit is added to or removed from a number currently being entered the new version doesn't touch the dot matrix display and only updates the lower 7-segment line and the RPN annunciator. The rest of the screen wouldn't change anyway.

3.2. The new version doesn't update the screen at all (except for the RPN annunciator) when a data entry key (digits, radix mark, exponent, +/-, Enter or backspace) is released. There is no need to update it again because the screen had already been updated when the key was pressed and it doesn't change afterwards (unless an error message appears).

With these changes the device is faster than even the unmodified WP 34S when entering numbers. Type 123456789 or 1212121212 as fast as you can and you'll see the difference.

I think we're now quite close to having a high quality Y register display implementation. But the code hasn't yet received much testing and while it clearly works well most of the time, there are probably some corner cases I had overlooked. Whether you notice major bugs (something is displayed incorrectly) or non-fatal issues like inadequate speed or have ideas for further improvements, please let me know, any feedback is welcome. I've updated the compiled binary in my earlier post (#13). The source should be in the SVN soon.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [WP 34S] Enhanced Y register display: fractions, bugfixes etc. - Bit - 02-11-2014 03:35 AM



User(s) browsing this thread: 1 Guest(s)