Post Reply 
Revealing the HP-82242A IR Printer Module
03-12-2024, 11:49 AM (This post was last modified: 03-12-2024 12:30 PM by ThomasF.)
Post: #4
RE: Revealing the HP-82242A IR Printer Module
Hi all,

The other day Meindert notified me of a small peculiar thing in the Blinky.
He noticed that after a print command, e.g. PRA, the module would turn on the CPU again after some seconds.

About 2 seconds after a single PRA, but up to almost 30 seconds for more than 20 consecutive calls to PRA.

He found this while tracing a real Blinky, and this did not happen on my emulated version, so something in the emulation was apparently missing!

This is how I think it works, what I did to solve it ...

When printing, the Blinky keeps track of how much has been printed, at least the number of linefeeds, since printing a full text line takes about the same time as a single line feed. If one calls another print-command directly after the first, this information must be kept between the two commands and so on.

This is mainly done by maintaining a timer that is incremented by a value corresponding to the delay added by each printing command.

When execution is done, this timer is decremented in the background and when reaching zero a service request is issued, the CPU wakes up and handles this.

The service request is done by pulling ISA high until the PWO line goes active, and the CPU starts running again. To know who called, the operating system goes through all modules, checking the last addresses in each ROM for a lookup table and calls any service routines it finds, and the module can do whatever it needs to do.
Note that the CPU has no information about who raised ISA and has to check every module in the system.

So I added a detection of light/deep sleep, as well as a background clock that could feed my emulated Blinky while the CPU was sleeping, and then pull ISA and kickstart the CPU when the timer expired.

This works fine now, so yet one step closer to a complete emulation and understanding of the Blinly Module!

Thanks goes to Meindert for being so observant when helping me with real Blinky traces!

---------------------------

One observation I made while looking through the available documentation on service request was in the excellent HP-41CX Programmer's Handbook where the following list is found which shows the services that are available to modules:

xFF4 Interrupt checked during Pause
xFF5 Interrupt checked if system flag 53 set
xFF6 Interrupt checked on wakeup /not ON key
xFF7 Interrupt checked when HP41 is turned off
xFF8 Interrupt checked just before CPU stops
xFF9 Interrupt checked on wakeup /ON key
xFFA Interrupt checked on MEMORY LOST

But, I think that the description of the FF8 service is misleading, it should be "when enter or leaving light sleep".
This service is called from light sleep wakeup logic, but also when going to light sleep.
Wakeup (xFF6 or xFF9) are related to when leaving deep sleep (i.e. turn on from display off).

Edit: I removed a question about a NPIC instruction, but found the answer Wink
I had misread the document and missed a part ... my fault ...
The instruction in question is used by e.g. the printer to report its status.


Cheers,
Thomas

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Revealing the HP-82242A IR Printer Module - ThomasF - 03-12-2024 11:49 AM



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