Re: 8521 dissection
Posted: Wed Nov 30, 2022 11:21 am
14a) TOD two cells
Now to peek into the TOD Bit cells, the two uppermost Bits.
Carry for a 4 Bit block of TOD counter cells ripples through
in inverted/non_inverted form from East to West.
Note: the TOD counter Bit cells operate with the PHI20 clock.
PHI20 is HIGH at PHI2, in every fourth PHI2 cycle.
Means that TOD is clocked with PHI2/4.
South to North, we have:
;...
A transparent latch for reading the TOD counters from the CPU.
Data bus is 8 Bit, counter has more Bits than that,
counter still shold be counting while reading it,
so we can't get around having such latches.
In all TOD Bit cells, the high active control signal TOD_RSAMPLE
makes the latches sampling the values which are in the counters.
High_active control signal TOD_RHOLD makes the latches holding the data
(it also refreshes the contents of the half_static latches).
TOD_RSAMPLE and TOD_RHOLD are generated in "14b) TOD control logic".
High active register read control signals for the individual Bytes
of the read latches R_TOD_10THS, R_TOD_SEC, R_TOD_MIN, R_TOD_HR
are generated in "6) address decoder" (at PHI2).
;...
Next, we have the ALARM register Bits creatively crammed in.
Again we have half_static transparent latches, refreshed at PHI1,
written with high_active register write control signals
W_ALARM_10THS, W_ALARM_SEC, W_ALARM_MIN, W_ALARM_HR which are generated in
"6) address decoder" (at PHI2).
Active RES clears all ALARM registers at PHI1.
ALARM registers use a similar concept like the CRA, CRB registers,
it's just that the transparent latches controlled by PHI1
in the outputs of the ALARM registers (for preventing spikes
when writing the register) are creatively crammed into
the comparator section.
;---
Next, we have the TOD counter Bits.
Even Bits have low_active carry input, high_active carry output.
Odd Bits have high_active carry input, low_active carry output.
Carry input of a 4 Bit counter block changes with PHI20.
Count result is prepared at PHI1.
Counter outputs change when high_active clock signal TOD_CNT_10THS is active (changes at PHI20).
Note, that every 4 Bit block has its own TOD_CNT_* signal.
Counter Bits are cleared with high_active control signal TOD_CLR_10THS (changes at PHI20).
Note, that every 4 Bit block has its own TOD_CLR_* signal.
TOD_TC_10THS is a 5 input NOR gate which checks if the 4 Bit BCD counter
is in overflow condition ($9) while counting is enabled.
Note, that the HL (hour low) counter contains an additional NOR gate
which checks for $2, that's for the AM\PM flag.
;...
We now have reached the North of the TOD Bit cell,
and that's where the comparator sits.
Comparator basically uses XOR gates for comparing TOD counter register contents
with ALARM register contents, then pulls ALARM_EQ low if they don't match.
ALARM_EQ is a 24 input NOR gate, and its output goes into
"14g) TOD INT", where an edge detector generates the TOD_INT signal
when detecting a rising edge on ALARM_EQ,
for setting the ALARM interrupt flag.
;---
However, please note that the HL1 Bit is different.
While all of the other BCD counter Bits are cleared, HL1 is loaded with HH#.
HH# is the low_active output of the HH Bit, MSB of the hour counter.
That's for making TOD jumping from 12:59:59 to 01:00:00,
and we are getting to this trick later in "14f) HH PM".
;---
Now to peek into the TOD Bit cells, the two uppermost Bits.
Carry for a 4 Bit block of TOD counter cells ripples through
in inverted/non_inverted form from East to West.
Note: the TOD counter Bit cells operate with the PHI20 clock.
PHI20 is HIGH at PHI2, in every fourth PHI2 cycle.
Means that TOD is clocked with PHI2/4.
South to North, we have:
;...
A transparent latch for reading the TOD counters from the CPU.
Data bus is 8 Bit, counter has more Bits than that,
counter still shold be counting while reading it,
so we can't get around having such latches.
In all TOD Bit cells, the high active control signal TOD_RSAMPLE
makes the latches sampling the values which are in the counters.
High_active control signal TOD_RHOLD makes the latches holding the data
(it also refreshes the contents of the half_static latches).
TOD_RSAMPLE and TOD_RHOLD are generated in "14b) TOD control logic".
High active register read control signals for the individual Bytes
of the read latches R_TOD_10THS, R_TOD_SEC, R_TOD_MIN, R_TOD_HR
are generated in "6) address decoder" (at PHI2).
;...
Next, we have the ALARM register Bits creatively crammed in.
Again we have half_static transparent latches, refreshed at PHI1,
written with high_active register write control signals
W_ALARM_10THS, W_ALARM_SEC, W_ALARM_MIN, W_ALARM_HR which are generated in
"6) address decoder" (at PHI2).
Active RES clears all ALARM registers at PHI1.
ALARM registers use a similar concept like the CRA, CRB registers,
it's just that the transparent latches controlled by PHI1
in the outputs of the ALARM registers (for preventing spikes
when writing the register) are creatively crammed into
the comparator section.
;---
Next, we have the TOD counter Bits.
Even Bits have low_active carry input, high_active carry output.
Odd Bits have high_active carry input, low_active carry output.
Carry input of a 4 Bit counter block changes with PHI20.
Count result is prepared at PHI1.
Counter outputs change when high_active clock signal TOD_CNT_10THS is active (changes at PHI20).
Note, that every 4 Bit block has its own TOD_CNT_* signal.
Counter Bits are cleared with high_active control signal TOD_CLR_10THS (changes at PHI20).
Note, that every 4 Bit block has its own TOD_CLR_* signal.
TOD_TC_10THS is a 5 input NOR gate which checks if the 4 Bit BCD counter
is in overflow condition ($9) while counting is enabled.
Note, that the HL (hour low) counter contains an additional NOR gate
which checks for $2, that's for the AM\PM flag.
;...
We now have reached the North of the TOD Bit cell,
and that's where the comparator sits.
Comparator basically uses XOR gates for comparing TOD counter register contents
with ALARM register contents, then pulls ALARM_EQ low if they don't match.
ALARM_EQ is a 24 input NOR gate, and its output goes into
"14g) TOD INT", where an edge detector generates the TOD_INT signal
when detecting a rising edge on ALARM_EQ,
for setting the ALARM interrupt flag.
;---
However, please note that the HL1 Bit is different.
While all of the other BCD counter Bits are cleared, HL1 is loaded with HH#.
HH# is the low_active output of the HH Bit, MSB of the hour counter.
That's for making TOD jumping from 12:59:59 to 01:00:00,
and we are getting to this trick later in "14f) HH PM".
;---