Post Reply 
NP-41 Emulator (may be)
01-26-2016, 01:00 PM
Post: #141
RE: NP-41 Emulator (may be)
Bob, Sylvian: thanks for the documents and the tip on the memory management. They are very useful for my exploring ROM extension possibilities.

Jean, J-F: seems like I've opened up a can of worms (or candies). I've seen mentions on HP-IL, Pill-Box and other 41 peripheral / extensions quite frequently in the forum, but did not take the time to explore them. So I will have a lot to catch-up to.

The original goal of the slim version is to create a lower cost HP-41 like machine so that I can carry around and play w/ FOCAL programming everywhere, plus I want something my kids can use in class and also a chance for them to explore RPN. And it can appeal to others who've never seen an RPN calculator before.

I am thinking of ways to squeeze the most juice out from the current design.

The 20K or so flash memory left unused can be used into ROM module storage of up to 4 x 4K rom modules (w/ compression 4K 10bit ROM takes 5Kbyte).

There are still 10+ GPIO lines I can used, so SPI, I2C, 2nd UART are all possible. Socket / slot for daughter board type expansion seems like a feasible idea.

The other options is to adopt a more capable MCU, something like 128K+ flash and 8K+ RAM. This will take longer as a lot of stuff need to start again.
Find all posts by this user
Quote this message in a reply
01-26-2016, 01:24 PM
Post: #142
RE: NP-41 Emulator (may be)
(01-25-2016 07:33 PM)Chris Chung Wrote:  ... the display is of 132 x 32 pixels.
Great, it could be used to build a NP-71 (original HP71: 132 x 8 pixels plus annunciators)
:-)
Visit this user's website Find all posts by this user
Quote this message in a reply
01-26-2016, 09:49 PM (This post was last modified: 01-26-2016 09:54 PM by jch.)
Post: #143
RE: NP-41 Emulator (may be)
(01-26-2016 01:24 PM)J-F Garnier Wrote:  
(01-25-2016 07:33 PM)Chris Chung Wrote:  ... the display is of 132 x 32 pixels.
Great, it could be used to build a NP-71 (original HP71: 132 x 8 pixels plus annunciators)
:-)
Or even an HP-42S 131 x 16 pixels ;-)
But that's another and touchy topic.

(01-26-2016 01:00 PM)Chris Chung Wrote:  seems like I've opened up a can of worms (or candies)...
The original goal of the slim version is to create a lower cost HP-41 like machine so that I can carry around and play w/ FOCAL programming everywhere, plus I want something my kids can use in class and also a chance for them to explore RPN. And it can appeal to others who've never seen an RPN calculator before.

I am thinking of ways to squeeze the most juice out from the current design.

The 20K or so flash memory left unused can be used into ROM module storage of up to 4 x 4K rom modules (w/ compression 4K 10bit ROM takes 5Kbyte).

There are still 10+ GPIO lines I can used, so SPI, I2C, 2nd UART are all possible. Socket / slot for daughter board type expansion seems like a feasible idea.

The other options is to adopt a more capable MCU, something like 128K+ flash and 8K+ RAM. This will take longer as a lot of stuff need to start again.
I'm too lazy to check where I saw it, but a recent post stated something like 'one step at a time', and IMHO, NP-41, IS a major step, nice hardware design, 3D printed case & keys, expansion capabilities... Already a very serious calc ground.
I'm excited to get one.
Jean-Christophe
Find all posts by this user
Quote this message in a reply
01-27-2016, 03:44 PM
Post: #144
RE: NP-41 Emulator (may be)
(01-26-2016 09:49 PM)jch Wrote:  ...
I'm too lazy to check where I saw it, but a recent post stated something like 'one step at a time', and IMHO, NP-41, IS a major step, nice hardware design, 3D printed case & keys, expansion capabilities... Already a very serious calc ground.

I'm excited to get one.
Jean-Christophe
Same for me!
Thomas
Find all posts by this user
Quote this message in a reply
01-28-2016, 06:55 PM
Post: #145
RE: NP-41 Emulator (may be)
(01-27-2016 03:44 PM)Thomas_Sch Wrote:  
(01-26-2016 09:49 PM)jch Wrote:  ...
I'm too lazy to check where I saw it, but a recent post stated something like 'one step at a time', and IMHO, NP-41, IS a major step, nice hardware design, 3D printed case & keys, expansion capabilities... Already a very serious calc ground.

I'm excited to get one.
Jean-Christophe
Same for me!
Thomas

After looking into the peripheral and ROM extensions in more detail, I can see the current hardware is not adequate to support them. Anyway, my objective for this design has not change. It should stay being simple and easy to build. Altering the design will take more time than I like, as I need to know the stuffs (ROM / HP-IL, etc) in order to implement them.

I would still like to make provisions for expansion based on the somewhat limited hardware resource. Running ROM instructions from external chips via SPI / I2C will be way slow. So the most I can do is try to use the spare flash memory on the MSP430G2955. I would think there will be always 10k left, enough for a 2 x 4K ROM module.

I am planning to add an micro SD/MMC card reader to the unit w/ a read-only small footprint FAT file system. I can place ROM files in a SD card (up to 2G), and via software setup, I can "load" particular ROM from the FAT FS to a flash partition in the MCU. The loading will take a few seconds and have the effect of inserting a ROM pack into slot 1. And the unit will have only 1 slot, as restricted by the available flash memory.

My question is, will this be useful in many / most cases? As the ROM module space is limited to 2 x 4K.
Find all posts by this user
Quote this message in a reply
01-28-2016, 08:26 PM (This post was last modified: 01-28-2016 10:26 PM by rprosperi.)
Post: #146
RE: NP-41 Emulator (may be)
(01-28-2016 06:55 PM)Chris Chung Wrote:  After looking into the peripheral and ROM extensions in more detail, I can see the current hardware is not adequate to support them. Anyway, my objective for this design has not change. It should stay being simple and easy to build. Altering the design will take more time than I like, as I need to know the stuffs (ROM / HP-IL, etc) in order to implement them.

I would still like to make provisions for expansion based on the somewhat limited hardware resource. Running ROM instructions from external chips via SPI / I2C will be way slow. So the most I can do is try to use the spare flash memory on the MSP430G2955. I would think there will be always 10k left, enough for a 2 x 4K ROM module.

I am planning to add an micro SD/MMC card reader to the unit w/ a read-only small footprint FAT file system. I can place ROM files in a SD card (up to 2G), and via software setup, I can "load" particular ROM from the FAT FS to a flash partition in the MCU. The loading will take a few seconds and have the effect of inserting a ROM pack into slot 1. And the unit will have only 1 slot, as restricted by the available flash memory.

My question is, will this be useful in many / most cases? As the ROM module space is limited to 2 x 4K.

Thanks for taking a look at the expandability possibilities; IMHO well worth the time to check so I appreciate it!

2 x 4K ROMs is certainly far better than none, especially since folks can pick their own ROMs. Most of the modern ROMs in use need more than this, since many rely on Angel's LIB4 to be present (thus taking up one ROM already) and they also use bank-switching, again size-prohibitive. But in truth, most folks using these ROMs also most likely will prefer using original 41C h/w.

But it would allow use of the vast majority of the original Application ROMs, both from HP and many 3rd parties, which is probably hundreds of ROMs in total.

Bottom line: Heck Yes, very useful in most cases!!

I don't recall the 41 version you are proposing - 41C, 41CV or 41CX (obviously preferred, but requires a crystal for the clock, etc.)?

We will stay tuned, and thanks for your considerate approach to developing these cool toys Chris!

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
01-28-2016, 09:27 PM
Post: #147
RE: NP-41 Emulator (may be)
(01-28-2016 06:55 PM)Chris Chung Wrote:  After looking into the peripheral and ROM extensions in more detail, I can see the current hardware is not adequate to support them.
Are you thinking of GPIO / SPI / UART / ... ?

(01-28-2016 06:55 PM)Chris Chung Wrote:  Anyway, my objective for this design has not change. It should stay being simple and easy to build. Altering the design will take more time than I like, as I need to know the stuffs (ROM / HP-IL, etc) in order to implement them.
Yes, this project is so exciting. I can't wait :-)

