PORT definitions
P01 = keyboard (in = cols, out = rows)
P02 = various (see below)
P03 = software masks for isr's
P05 = slot4000page holds A14 - A21, for addresses in #4000-7FFF range.
P06 = slot4000device holds A22 - A29, for addresses in #4000-7FFF range.
P07 = slot8000page holds A14 - A21, for addresses in #8000-BFFF range.
P08 = slot8000device holds A22 - A29, for addresses in #8000-BFFF range.
P09 = printer control & power detect & power button.
P0A = printer control direction
P0D = CPU clock rate control (clock is 8MHz on reset)
P21 = printer status (db25 pins 10,11,12,13,15)
P28 = various (see below)
P2C = printer data direction
P2D = printer data (db25 pins 2 - 9)
P2F = RTC clock rate control????
Port 02 bits: (bit 6 & 2 are input, rest output)
7-lcd_on, 6-callid_data, 5-not_modem_power, 4-yougotmail_LED, 3-LCD_cas, 2-callid_data_rdy, 1-keyrow_9, 0-keyrow_8
Port 03 bits: in's are interrupt source, out's are masks.
The isr's, for the 8 posible interrupt sources are, from highest to lowest priority:
p3.7 = Caller id handler
p3.5 = maybe rtc???
p3.6 = Modem handler
p3.4 = increment time16
p3.3 = null
p3.0 = null
p3.1 = Keyboard handler
p3.2 = null
Ports 05 & 07 are the page registers for slot #4000 & slot #8000 respectively.
Ports 06 & 08 select the device for slot #4000 & slot #8000 respectively.
Device codes:
0 = codeflash (64 pages)
1 = ram ( 8 pages)
2 = LCD (right half) ( 1 page )
3 = dataflash (32 pages)
4 = LCD (left half) ( 1 page )
5 = modem ( 1 page )
Port 09 bits: (bits 0-3 are output, 4-7 input)
P9.7 = +6v good, P9.6 = +5v good, P9.5 = dc-dc good, P9.4 = power_button,
P9.3 = printer_select, P9.2 = printer_init, P9.1 = printer_autofeed, P9.0 = printer_strobe
Port 0D: #f0=8MHz, #30=10MHz, #00=12MHz. Resets to 8MHz. (might be bits 4 & 6 only. bits 0-3 dontcare or somthinelse)
Port 28 bits: (all output)
7,6,5-nc???, 4-callid_FSK/not_DTMF, 3-callid_sleep/reset, 2-callid_dataclock, 1-74C74_pin4_via600ohm, 0-modem_reset
Port 2F: Related to clock speed. might be rtc.
There are a few more ports not doc. here. (probably clock/calendar?????)
Printer port bits all use identical circuitry, whether or no they are ALL bidirectional unknown. printer
data port IS bi-directional!
Just what is a "bank? Is it where memory goes, or the memory that goes there? As in "there are 2 banks, at
#4000 & #8000" versus "there are 64 banks of codeflash", and "32 banks of dataflash", and "8 banks of ram".
Too avoid confusion, I am calling the chunks of memory "pages", and the places those chunks are swapped
into "slots". I find it too confusing to keep calling them both banks.
There are 4 slots, of 16k each, at #0000, #4000, #8000, & #C000.
Only slot #4000 & slot #8000 have been observed to be swappable, with codeflash swapping into #4000, and ram into #8000.
Also, it seems everything except the ram uses #4000 slot. (LCD, dataflash, Modem, caller ID)
slot #0000 is always codeflash page #00
slot #4000 is codeflash pages #01 to #3f (Or LCD, dataflash, Modem, caller ID)
slot #8000 is ram pages #1 to #7
slot #C000 is always ram page #00
On reset, slot4000 and slot8000 both contain codeflash page 0 (dev 0, pg 0).
I would guess that any device can swap into either slot, but so far the ram is the only thing to use #8000 slot, and
it never goes in the #4000 slot.
It seems that the #0000 slot always is codeflash page #00, & since pg #00 has the bank swapping code, this makes sense.
There are a lot of low level routines in this page, too. And if the dataflash and codeflash both swap into slot #4000,
then the only routines to directly access dataflash MUST be in page 0 of codeflash (or copied to ram, as in update mode)
It stands to reason that slot #C000 is fixed ram page, since it contains the stack.
Everything I have seen sez that the #4000 slot is where all the coderom above #003fff is mapped.