Re: 74HCT6526 - A MOS6526 implementation with 74xx ICs
Posted: Sat Jul 30, 2022 2:20 pm
Ok, so, testing on TIMERA is completed. I may still try more stuff eventually, but it feels quite good. I manage to get my missing CNT pulses... I just missed a pull-up resistor on the SBC!
Yesterday I said START was arriving a cycle earlier, however I have one extreme case, which makes me doubt it, and now I'm thinking it's a deeper issue. This fragment of code :
I setup TIMERA to count down from $0006. Then load $01 into CREGA to start the timer, then load $00 to stop it. Even though the timer is running in continuous mode, and we should see 6-5-4-3-2-1-6-6-5-4-3-2-1-6-6, by stopping the timer right on underflow, reload is not triggered. This is normal behavior, and I get it on original hardware, but also on 74HCT6526. So, if timer is starting one cycle later, then it's also stopping one cycle later, and indeed... In my last revision, I added a new FF in the clock pipeline to sync the clock pulses, instead of trying detect rising edge of PHI2 to count. This, of course, delays the whole pipeline by one cycle.
But also, a flip flop was also added to extend the LOAD Pulse for the timer (Before, as soon as one timer output was reloaded, the pulse ended, and this was causing many issues). Again, this delays forceload by one cycle.
The clock pipeline is complex, big, and kinda has it's own consciousness. It's based on Wolfgang Lorenz model (https://ist.uwaterloo.ca/~schepers/MJK/cia6526.html) with many tweaks to make it work. Although it now seems to work ok, I feel it's the weakest link, and that any attempt to make it better... will just make it worse.
After a very intense week, I'm going to let it cool a bit. Meanwhile I'll start working on B2 reusing B1 as it is.
Cheers!
Yesterday I said START was arriving a cycle earlier, however I have one extreme case, which makes me doubt it, and now I'm thinking it's a deeper issue. This fragment of code :
Code: Select all
lda #$06
sta CIA2_TALO
lda #$00
sta CIA2_TAHI
lda #$01
sta CIA2_CRGA
lda #$00
sta CIA2_CRGA
But also, a flip flop was also added to extend the LOAD Pulse for the timer (Before, as soon as one timer output was reloaded, the pulse ended, and this was causing many issues). Again, this delays forceload by one cycle.
The clock pipeline is complex, big, and kinda has it's own consciousness. It's based on Wolfgang Lorenz model (https://ist.uwaterloo.ca/~schepers/MJK/cia6526.html) with many tweaks to make it work. Although it now seems to work ok, I feel it's the weakest link, and that any attempt to make it better... will just make it worse.
After a very intense week, I'm going to let it cool a bit. Meanwhile I'll start working on B2 reusing B1 as it is.
Cheers!