(01-28-2016 06:55 PM)Chris Chung Wrote:  I would still like to make provisions for expansion based on the somewhat limited hardware resource. Running ROM instructions from external chips via SPI / I2C will be way slow.
Or not... If the access time of external devices is low compared to the microinstructions emulation time ?

(01-28-2016 06:55 PM)Chris Chung Wrote:  So the most I can do is try to use the spare flash memory on the MSP430G2955. I would think there will be always 10k left, enough for a 2 x 4K ROM module.

I am planning to add an micro SD/MMC card reader to the unit w/ a read-only small footprint FAT file system. I can place ROM files in a SD card (up to 2G), and via software setup, I can "load" particular ROM from the FAT FS to a flash partition in the MCU. The loading will take a few seconds and have the effect of inserting a ROM pack into slot 1. And the unit will have only 1 slot, as restricted by the available flash memory.

My question is, will this be useful in many / most cases? As the ROM module space is limited to 2 x 4K.
I'm affraid that even the small footprint FAT file system will take some precious Flash and RAM ressources.
Perhaps a mix with USB transfer, on board fast serial flash and SD Card ?

Jean-Christophe.
Find all posts by this user
Quote this message in a reply
01-28-2016, 09:51 PM
Post: #148
RE: NP-41 Emulator (may be)
Dear Chris,
Your project should not be the "jack of all trades", at least not in the first step.
Making/offering some (or many) of your basic NP-41 would IMHO satisfy a lot of us.
What if your checks show that the hardware is not suitable? Will there than be no NP-41? An impossible idea ;-)

regards Thomas
Find all posts by this user
Quote this message in a reply
01-29-2016, 01:21 AM
Post: #149
RE: NP-41 Emulator (may be)
(01-28-2016 08:26 PM)rprosperi Wrote:  I don't recall the 41 version you are proposing - 41C, 41CV or 41CX (obviously preferred, but requires a crystal for the clock, etc.)?
Bob, I am currently running the 41CV ROM that comes w/ nonpareil, there is also a 41CX ROM that I have not try yet. As I understand that it has RTC. I haven't install clock crystal on the NP41S (I will called this design NP41S to differentiate it w/ the 14 segment 128K FRAM unit) but plan to make that available and try the CX ROM.


jch Wrote:
(01-28-2016 06:55 PM)Chris Chung Wrote:  After looking into the peripheral and ROM extensions in more detail, I can see the current hardware is not adequate to support them.
Are you thinking of GPIO / SPI / UART / ... ?
Jean, for this "value" MCU, there is only one hardware UART + one hardware SPI / I2C.
The UART is used currently used for debugging and will be used to load user domain programs in the future. User will need to purchase a USB-Serial cable to make this work.
A SPI peripheral is used to driBve the DOGM display and will also be used to read SD card.
I am reducing the GPIO for keyboard scanning from 8+5 pins to 10 pins. These will leave about 10 pins for other purpose. I need to put in a buzzer for the BEEP instruction, 2 led back-light pins for the LCD.

The main inadequacy I feel is the lack of flash and RAM. Without on-chip memory there is no way to emulate all 4 slots.

jch Wrote:
(01-28-2016 06:55 PM)Chris Chung Wrote:  I would still like to make provisions for expansion based on the somewhat limited hardware resource. Running ROM instructions from external chips via SPI / I2C will be way slow.
Or not... If the access time of external devices is low compared to the microinstructions emulation time ?
I would definitely give it a try (it would be fun to do). But as a MCU design, there is no memory bus and I have to use SPI / I2C (serial operation) for fetching individual instructions. And it will take many machine cycles to just fetch a few bytes. You are correct that since the CPU is simulated also, it may not look too bad. Some kind of caching might work to some extend. This is something interesting to try once I got the basic stuff going. Another problem is I only have one hardware SPI to share between LCD and SD card and / or external memory, will have to implement some kind of traffic control or to bit-bang one of the channels.

jch Wrote:
(01-28-2016 06:55 PM)Chris Chung Wrote:  So the most I can do is try to use the spare flash memory on the MSP430G2955. I would think there will be always 10k left, enough for a 2 x 4K ROM module.

