please dont rip this site

Bob Ammerman [RAMMERMAN at PRODIGY.NET] of RAm Systems (high performance, high function, low-level software) says

Actually, you can get by with fewer bits without much, if any, loss of functionality, performance, to wit: Assuming you are using '161 style counters to access 64KB of memory, here is a 12 I/O's solution:

Note that this can easily be expanded, without using _any_ more I/O's by adding additional 161's and daisy chaining the Q outputs of each pair to the data inputs of the next pair.

To set a random address:

    bsf        RAMOE                 ; Tell the RAM not to drive the bus
    clrf        RAMTRISPORT,F        ; Drive the bus
    bcf        LOAD161               ; Set counters up for sync load
    movlw  high(desired address)
    movwf  RAMDATAPORT
    bsf       CLK161                 ; Write high addr into low counters
    bcf       CLK161
    movlw  low(desired address)
    movwf  RAMDATAPORT
    bsf       CLK161                 ; Move high addr to high counters...
    bcf       CLK161                 ; ...and write low addr to low counters

To read several sequential bytes:

    bsf       LOAD161                ; Set counters up to count

    setf      RAMTRISPORT,F          ; Don't drive the bus
    bcf       RAMOE                  ; Tell the RAM to drive the bus

    movf    RAMDATAPORT,W            ; Get the byte
    ...do something with it...

    bsf       CLK161                 ; Advance to the next byte
    bcf       CLK161

    movf   RAMDATAPORT,W             ; Get the byte
    ...do something with it...

    bsf       CLK161
    bcf       CLK161

    movf  RAMDATAPORT,W              ; Get the byte

    etc.

Writing works very similarly, but you have to disable the /WR input the the RAM while changing the data and address:

Assume we have just set a random address as outlined above:

    bsf         LOAD161              ; Set counters up to count
    movlw    data_to_write
    movwf    RAMDATAPORT
    bcf          RAMWR
    bsf          RAMWR
    bsf          CLK161
    bcf          CLK161
    movlw    data_to_write
    movwf    RAMDATAPORT
    bcf          RAMWR
    bsf          RAMWR
    bsf          CLK161
    bcf          CLK161

    etc.

You can reduce the number of I/O's to 11, at the cost of slower writes (which are usually much less frequent than reads), as follows:

Now, when writing sequentially, do the following (assuming the address has been set up as described above):

        movlw        data_to_write
        movwf       RAMDATAPORT
        bcf             RAMGO        ; Since LOAD161 is low this will write to the RAM
        bsf             RAMGO

        bsf            LOAD161       ; Get ready to count
        bsf            CLK161        ; Bump address
        bcf            CLK161
        bcf            LOAD161

        movlw        data_to_write
        movwf       RAMDATAPORT
        bcf             RAMGO        ; Since LOAD161 is low this will write to the RAM
        bsf             RAMGO

        bsf            LOAD161       ; Get ready to count
        bsf            CLK161        ; Bump address
        bcf            CLK161
        bcf            LOAD161

        etc.

file: /Techref/mem/sram161.htm, 4KB, , updated: 2000/6/12 13:47, local time: 2024/11/24 05:36,
TOP NEW HELP FIND: 
3.133.152.26:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/TECHREF/mem/sram161.htm"> mem sram161</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .