22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

154 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

I----CLOCK CYCLE = I }Jsec---I<br />

CLOCK PHASE I PHASE 2 \'-- _<br />

1-300-1<br />

ADDRESS BUS Y// / / / / / / /X VALID<br />

'41'// "/<br />

READ/WRITE~4 I///l///<br />

I 100 1<br />

DATA OUT 'lZ/Zl/ftAW//l/l/7/AI.._...:.V;::AL::;;ID:---,X,,- _<br />

Fig. 5-2. 6502 write cycle timing<br />

The write cycle in Fig. 5-2 is quite similar. The address and write<br />

indication settle during Phase 1, and the data to be written is put onto the<br />

data bus by the processor at the beginning <strong>of</strong> Phase 2 and held until the start<br />

<strong>of</strong> the next Phase 1. Devices written into will, therefore, have to look at<br />

Phase 2 and read/write to decode a valid write operation, These are the only<br />

cycle types; all input and output is memory mapped.<br />

Being so simple, there must be limitations and indeed there are a<br />

couple. A ready line is available for slow memories to request additional time<br />

for access. If the 6502 sees a low level on this line at the beginning <strong>of</strong> Phase<br />

2, it will delay reading the data bus until the next cycle. The catch is that<br />

write cycles cannot be extended with this signal. 3 Actually, at the present<br />

state <strong>of</strong> the art, there is little if any cost advantage in using such slow<br />

memory. In fact, if only a couple hundred extra nanoseconds are needed, it<br />

would be better to reduce the clock frequency anyway. The other catch is that<br />

if "transparent latches" (level clocked) are used for output registers and the<br />

clock is Phase 2, then glitches at the outputs are likely when written into.<br />

The problem can be solved by either using edge-triggered registers (trigger at<br />

end <strong>of</strong> Phase 2) or by generating a delayed Phase 2 that does not become<br />

active until the data bus is stable.<br />

One unusual property <strong>of</strong> the 6502 is that the address bus cannot be<br />

disabled for direct memory access operations. This and the fact that there is<br />

no hold pin like on other microprocessors and write cycles cannot be stopped<br />

would seem to make DMA difficult, if not impossible. Actually, a little<br />

study <strong>of</strong> the bus timing reveals that if three-state buffers are added to the<br />

address lines and 400-nsec memory (or a slight clock slowdown) is used, then<br />

transparent DMA becomes possible. Transparent means that the processor is<br />

unaware that DMA is taking place and continues to run at normal speed.<br />

This would be accomplished by using Phase 1 for DMA operation and<br />

allowing the processor to use Phase 2 normally for data transfer. Since the<br />

processor never drives the data bus during Phase 1, only the processor's<br />

address bus would have to be disabled (via added three-state buffers) for<br />

DMA during Phase 1. The result is that a guaranteed continuous DMA rate <strong>of</strong><br />

3 A new 6502 version consrrucred wirh CMOS transisrors rhar became available in 1984<br />

does honor rhe ready signal during wrire cycles.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!