I am planning to add an micro SD/MMC card reader to the unit w/ a read-only small footprint FAT file system. I can place ROM files in a SD card (up to 2G), and via software setup, I can "load" particular ROM from the FAT FS to a flash partition in the MCU. The loading will take a few seconds and have the effect of inserting a ROM pack into slot 1. And the unit will have only 1 slot, as restricted by the available flash memory.

My question is, will this be useful in many / most cases? As the ROM module space is limited to 2 x 4K.
I'm affraid that even the small footprint FAT file system will take some precious Flash and RAM ressources.
Perhaps a mix with USB transfer, on board fast serial flash and SD Card ?
Yes, I will be careful here. I will be using a read-only version of the elm-chan petite fat library which is known for low resource draws. With reserving 10K bytes ROM module, I still have 10K code space to play around, so I should be fine. I am just placing the component on the new PCB design. The firmware coding for this part is not my priority.

(01-28-2016 09:51 PM)Thomas_Sch Wrote:  Dear Chris,
Your project should not be the "jack of all trades", at least not in the first step.
Making/offering some (or many) of your basic NP-41 would IMHO satisfy a lot of us.
What if your checks show that the hardware is not suitable? Will there than be no NP-41? An impossible idea ;-)

Thomas, I am moving ahead w/ my original plan regardless. I am trying to adjust the PCB so that these may be improvements can be made afterwards by firmware change. There will be an SD card mount, whether it will be used or not. There will also be a pin socket for possible SPI devices, however enabling it in firmware will not happen immediately.

I am eager to get a physical unit to carry around, with the option of changing and improving the firmware at will.
I am actually carrying the prototype unit everyday and making firmware improvements on it.
I hope the next PCB and firmware work will make it stable enough so that I can offer it to a few early adaptors, which should have means to load firmware (i..e a $10 TI LaunchPad G2) as there will be bugs and enhancements.
Find all posts by this user
Quote this message in a reply
01-29-2016, 01:43 AM
Post: #150
RE: NP-41 Emulator (may be)
(01-29-2016 01:21 AM)Chris Chung Wrote:  Bob, I am currently running the 41CV ROM that comes w/ nonpareil, there is also a 41CX ROM that I have not try yet. As I understand that it has RTC. I haven't install clock crystal on the NP41S (I will called this design NP41S to differentiate it w/ the 14 segment 128K FRAM unit) but plan to make that available and try the CX ROM.

The CX adds a RTC, but also a bunch of general-purpose advanced programming commands, plus access to Expanded Memory (a simple offline file system, where you can store programs, create/store text files, save blocks of registers, etc. - but the extra storage space could be an issue). The CX RTC also includes setting multiple alarms which can simply beep or launch programs, auto-repeat on regular cycles, etc.

No idea if any of these features meet your goals, but thought I'd give you a thumbnail view of what the CX adds.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
01-29-2016, 09:11 AM (This post was last modified: 01-29-2016 09:15 AM by J-F Garnier.)
Post: #151
RE: NP-41 Emulator (may be)
(01-29-2016 01:43 AM)rprosperi Wrote:  
(01-29-2016 01:21 AM)Chris Chung Wrote:  Bob, I am currently running the 41CV ROM that comes w/ nonpareil, there is also a 41CX ROM that I have not try yet. As I understand that it has RTC. I haven't install clock crystal on the NP41S (I will called this design NP41S to differentiate it w/ the 14 segment 128K FRAM unit) but plan to make that available and try the CX ROM.

The CX adds a RTC, but also a bunch of general-purpose advanced programming commands, plus access to Expanded Memory.... The CX RTC also includes setting multiple alarms which can simply beep or launch programs, auto-repeat on regular cycles, etc.

Chris, the 41CX ROM has 3 pages more than the CV, and uses bank-switching.
So it depends if you have enough page space available to hold this version.
If, as you mentioned, you only have two free pages, you may start with use the CV ROM and include the Extended Function ROM and Time ROM, even if there is no accurate crystal-based 32kHz clock yet. These are the two most important extension ROM, and it will be approximatively equivalent to the CX.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-29-2016, 02:59 PM
Post: #152
RE: NP-41 Emulator (may be)
(01-29-2016 01:43 AM)rprosperi Wrote:  
(01-29-2016 01:21 AM)Chris Chung Wrote:  Bob, I am currently running the 41CV ROM that comes w/ nonpareil, there is also a 41CX ROM that I have not try yet. As I understand that it has RTC. I haven't install clock crystal on the NP41S (I will called this design NP41S to differentiate it w/ the 14 segment 128K FRAM unit) but plan to make that available and try the CX ROM.

