User Tools

Site Tools


20b:software-hex_4_banger

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
20b:software-hex_4_banger [2008/07/28 19:31]
newell Update readme and code, fixed startup switch to Thumb mode bug
20b:software-hex_4_banger [2008/07/28 19:36] (current)
newell Fixing typo
Line 1: Line 1:
 +{{:​20b:​hex_4_banger.tgz|}}===== RPN hex 4 banger =====
 +
 +==== Description ====
 +
 +Another RAM resident sample program, this time a dirt-simple 4 function hex calculator (32 bit ints only!).
 +
 +==== Usage ====
 +
 +Boot calc into test mode (to allow stock firmware to configure and init the chip), ​
 +connect a debugger, halt the chip, download the image, and let 'er rip.
 +It'll probably corrupt anything you had in ram before.
 +
 +==== Download link ====
 +
 + ​{{20B:​hex_4_banger.tgz}}
 +
 +==== Readme.txt ====
 +
 +Another basic sample program for the HP20B. ​ This time it's a four
 +banger 32 bit hex calculator. ​ I think it's RPN, but it may not be
 +exactly correct...
 +
 +Use the top row (N -> Amort) for the A -> F hex digits.
 +
 +Active keys include "​("​ (roll down), "​Input"​ (enter), "​+/​-"​ (chs), "​CE"​
 +(ce), "<​-"​ (backspace/​ce),​ and the four functions.
 +
 +The "​Input"​ LCD annunciator will be active when an unterminated value is
 +present in the X register.
 +
 +The scancode of the last keypress is shown in the exponent area of the
 +LCD.
 +
 +Runs from ram, Thumb mode, trashes memory, and requires some sort of
 +JTAG debugger to load and start the program. ​ OCD Commander reports a
 +starting address of 0x002FF000, in case your debugger can't figure it
 +out.
 +
 +Under OpenOCD, I do a “soft_reset_halt”,​ then a “load_image
 +hex_4_banger.hex”,​ followed by a “resume 0x2ff000”. ​ The startup code
 +wants to run in ARM mode, so be sure the core is set accordingly. ​ Once
 +it jumps to main, it should switch cleanly into Thumb mode.  (Or at
 +least it seems to for me, single-stepping through it.)
 +
 +There'​s no keypad debouncing--the code simply waits for the key to be
 +released. ​ I'm sure that spinlock is very coin cell friendly.
 +
 +Source added. ​ Have fun with it, but try not to laugh too hard.
 +
 +Disclaimer: Yes, the code is ugly.  Fix it at your own risk.  Consider
 +it nothing more than a toy to demonstrate that we know a little about
 +the hardware.
 +
 +Happy HP Hacking!
  
20b/software-hex_4_banger.txt · Last modified: 2008/07/28 19:36 by newell