The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

Hands on the 20b SDK
Message #1 Posted by Marcus von Cube, Germany on 9 Feb 2011, 10:06 a.m.

I'm willing to help bring forward the 20b/30b repurposing efforts and am taking the first few steps in this direction.

Firstly, my cable has arrived and works fine. (I have a spare, which I can offer to someone here in Germany for free.) After downloading SAM-BA from atmel.com, I was able to erase the flash of my 20b and reprogram it with the image provided in the SDK. The little machine is up and running its original software again. So technically, I'm able to put any software on it.

The following step was getting the sample application in the simulator to compile and run. My old MSC compiler does not support the long long data type (it's there but differently named). Some changes to the sources helped me out. One function is missing from the MFC libraries coming with my compiler. I've got the software running but without support for multiple skins.

To overcome these problems, I decided to upgrade to Visual Studio C++ Express which you can download from Microsoft for free. You'll need some spare space on your hard disk though. The install has just finished. I'll report back, if the SDK example application will compile with this version.

The next step would be to compile WP-34s for the simulator. If I can get this to work, a big step is taken towards a "real" port. On SourceFourge.net I can only find the documentation for download. What do I need to get to the sources? I guess an SVN client is necessary.

I had asked IAR for a price quote for the full development environment from them. In short, I'm not willing to pay over 2000 € for a hobbyist project. I'll be getting the kickstart edition to play around with the SDK but I plan to make GCC an alternative. OK, no debugging in the foreseeable future...

EDIT: The IAR compiler was able to create a working flash image of the number guessing game. I did some code changes to get rid of any compiler warnings and I had to change the project settings: The kickstart version does not allow assembly listings being generated from C/C++ code and the library options were set to "none" which lead to linker errors (missing symbols.)

Edited: 9 Feb 2011, 12:45 p.m. after one or more responses were posted

      
Re: Hands on the 20b SDK
Message #2 Posted by Walter B on 9 Feb 2011, 11:09 a.m.,
in response to message #1 by Marcus von Cube, Germany

Hallo Marcus,

you'll get the necessary most recent files (or access to them) from Pauli, plus optimum advice what to do with them. Please note the layout has changed a bit compared with v1.12. I'm working on v1.13 but it's not ready to be published yet.

Walter

            
Re: Hands on the 20b SDK
Message #3 Posted by Marcus von Cube, Germany on 9 Feb 2011, 11:30 a.m.,
in response to message #2 by Walter B

Thanks Walter!

I'll have to streamline the SDK files a bit first before I want to do work on the simulator or GCC.

I had some sucess with the IAR compiler (see first posting). :)

Edited: 9 Feb 2011, 12:46 p.m.

                  
Re: Hands on the 20b SDK
Message #4 Posted by Erturk Kocalar on 9 Feb 2011, 1:06 p.m.,
in response to message #3 by Marcus von Cube, Germany

Hi Marcus,

I'm willing to help with compiling SDK.

I got my cables yesterday and tried to compile the SDK emulator on my PC, but had issues. I tested Visual C++ 2003. It is compiling about some missing files, but Tim recommended we can take them out. so I'm going to try again.

Does Visual C++ Express have the MFC libraries?

Thanks, erturk

                        
Re: Hands on the 20b SDK
Message #5 Posted by Marcus von Cube, Germany on 9 Feb 2011, 1:18 p.m.,
in response to message #4 by Erturk Kocalar

I have yet to check the latter. Be patient.

                        
Re: Hands on the 20b SDK
Message #6 Posted by Marcus von Cube, Germany on 10 Feb 2011, 11:40 a.m.,
in response to message #4 by Erturk Kocalar

