Recreating a HP-25
|
06-09-2016, 07:33 AM
Post: #1
|
|||
|
|||
Recreating a HP-25
Hello,
I wanted to tell about one of the projects I'm working on: recreating a HP-25. Of course there is a couple of emulators, but having the calc on one's hand is something else, I think. I decided, because I like FPGAs, to use a small MachXO2 device to recreate the chipset of the calc. Being a work in progress means that it doesn't yet exists outside a simulator, but it seems to runs the microcode . I still have to compare the output to a trace of the java emulator. If anyone wants to peek into the HDL, I posted it here: HDL and Testbench The testbench works with icarus verilog and should still work with Aldec's Active HDL simulator (installed with Lattice Diamond). A circuit is in the works , I have to relearn KiCad again |
|||
06-09-2016, 09:10 AM
Post: #2
|
|||
|
|||
RE: Recreating a HP-25
PANAMATIK should be a great help in this matter, I assume.
d:-) |
|||
06-09-2016, 10:41 AM
Post: #3
|
|||
|
|||
RE: Recreating a HP-25 | |||
06-09-2016, 11:37 AM
Post: #4
|
|||
|
|||
RE: Recreating a HP-25
(06-09-2016 07:33 AM)Alejandro Paz(Germany) Wrote: [...] there is a couple of emulators, but having the calc on one's hand is something else, I think. Hi Alejandro Now I have a real competitor I had a look into your HDL code. It's absolutely amazing, that you coded everything in hardware without using an embedded processor. Your HP-25 will be very very fast! You have to prolong the PAUSE and key response. If you need any help, you are welcome. It would be interesting to compare, how efficient the original HP hardware was between the modern HDL approach, compared by number of gates. (06-09-2016 10:41 AM)Thomas Radtke Wrote: And I agree. Care to sell a replacement kit for Woodstocks with rotten innards? :-) Now, I have to reveal that I am building a new replacement kit for woodstocks in addition to the repair kit, which revives the calculator even if only the PCB is present and all chips and power supply are damaged or removed. It will be the Low Power Version of the new ACT, because it will consume only between 10-40mA. Battery life time will be weeks in standby mode. Bernhard That's one small step for a man - one giant leap for mankind. |
|||
06-09-2016, 12:03 PM
(This post was last modified: 06-09-2016 12:17 PM by Alejandro Paz(Germany).)
Post: #5
|
|||
|
|||
RE: Recreating a HP-25
Thanks !
Elaborating a bit on the inner workings, the first I can say is that it is not HW-compatible. * Arithmetic/data operations are nibble-based: opcodes that work on all 14 nibbles take 33 cycles. * Two cycles to access registers, it simplifies things. Registers are in a dual-ported RAM. (2-phase clocks in FPGAs are... not the best approach). * Microcode resides in a ROM. * Decoding is done using behavioral constructs, no single gates. (Using single gates could reduce gate count). * ADD/SUB is done using behavioral models, no ROM-based ALU (like the original, ROMs were easy and fast). * A couple of opcodes are still missing . * The display works differently, in my case it has access to A&B simultaneously. If you have GTKWave handy, you could load dump.vcd, and see (pretty signals) how it works The keyboard module is not there yet. I was thinking on doing hw-debouncing, it is going to need some counters, one per key would be ideal..., scanning slowly like at 50 Hz or so reduces the number of bits in the counters, maybe I can get aways with 2 bits... Regarding speed... it can do 20 MHz on this low power part... Amazing what HP did with like 300 kHz Here is the output of Diamond's mapper: --------------------------------- Design Information Command line: map -a MachXO2 -p LCMXO2-1200ZE -t TQFP144 -s 1 -oc Industrial WS_WS.ngd -o WS_WS_map.ncd -pr WS_WS.prf -mp WS_WS.mrp C:/02_Elektronik/084_Woodstock/05_Lattice/WS.lpf -c 0 -gui Target Vendor: LATTICE Target Device: LCMXO2-1200ZETQFP144 Target Performance: 1 Mapper: xo2c00, version: Diamond (64-bit) 3.5.1.302 Mapped on: 06/09/16 13:57:02 Design Summary Number of registers: 210 out of 1604 (13%) PFU registers: 210 out of 1280 (16%) PIO registers: 0 out of 324 (0%) Number of SLICEs: 368 out of 640 (58%) SLICEs as Logic/ROM: 368 out of 640 (58%) SLICEs as RAM: 0 out of 480 (0%) SLICEs as Carry: 32 out of 640 (5%) Number of LUT4s: 732 out of 1280 (57%) Number of logic LUTs: 668 Number of distributed RAM: 0 (0 LUT4s) Number of ripple logic: 32 (64 LUT4s) Number of shift registers: 0 Number of PIO sites used: 43 + 4(JTAG) out of 108 (44%) Number of block RAMs: 4 out of 7 (57%) Number of GSRs: 0 out of 1 (0%) EFB used : No JTAG used : No Readback used : No Oscillator used : No Startup used : No POR : On Bandgap : On Number of Power Controller: 0 out of 1 (0%) Number of Dynamic Bank Controller (BCINRD): 0 out of 4 (0%) Number of Dynamic Bank Controller (BCLVDSO): 0 out of 1 (0%) Number of DCCA: 0 out of 8 (0%) Number of DCMA: 0 out of 2 (0%) Number of PLLs: 0 out of 1 (0%) Number of DQSDLLs: 0 out of 2 (0%) Number of CLKDIVC: 0 out of 4 (0%) Number of ECLKSYNCA: 0 out of 4 (0%) Number of ECLKBRIDGECS: 0 out of 2 (0%) Preference Summary FREQUENCY NET "clk_in_c" 36.380000 MHz (4096 errors) 4096 items scored, 4096 timing errors detected. Warning: 20.929MHz is the maximum frequency for this preference. |
|||
06-09-2016, 03:38 PM
(This post was last modified: 06-09-2016 03:40 PM by Thomas Radtke.)
Post: #6
|
|||
|
|||
RE: Recreating a HP-25
(06-09-2016 11:37 AM)PANAMATIK Wrote: Now, I have to reveal that I am building a new replacement kit for woodstocks in addition to the repair kit, which revives the calculator even if only the PCB is present and all chips and power supply are damaged or removed.My PCB is rotten, too. Still, a lot of people have been and will be very happy about your work, I'm sure. Edit: Well, just forgot I'd received a replacement PCB w/o chips! I'm not getting old, I *am* old. |
|||
06-09-2016, 07:57 PM
Post: #7
|
|||
|
|||
RE: Recreating a HP-25
(06-09-2016 07:33 AM)Alejandro Paz(Germany) Wrote: Hello, You should consider to join the Alschwill (next to Basel,CH) meeting in October. You'd certainly have an interested audience. Günter |
|||
06-10-2016, 04:59 AM
(This post was last modified: 06-10-2016 05:01 AM by Alejandro Paz(Germany).)
Post: #8
|
|||
|
|||
RE: Recreating a HP-25
Quote:You should consider to join the Alschwill (next to Basel,CH) meeting in October. You'd certainly have an interested audience. That would be great !... it is like... 70 km from where I live... They were asking who is going to go some months ago. (Corrected, as I mixed it with HHC). |
|||
06-10-2016, 09:13 PM
Post: #9
|
|||
|
|||
RE: Recreating a HP-25
(06-10-2016 04:59 AM)Alejandro Paz(Germany) Wrote:Quote:You should consider to join the Alschwill (next to Basel,CH) meeting in October. You'd certainly have an interested audience. Great. I'll be there also, only listening to those who have to present something. Günter PS: Need to remember it's Allschwil not Alschwill |
|||
07-09-2016, 04:40 AM
(This post was last modified: 07-09-2016 04:44 AM by Alejandro Paz(Germany).)
Post: #10
|
|||
|
|||
RE: Recreating a HP-25
I've been working lately on the code quite a bit and on a prototype board with keys and 7-segment displays. The code runs till the entry loop at 0742..0745. I have to implement keyboard scanning now. Debouncing seems to happen entirely on hw. If this where some microprocessor, I'd just use some software counters to scan the matrix and store key changes. I'd like to avoid using one counter per key, because I don't think that it was done like that. There is enough logic in this chip, I just think that is a waste of logic to do it like that....
I had some problems with the carry. It gets set and cleared in the same instruction, not a behaviour I have to reproduce,... on the 1LF2 I used an extra register for the comparison result. Here I used the carry, but it resulted in awkward code. There is a bit to improve. I follow the principle: make it work, make it fast, make it good . The 1LF2 has hw registers and the ws has memory-mapped registers, there is not enough logic for all the muxes one needs in a 8x64 bits register file with two access ports. Two R/W ports are not really needed, they are just convenient. It is a behavioural model after all, not a gate-level model (one could also do this but... why ?). The code posted to github is up-to-date. There is a stream of serial data, pc, opcode and P register coming out of the FPGA (numbers in octal except P). I'm using a MachXO2-1200ZE breakout board, it has a TTL33 to USB adapter built in. It is clocked from the internal 2.08 MHz clock, serial data is output at 500 kbps, no problems for the FT2232, they can also have 2 Mbps . I'll post a couple of pictures of the prototype once I've finished soldering the keys to the connectors, and the displays... quite a bit of wiring going on. If you study a bit the code, there is another surprise there , it only needs another row of keys . Code:
|
|||
07-10-2016, 10:26 AM
Post: #11
|
|||
|
|||
RE: Recreating a HP-25
>>If you study a bit the code, there is another surprise there , it only needs another row of keys .
Your listing shows the HP-25 initialization program flow. But where is the surprise? Bernhard That's one small step for a man - one giant leap for mankind. |
|||
07-10-2016, 11:57 AM
Post: #12
|
|||
|
|||
RE: Recreating a HP-25
Oops, I didn't mean the trace but the verilog code .
|
|||
10-26-2016, 07:21 PM
(This post was last modified: 10-26-2016 07:22 PM by Alejandro Paz(Germany).)
Post: #13
|
|||
|
|||
RE: Recreating a HP-25
These last days I was able to get to work again on the core, and to iron out those bugs that prevented STO/RCL and the block-memory based register file to work. I ended, as I suspected, having to add a couple extra cycles to account for the block ram latency. Now, it works as a real 25 would do but much faster. Sadly a bit late for the meeting .
Now I have a question, is the firmware of the 25C different from the regular non-C model ? |
|||
10-26-2016, 09:56 PM
Post: #14
|
|||
|
|||
RE: Recreating a HP-25
(10-26-2016 07:21 PM)Alejandro Paz(Germany) Wrote: These last days I was able to get to work again on the core, and to iron out those bugs that prevented STO/RCL and the block-memory based register file to work. I ended, as I suspected, having to add a couple extra cycles to account for the block ram latency. Now, it works as a real 25 would do but much faster. Sadly a bit late for the meeting . Congratulations for having the STO RCL issue fixed! Your prototype didn't seem to have a PRGM/RUN switch. I couldn't enter program steps. Pressing SST or R/S button didn't show the next program step when hold down. Did you fix that too? You just have to set status bit s 15 every instruction as long as any key is hold down. HP-25 and HP-25C have the same firmware, the only difference in behaviour occurs as the RAMs of the C model doesn't clear its contents when "clear data regs" is executed. Bernhard That's one small step for a man - one giant leap for mankind. |
|||
10-27-2016, 10:55 AM
Post: #15
|
|||
|
|||
RE: Recreating a HP-25
Yes, there was no switch, I added "features" as the HDL-code needed them. It is now due.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)