DerTrueForce wrote:
Sorry, BDD, I was referring to the extract of POCs firmware that you sent me a while back. That's what doesn't work for me. I suspect the indexed write may be to blame. One of these days I'll single-cycle through an indexed write and find out just how the 'C02 behaves when it does one of those.
There is some evidence that the 'C02 does a dummy read of the addressed location before writing when using absolute index addressing. During setup of any of the 26* or 28* NXP UARTs, if the addressed register is
MR (
MR0,
MR1 or
MR2), the dummy read will be "destructive," in that the read will increment the
MR pointer. For example, if an earlier instruction set
MR to
MR1 in preparation for writing a setup value to
MR1, the dummy read will advance the
MR pointer to
MR2 and the write will instead touch
MR2.
See this, in which this anomaly was brought up. Jeff suggested a bit of a code hack involving a forced crossing of a page boundary that apparently avoids the problem. The problem won't occur in a properly designed 65C816 system due to the address qualification provided by the
VDA and
VPA outputs.