Re: MOS 6522 dissection //NMOS
Posted: Mon Jul 11, 2022 8:43 am
11) IER //interrupt enable register
IER contains 7 RS flipflops, working as the register Bits.
The high_active outputs of these flipflops go into "12) IFR" for enabling IRQ generation
of the IFR (interrupt flag register) Bits.
High_active read control signal R_IER reads the register Bits into the internal
read data bus D0..6r during PHI1=0, also it switches D7r to VCC during PHI1=0,
so that the MSB always is 1 when reading IER.
Internal write data bus signal D7w# (low_active) goes into an inverter,
which sends D7_w into "8) address decoder".
When writing IER, the address decoder generates two high_active
write control signals during PHI0=0, depending on D7_w:
;
If D7_w=0, W_IER0 connects D0..6w# (low_active) to the low_active R# inputs of the RS flipflops.
Means when writing binary 0xxxxxxx to IFR, if x=1 this clears an IFR register Bit.
;
If D7_w=1, W_IER1 connects D0..6w# (low_active) to the low_active S# inputs of the RS flipflops.
Means when writing binary 1xxxxxxx to IFR, if x=1 this sets an IFR register Bit.
Of course I'm simplifying things, because the RS flipflops are not built from two NOR gates,
they are built from two "open collector" inverters which have pullups to VCC at the outputs.
This trick makes the RS flipflops smaller than when using NOR gates.
For RS flipflops built like this, R# is identical to Q, and S# is identical to Q#.
Note, that all of the IFR register Bits are asynchronously cleared by RST.
Control signals enter the register block from the South,
North of the register blocks we have the usual FETs switching control signals to GND
during a certain clock phase.
;---
IER7: always reads 1, when writing IER use Bit 7 for selecting CLEAR or SET.
IER6: enable IRQ generation for active IFR6 //Timer 1 underflow
IER5: enable IRQ generation for active IFR5 //Timer 2 underflow
IER4: enable IRQ generation for active IFR4 //CB1 active edge
IER3: enable IRQ generation for active IFR3 //CB2 active edge
IER2: enable IRQ generation for active IFR2 //shift register
IER1: enable IRQ generation for active IFR1 //CA1 active edge
IER0: enable IRQ generation for active IFR0 //CA2 active edge
;---
IER contains 7 RS flipflops, working as the register Bits.
The high_active outputs of these flipflops go into "12) IFR" for enabling IRQ generation
of the IFR (interrupt flag register) Bits.
High_active read control signal R_IER reads the register Bits into the internal
read data bus D0..6r during PHI1=0, also it switches D7r to VCC during PHI1=0,
so that the MSB always is 1 when reading IER.
Internal write data bus signal D7w# (low_active) goes into an inverter,
which sends D7_w into "8) address decoder".
When writing IER, the address decoder generates two high_active
write control signals during PHI0=0, depending on D7_w:
;
If D7_w=0, W_IER0 connects D0..6w# (low_active) to the low_active R# inputs of the RS flipflops.
Means when writing binary 0xxxxxxx to IFR, if x=1 this clears an IFR register Bit.
;
If D7_w=1, W_IER1 connects D0..6w# (low_active) to the low_active S# inputs of the RS flipflops.
Means when writing binary 1xxxxxxx to IFR, if x=1 this sets an IFR register Bit.
Of course I'm simplifying things, because the RS flipflops are not built from two NOR gates,
they are built from two "open collector" inverters which have pullups to VCC at the outputs.
This trick makes the RS flipflops smaller than when using NOR gates.
For RS flipflops built like this, R# is identical to Q, and S# is identical to Q#.
Note, that all of the IFR register Bits are asynchronously cleared by RST.
Control signals enter the register block from the South,
North of the register blocks we have the usual FETs switching control signals to GND
during a certain clock phase.
;---
IER7: always reads 1, when writing IER use Bit 7 for selecting CLEAR or SET.
IER6: enable IRQ generation for active IFR6 //Timer 1 underflow
IER5: enable IRQ generation for active IFR5 //Timer 2 underflow
IER4: enable IRQ generation for active IFR4 //CB1 active edge
IER3: enable IRQ generation for active IFR3 //CB2 active edge
IER2: enable IRQ generation for active IFR2 //shift register
IER1: enable IRQ generation for active IFR1 //CA1 active edge
IER0: enable IRQ generation for active IFR0 //CA2 active edge
;---