Shop OBEX P1 Docs P2 Docs Learn Events
alot of fast data — Parallax Forums

alot of fast data

MabMab Posts: 12
edited 2008-08-29 20:12 in General Discussion
I am trying to read 64 words fast put them in to ram and output them after I am done reading. using the sx/28
·
On the basic stamp I could do it like this.
·
FOR i=0 TO 126 STEP 2
PULSOUT conv, 2
SHIFTIN dat, clk, MSBPRE, [noparse][[/noparse]number\16]
PUT i, Word number
NEXT
·
FOR i=0 TO 126 STEP 2
GET i, Word number
DEBUG DEC number, CR
NEXT
·
Is there an easy way to write to all the banks? Or will I need to make a loop for ever bank.

Comments

  • JonnyMacJonnyMac Posts: 9,392
    edited 2008-08-27 22:52
    SX/B 2.0 still has some testing to go through and when it's released you'll be able to declare 64-byte array; until then you can create code like what I've attached.

    [noparse][[/noparse]Edit] It occurred to me that I have the SX/B 2.0 beta so I lifted the assembly code generated for working with big arrays and put it into the PUT_SCRATCH and GET_SCRATCH routines -- a lot cleaner. I'm not much of an assembly guy, so I can't really explain how it works; I can tell you that it does.

    Post Edited (JonnyMac) : 8/27/2008 11:14:50 PM GMT
  • MabMab Posts: 12
    edited 2008-08-29 14:46
    thank you for the help I was able to get it up to 80 bytes befor i filled the ram.·i got the SX48·on order and it will have the·room i need. ···
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-08-29 15:22
    Jon,
    The real address is calculated using this:
    fsr_addr = (idx + (idx & $F0) + base) | $10
    in which idx is the logical index in the array, and base is the start address of the array (which is·scratchA)

    regards peter
  • JonnyMacJonnyMac Posts: 9,392
    edited 2008-08-29 20:08
    I sincerely look forward to the day you post actual working code that someone can grab and run with... always theory, never real code. Sheesh.

    I will look at the compiler output again to see if I made an error in my transcription.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-08-29 20:12
    Jon,
    I understood that. I just explained what the assembly code was doing.
    Just in case somebody would be interested in what was going on.

    Edit: Jon, I noticed you edited your post.
    The code is working as you used it. The formula is valid for all addresses.

    regards peter

    Post Edited (Peter Verkaik) : 8/29/2008 8:25:04 PM GMT
Sign In or Register to comment.