6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Apr 29, 2024 12:32 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: dma and 6502
PostPosted: Mon Sep 11, 2006 8:58 pm 
Offline
User avatar

Joined: Sun Feb 13, 2005 9:58 am
Posts: 85
how can i find info about dma techniques with 6502?
thanx all!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 11, 2006 10:30 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
This will sound silly, but datasheets are your best bet. If the 6502 you're using doesn't have any kind of DMA facility on-chip, then you can simulate it by:

1) Holding phase-2 low (IF AND ONLY IF your 6502 is a static design; if it's a dynamic design, this will not work) will stop the processor dead in its tracks. Then, you can use external bus transceivers to tri-state the address, data, and some control bus signals once the CPU is suitably halted.


2) If you're using an older (dynamic logic) 6502, then you can also hold RDY in a negated state, to halt the processor on the next READ cycle (this applies also to opcode fetch). The disadvantage is that this won't work on WRITE cycles, due to how the older 6502s worked. This wasn't much of an issue in practice, however -- the Commodore 64's DMA engine worked by simply negating RDY, waiting 6 clock cycles to allow any write cycles pending to complete, then disabling bus transceivers.

You'll find modern 6502 implementations to be more accomodating to DMA, especially Western Design Center's chips. Their chips are not only DMA friendly, but also static designs.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 12, 2006 10:36 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
kc5tja wrote:
This ) Holding phase-2 low ...


Shouldn't that be HIGH? No datasheets at hand right now but I'm quite sure.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 12, 2006 5:42 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
No, it must be held low.

The 6502's bus tenure is broken into two phases: phase 1 (clock low) and phase 2 (clock high).

Phase 1 is when the CPU combinatorially computes the next bus state. Phase 2 is then it samples the bus state for the next cycle.

Therefore, phase 1 is, essentially, a wasted half-cycle from a data transfer point of view. This is why Commodore, Atari, Apple, et. al., all interleave video and CPU accesses to RAM, with video occuring during phase 1, and CPU during phase 2.

Thus, to delay the CPU for an indefinite amount of time (again, this is all assuming static logic), one can hold the CPU's clock low -- thus elongating phase 1 of the bus cycle.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Sep 12, 2006 8:10 pm 
Offline
User avatar

Joined: Sun Feb 13, 2005 9:58 am
Posts: 85
kc5tja wrote:
This will sound silly, but datasheets are your best bet. If the 6502 you're using doesn't have any kind of DMA facility on-chip, then you can simulate it by:


...anyway you give me a good hint!
thank you!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Sep 14, 2006 10:17 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
kc5tja wrote:
No, it must be held low. ...


I just downloaded a PDF from WDC and now there is no maximum time for PHI0 being (L) anymore. Its seems they improved the 6502 again.

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Sep 14, 2006 2:17 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
As far as I know, the CMOS version of the 6502 (and W65C02 in particular) has always been a static logic design, so it's always been more flexible with its clocking.

The NMOS variants were definitely dynamic logic though, as I remember several chips having minimum frequencies and duty cycle requirements (including chips from Commodore). It never made sense to me why minimum clock frequencies were imposed until I learned about the differences between static and dynamic logic.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Sep 14, 2006 5:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
The Rockwell, CMD, etc. 65c02's had a maximum phase-2-low time, but could hold phase 2 high indefinitely. WDC made it so you could hold it in either state as long as you want, and put the "S" at the end of the part number to mean "static". The NMOS ones had maximum times for both, so there was no way to run the clock below something like 100kHz regardless of duty cycle.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: barrym95838, Paganini and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: