Re: Understanding the SID
Posted: Fri Aug 19, 2016 2:46 pm
Tests have proven me wrong so I have to step back to the noise question again 
According to the timing diagrams and the schematics the shift is performed in two steps and starts one cycle after bit 19 of the oscillator goes high. The following table shows the noise clock status during shifting:
In the first step bits are interconnected and the output of each bit is latched into the following.
In the first clock half of the second step the latched value becomes active.
If test or reset signals are active the phase 1 is repeated at each cyle until the signal is released triggering the second phase.
The interesting thing that emerged when running some test programs on a c64 is that the writeback only happen when combined waveforms are selected during both phases of the shift:
Furthermore the same combination that drives down the bits must be included in both steps, i.e having noise+triangle and then noise+sawtooth won't change the bits while switching from noise+saw to noise+saw+triangle will.
I would have expected that having combined waveforms pulling down the bits during the first step was enough to affect the LFSR register state but actually it is not. If anyone have a good explanation for this it would be nice to hear
According to the timing diagrams and the schematics the shift is performed in two steps and starts one cycle after bit 19 of the oscillator goes high. The following table shows the noise clock status during shifting:
Code: Select all
| bit19 | clk | LC c1 c2 |
-----|-------|-----|----------|
clk1 | 0 | 1 | 0 1 1 |
clk2 | 0 | 1 | 0 1 1 |
-----|-------|-----|----------|
clk1 | 1 | 1 | 0 1 1 | <- bit19 raises
clk2 | 1 | 1 | 0 1 1 |
-----|-------|-----|----------|
clk1 | 1 | 0 | 1 0 0 | <- shift phase 1
clk2 | 1 | 0 | 1 0 0 |
-----|-------|-----|----------|
clk1 | 1 | 1 | 0 1 0 | <- shift phase 2
clk2 | 1 | 1 | 0 1 1 |In the first clock half of the second step the latched value becomes active.
Code: Select all
bit n | bit n+1
latch output | latch output
--------------|--------------
A <-> A | B <-> B
A <-> A | B <-> B
--------------|--------------
A <-> A | B <-> B
A <-> A | B <-> B
--------------|--------------
X A --|-> A B <- shift phase 1
X A --|-> A B
--------------|--------------
X --> X | A --> A <- shift phase 2
X <-> X | A <-> AThe interesting thing that emerged when running some test programs on a c64 is that the writeback only happen when combined waveforms are selected during both phases of the shift:
Code: Select all
phase 1 | noise | noise+saw | noise+saw
phase 2 | noise+saw | noise+saw | noise
--------|-----------|-----------|-----------
result | no | writeback | no
| writeback | | writebackI would have expected that having combined waveforms pulling down the bits during the first step was enough to affect the LFSR register state but actually it is not. If anyone have a good explanation for this it would be nice to hear