gilhad wrote:
1) Yes, it have this pins, but devil is in details - the chip came here from prehistory, when Tyranosaurus Rex was autodialing modem over steam powered, paid and unstable telephone lines and then it was just perfect
- the CTS is OK - it is input pin and when The Other assert it (effectively saying "be silent and listen to me" ), my Transmit is blocked (and for me it looks like sending the last character is taking forever - until CTS is disasserted and I can talk again) - perfect, easy, convenient
- the RTS (Request To Send) is meant to power down the modem (and end call and save money and free line for peaople to use it) and so when it is asserted, it automatically prevent the chip from sending interrupt, when Transfer is complete (remember - modem is power down, nobody to talk to)
- but I would like to have something like "reverse CTS" to say The Other "YOU be silent and listen to ME", when the data came faster, than I can process (or buffer). And be able to send all responces to all requests, that The Other send me so far. And then again let The Other to speak more. There is no modem to hang up, there is not charge for the meter long cable to the PC on the same table, but small 8bit cannot run as fast as mighty 64bit is able dump its memory over line.
So the solution is get other output pin somewhere and connect it to CTS on other side (where my RTS would be, but I do not want also silence myself). Yes, The Other is probabely moder era and take RTS as complement to CTS. Sadly my 6850 is ancient and in its HW it still expect steam powered modem or something like that.
I suppose, that on new ICs (from this millenium, not last one) the RTS/CTS works exactly as I would need. But I want put to use, what I have at home in this case.
I see, interesting. I was not aware people used the RTS in that way.
Quote:
2) Basically yes, I do. 8 bit output, 8bit input, both times two (with Port B). But details are a bit different again
- this setting enable to set or reset just one bit, without possibly affecting others, in one atomic instruction (so also safe from interferrence from interrupts). In easy way: put in A which bits are you want (set the bits 1, others 0)
- write it to Set Register. Coresponding bits will go up, all others will stay as they are
- write it to Reset Register. Coresponding bits will go down, all others will stay as they are
no need to Read all bits before hand, then Manipulate just those interesting for this code and then Write it back (and risk, that some interrupt will change things in between)
Ah! That makes a bit more sense; so yes looking at more detail I can see how this would allow you to manipulate a bit in fewer instructions.
That being said, if I couldn't modify the hardware to do this, I would do it in software like so:
Code:
STI ; Disable interrupts
LDA #$08 ; Load bit to toggle
EOR $8000 ; Toggle bit in accumulator
STA $8000 ; Save bit to location
CLI ; Re-enable interrupts
This is about as close to atomic as you can get with a 6502, at least as far as I know. There's usually more to it, the devil is in the details as you say.
Best of luck!