Quote:
Does Visual C++ Express have the MFC libraries?
I fear not. :(

I will have to hunt for a replacement. My VC6 setup is just lacking a single function...

Edit: I'm just downloading the Professional Edition of Visual Studio 10.0.

Edited: 10 Feb 2011, 12:50 p.m.

      
Re: Hands on the 20b SDK
Message #7 Posted by Paul Dale on 10 Feb 2011, 1:22 a.m.,
in response to message #1 by Marcus von Cube, Germany

The sources and latest documentation are available via subversion from the site. The command is mentioned on the sourceforge page but it is buried a bit:

        svn co https://wp34s.svn.sourceforge.net/svnroot/wp34s wp34s 

- Pauli

            
Re: Hands on the 20b SDK
Message #8 Posted by Marcus von Cube, Germany on 10 Feb 2011, 7:15 a.m.,
in response to message #7 by Paul Dale

Thanks Pauli,

I'm going to do some work on the SDK before I turn to your sources. It will take its time.

I need a recent version of the keyboard, in case it is different from what is outlined in the PDF, in order to create an emulator skin. The result should be a working executable for windows with your software in it.

                  
Re: Hands on the 20b SDK
Message #9 Posted by Walter B on 10 Feb 2011, 4:02 p.m.,
in response to message #8 by Marcus von Cube, Germany

The most recent version of the keyboard looks like this:

I'm pretty confident that's it now, but I've been so several times before d:-)

                        
Re: Hands on the 20b SDK
Message #10 Posted by Dieter on 11 Feb 2011, 7:13 a.m.,
in response to message #9 by Walter B

Looks very nice and useable to me.
However, here are some ideas that might even improve it.

Here's a quote from the WP-34s manual:

Quote:
We baptized it 34S in honour of one of the most powerful LED pocket calculators, the HP-34C

The 34C was my first HP back in 1980. One of the features I liked most was the MANT function, displaying the full 10-digit mantissa. On today's calculators this function is called SHOW, and it's also present on the 34s. But where did you hide it? In the lower left corner! Walter! Remember the 34C! This function MUST be placed on the big ENTER key! That's where it belongs. Even the 35S designers knew that! ;-)

Second, wouldn't it be nice if if VIEW was not on Shift-STO but Shift-RCL?

Finally, here are two suggestions for the function set:

  1. I really like the idea of four different logarithms, including a base-2 log (although I would have chosen ld instead of lb) and a general log function with variable base. Currently this function is implemented as base-y log of x. I would definitely prefer it the other way round, i.e. the base-x log of y. It's simply more intuitive and faster to use: In real life you usually first calculate a value and then you take the base-x log of it, where x often is a constant. For a base-8 log you'd simply type [8] [logxY].

    For the same reason other calculators have a function for the x-th root of y, and not the other way round.

  2. I also like a suggestion in the last HP Solve issue concerning the delta-% function. What if it returned not just one, but two results? In other words: both delta%(x,y) and delta%(y,x), so that the user can see both results with a simple X<>Y.

Dieter

                              
Re: Hands on the 20b SDK
Message #11 Posted by x34 on 11 Feb 2011, 8:02 a.m.,
in response to message #10 by Dieter

LBL & RTN would be better bound to XEQ. I think binary logarithm/antilog could go to menu, if calc runs in BCD mode.

                                    
Re: Hands on the 20b SDK
Message #12 Posted by Walter B on 11 Feb 2011, 3:29 p.m.,
in response to message #11 by x34

Quote:
LBL & RTN would be better bound to XEQ.
Sorry, I disagree. Neither LBL nor RTN have anything to do with XEQ. LBL is used exclusively in programming, where's the habitat of RTN as well. This was the reason for placing them next to other commands for this mode.

Though used in programming as well, XEQ is mainly employed for calling routines from the keyboard or for picking items from the catalogs. Thus, XEQ, arrow up and down, and EXIT are placed in one column next to each other.

Please see the doc file.

                              
Re: Hands on the 20b SDK
Message #13 Posted by Walter B on 11 Feb 2011, 4:41 p.m.,
in response to message #10 by Dieter

Hallo Dieter,

Quote:
The 34C was my first HP back in 1980. One of the features I liked most was the MANT function, displaying the full 10-digit mantissa. On today's calculators this function is called SHOW, and it's also present on the 34s. But where did you hide it? In the lower left corner! Walter! Remember the 34C! This function MUST be placed on the big ENTER key! That's where it belongs. Even the 35S designers knew that! ;-)
I admit I was influenced by the layout of the 42S, where SHOW lives in bottom row. And CONST needs more space than SHOW. And you can ENTER a CONSTant and EXIT a SHOW, but not the other way d;-)

Quote:
Second, wouldn't it be nice if if VIEW was not on Shift-STO but Shift-RCL?
Sure. But STO TIME would have been misleading. Since most people know what VIEW does, I decided to give the place below of RCL to TIME. YMMV.

Quote:
Currently this function is implemented as base-y log of x. I would definitely prefer it the other way round, i.e. the base-x log of y.
The inverse of y^x is log[base y](x). And the x'th root of y is another cup of tea - it's simply y^(1/x).

About Delta%: I tried to keep existing calculator commands as they are known, for sake of consistency. We have a small number of deviations from this principle. You find them highlighted in the documentation. 90% of these deviations are due to a more flexible addressing paradigm. Please see the documentation.

            
Re: Hands on the 20b SDK
Message #14 Posted by Marcus von Cube, Germany on 10 Feb 2011, 9:00 a.m.,
in response to message #7 by Paul Dale

Your svn command has worked perfectly. Do you think, I can compile it on Mac OS?

Edited: 10 Feb 2011, 12:58 p.m.

                  
Re: Hands on the 20b SDK
Message #15 Posted by Paul Dale on 11 Feb 2011, 1:15 a.m.,
in response to message #14 by Marcus von Cube, Germany

I've been building on MacOS X for ages. You'll need to do it in a terminal window and you'll have to have the ncurses library installed too.

- Pauli

                        
Re: Hands on the 20b SDK
Message #16 Posted by Marcus von Cube, Germany on 11 Feb 2011, 2:42 a.m.,
in response to message #15 by Paul Dale

OK, now I've several options:

Setup Visual Studio C++ Professional and build a windows emulator version.

Build the terminal (ncurses) version on my Mac.

Port it to gcc-arm...

My next step will be the VC++ way because I've just shelled out a few hundred bucks for the compiler. :)

For those who are not willing to pay for the Professional VC++ (because of the MFC libraries), I'm planning to put the GUI part in a separate precompiled module that may be added to a VC++ Express project.

Please stand by...

                              
Re: Hands on the 20b SDK
Message #17 Posted by Marcus von Cube, Germany on 15 Feb 2011, 8:42 a.m.,
in response to message #16 by Marcus von Cube, Germany

I've had some success with compiling the emulator with VC++ Express. :)

You'll find an updated copy of the SDK files here. I've split the application in a Windows/MFC part which I've put in a library together with all its dependencies, and an application part which does not include any Windows specific stuff that might miss from VC++ Express. Use HP20b_Express.sln or HP20b_Full.sln as your starting point, depending on the compiler you're using. You can even debug with Express but you need to set a breakpoint in application.cpp in advance. Don't mind the linker warnings about missing PDB symbol files for the library, they need to be ignored.

Happy emulating.

I'll probably start porting wp34s to the emulator soon.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall