frank@zen.UUCP (Frank Wales) (02/17/88)
[This item is posted on behalf of Wlodek, who can't access Usenet directly; please direct any replies to him using the addresses at the end, rather than just typing 'r'. Thanks. -- Frank] Several comments on the HP-28C/HP-28S, on its clock, and on the book "Customize Your HP-28" prompt me to send this. 1. As Brett Maraldo wrote, the HP-28 CPU uses a clock signal provided by an LC oscillator. This runs at about 640kHz. Real-time operations, such as printer control and the time-out after 10 minutes use a quartz clock which provides a more accurate signal, nominally at 32.768kHz. The CPU and internal data bus of the HP-28C should be able to run at 1MHz, but HP were careful and set the LC circuit to run at 640kHz. By changing the two capacitors one can make an HP-28C run at the full 1MHz. HP warn that "some" CPUs might not be able to run at this speed, so it is worth checking that yours is OK at this speed before glueing it together if you make such a modification. By the time the HP-28S was designed, HP were happy to make its CPU run at 1MHz by default. One reason why they might be happier about this is that the CPU, ROM and display drivers are all integrated onto one chip in the HP-28S. The printer is designed to receive signals controlled by the crystal clock frequency, but the signals are timed by the CPU, whose speed can vary from HP-28 to HP-28, and according to external conditions. There is therefore some software which times the CPU against the crystal clock, and uses the result to determine how many CPU clock cycles are used to transmit each bit. This software can allow for CPU speeds in the range 640kHz to 1MHz, and a little to either side. Thus it can run printing from an HP-28C, from an HP-28S, and from an HP-28C speeded up to 1MHz. Many HP-28Cs can be speeded up to well above 1MHz, but the printer control software will not be able to handle this. 2. The hardware clock signal produced by the crystal oscillator provides a clock value which can be read, as on the HP-71B and the HP-18C (and the newest calculators too). The HP-28C and 28S provide only a very rudimentary piece of software to read the clock value - this is used to initialize the random number generator. Fortunately HP have told user clubs how this piece of software can be accessed with SYSEVAL. On version 1BB (the original HP-28C), this is done with #123E SYSEVAL (clearly the address as given here must be entered in hexadecimal mode). On version 1CC (HP-28Cs sold since about October) use #1266, and on version 2BB (current HP-28Ss) use #11CAh. In each case the result is a 48 bit hexadecimal number representing a number of clock counts, at the rate of 8192 counts per second. Make sure you have the binary word size set to at least 48 bits, otherwise you may be surprised to find the clock cycling. To use this as a clock you can write programs to convert the clock reading into seconds, to display it as a time, to correct it so it displays the actual time, or even to act as a calendar (this would be a liitle ambitious on an HP-28C but the HP-28S provides enough memory to do it). HP have provided a solution sheet with programs to use this software system clock, and lots of user clubs have published their own programs, and also programs to run the HP-28 as a stopwatch. One interesting use is to read the time before and after a calculation, which lets you select the fastest way of doing a calculation if several methods are possible. Rather than calculating a correction and using it in your programs, you can POKE the correct time right into the address where the clock value is kept. Once you have done this you should find the clock is accurate to within a few seconds a month. 3. Mention of POKE brings me to my book "Customize Your HP-28". It contains machine language PEEK and POKE programs, explanations of how to speed up an HP-28C and how to add more RAM to it, and lots more. A preliminary version describing the HP-28C has been on sale to friends since December, and I am now updating it to include some HP-28S details. The preliminary version is still on sale to friends, and I consider anyone who is interested in the 28 to be a friend! Prices including post and packing are 9 UK pounds in Europe and 21 US dollars outside Europe. I apologise for using a bulletin board for shoddy commercial purposes like this but it seems to be the only way to provide detailed answers to questions which have been posted here, short of posting the whole book! If you are interested, please contact me through this medium, or at the addresses below. 4. HP have not published full details of the HP-28 hardware and software, but they have been very kind in providing information to clubs and through HP Journal. A lot more information can be gleaned from the HP Journal article on the HP-71B, and from the HP-71B IDS (Internal Design Specifications) which can be purchased from HP. User clubs are adding to the pool of information and software through research and articles by members. Watch this space! (Or better still, join a user club - a list was posted about a month ago.) W.Mier-Jedrzejowicz, Ph.D., EARN/BITNET: MIER@SPVA.PHYSICS.IMPERIAL.AC.UK JANET: MIER@UK.AC.IMPERIAL.PHYSICS.SPVA UUCP: uunet!mcvax!ukc!spva.physics.imperial.ac.uk!mier Smail: Physics Dept, Imperial College, London SW7 2AZ, England Disclaimer: Neither my employer nor HP are to blame. As for me, I accept no responsibility for what use anyone might make of my ravings. Have a nice day!