The CX adds a RTC, but also a bunch of general-purpose advanced programming commands, plus access to Expanded Memory (a simple offline file system, where you can store programs, create/store text files, save blocks of registers, etc. - but the extra storage space could be an issue). The CX RTC also includes setting multiple alarms which can simply beep or launch programs, auto-repeat on regular cycles, etc.

No idea if any of these features meet your goals, but thought I'd give you a thumbnail view of what the CX adds.

Eric's code supports the CX and I can run it under Linux, I haven't explored the advance functions and I can see there are additional bank switching activity when running that. Flash space I still have spare but RAM is really tight. The G2955 has 4K ram, for the 320/319 registers + the internal ones takes almost 3K and I am left only 1K to run the simulator, stack, etc.

(01-29-2016 09:11 AM)J-F Garnier Wrote:  
(01-29-2016 01:43 AM)rprosperi Wrote:  The CX adds a RTC, but also a bunch of general-purpose advanced programming commands, plus access to Expanded Memory.... The CX RTC also includes setting multiple alarms which can simply beep or launch programs, auto-repeat on regular cycles, etc.

Chris, the 41CX ROM has 3 pages more than the CV, and uses bank-switching.
So it depends if you have enough page space available to hold this version.
If, as you mentioned, you only have two free pages, you may start with use the CV ROM and include the Extended Function ROM and Time ROM, even if there is no accurate crystal-based 32kHz clock yet. These are the two most important extension ROM, and it will be approximatively equivalent to the CX.

J-F, the CX ROM is not a priority and it is something I can try later. As I am re-doing the PCB, I want to incorporate as much in the hardware design so that I don't have to re-do it again when I want to try something. The additions may or may not be used in future firmware but it is good to have them available for experiments.

With comments from Jean, I research current SPI flash chips and found that some manufacturers uses up to 4 pins for reads, so that it only requires 2 clocks to read a byte. This opens up the possibility of executing ROMs on the fly. So I am planting an 8 pin SPI flash on the next PCB to play w/ it.

The next PCB design is not yet finish and it can accommodate
. UART (need external USB-Serial cable).
. programming interface, TI Spy-Bi-Wire (i.e. simple Jtag)
. 2 levels (2 GPIO pins) of LCD backlight brightness.
. piezo buzzer.
. micro SD card.
. SPI flash.
. 2 x 8 pin socket that draws out the SPI pins and some others.
Find all posts by this user
Quote this message in a reply
01-29-2016, 08:15 PM
Post: #153
RE: NP-41 Emulator (may be)
(01-29-2016 02:59 PM)Chris Chung Wrote:  The next PCB design is not yet finish and it can accommodate
. UART (need external USB-Serial cable).
. programming interface, TI Spy-Bi-Wire (i.e. simple Jtag)
. 2 levels (2 GPIO pins) of LCD backlight brightness.
. piezo buzzer.
. micro SD card.
. SPI flash.
. 2 x 8 pin socket that draws out the SPI pins and some others.
Chris, this will really be a 'Swiss Army Calc'. Looks like your PCB will be a masterpiece !
I don't know if the MCU has Timer or PWM capabilities, but you may use only one PWM pin for LCD backlight ?
And, though I still have some computers with real serial Com port, I wan't ask for MAX232 RS232C level translators ;-).

Jean-Christophe.
Find all posts by this user
Quote this message in a reply
01-29-2016, 09:20 PM (This post was last modified: 01-29-2016 09:21 PM by Chris Chung.)
Post: #154
RE: NP-41 Emulator (may be)
(01-29-2016 08:15 PM)jch Wrote:  Chris, this will really be a 'Swiss Army Calc'. Looks like your PCB will be a masterpiece !
I don't know if the MCU has Timer or PWM capabilities, but you may use only one PWM pin for LCD backlight ?
And, though I still have some computers with real serial Com port, I wan't ask for MAX232 RS232C level translators ;-).

Jean-Christophe.
Jean, this is no masterpiece! I am a amateur on PCB design. Never learnt to use Eagle. The way I am using Fritzing is like manually placing and routing everything w/o a proper schematic. I am always investing in the bare minimal to get things done.

There are 3 16 bit timers. I will be using one for the piezo buzzer. I used 2 pins for the LEDs mainly to avoid adding transistors and there are may be 6 leds that could draw some current. And I don't want to manage too many peripherals / timers, is using current limiting resistors to manage them.

Again it is not worthwhile to put in an extra chip for USB serial when one can get a cable for a dollar on ebay. The G2955 does not have built-in USB.

I managed to compile in the Math 1C ROM introduced by Bob and it is working (I think), the math is too complicated for me, I just try the "FOUR" function and enter a brunch of numbers to let it roll. Nonpareil supports only ROMs w/ fixed page. I had to force the ROM to look like it is fixed at page 8 instead of variable page 8 to f.

Still have to finish the PCB and send for fabrication.
Find all posts by this user
Quote this message in a reply
03-01-2016, 02:02 PM (This post was last modified: 03-01-2016 02:06 PM by Chris Chung.)
Post: #155
RE: NP-41 Emulator (may be)
Another month, another update.

I am still waiting for more parts and PCBs for the NP-41S. Had enhance the firmware so that it could do decode user code on the fly while in programming mode, re-arranged the fonts and display layout a bit. Other hardware enhancements will have to wait until I get my hands on the new PCBs.

Meanwhile the keyboard unit for the NP-41 (14 segment LCD) arrived and I can show you the following photos.

The green board is the "head" unit I had from last time. The white PCB is the detachable keyboard unit which also houses a CR2032 coin cell.
   

Here is the front. I had altered that firmware so that contrast can be adjusted so the ghosting can be eliminated.
   

A 3D printed outer shell I made
   

Fits well. Although not visually appealing, it lets me hold and use the unit very nicely.
   

Closer up, slot / slit on both side allows external power and some I/O options.
   

Two more photo to continue in next post.
Find all posts by this user
Quote this message in a reply
03-01-2016, 02:16 PM
Post: #156
RE: NP-41 Emulator (may be)
...continue NP-41 progress update

I also 3d printed a key panel, keys to complete the case
   

All fitted together
   

With the key panel, key presses are softer and easier for my fingers. However it seems the project looks better w/ the bare PCB. May be I can improve that when I find a way to introduce the key-legend plastic template, and / or another case color / design that doesn't resemble a brick.

Anyway, the end product as is in this stage is quite nice. The unit feel good on my hands, although it is larger, it is secure in the case (I should make the case heavier though). I am not making any firmware changes to it. Just focusing on getting it to look better for now.
Find all posts by this user
Quote this message in a reply
03-01-2016, 02:26 PM
Post: #157
RE: NP-41 Emulator (may be)
Thanks for the update and photos Chris; looks like you're making real progress. Can you guess about when these will be available, and also will it be possible/straightforward to update the firmware, e.g. via USB?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-01-2016, 02:46 PM
Post: #158
RE: NP-41 Emulator (may be)
Thanks, Chris, for sharing your progress with us. Smile Since Power = Work / Time, that's quite a powerful project. Some people could feel challenged to contact you for your 3D printing abilities (well, I think they should Wink ).

Keep up your power! Looking forward to your next report.

d:-)
Find all posts by this user
Quote this message in a reply
03-01-2016, 04:23 PM
Post: #159
RE: NP-41 Emulator (may be)
Not ugly at all Chris, quite nice indeed!
I'd only make larger keys but I like it very much, and that display is fantastic.

Very well done, keep going please.

Gimme, gimme, gimme one (at least!)... :)

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
03-03-2016, 08:13 AM
Post: #160
RE: NP-41 Emulator (may be)
(03-01-2016 04:23 PM)Massimo Gnerucci Wrote:  ...
Very well done, keep going please.

Gimme, gimme, gimme one (at least!)... Smile

me too!
Find all posts by this user
Quote this message in a reply
Post Reply 




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