Shop OBEX P1 Docs P2 Docs Learn Events
FIFO RDFAST block size — Parallax Forums

FIFO RDFAST block size

In my attempt at improving SD-card performance through multi block writes I encountered the rdfast and rfbyte instructions. According to the PASM2 manual:

RDFAST {#}D,{#}S
Begin new fast hub read via FIFO. D[31] = no wait, D[13:0] = block size in 64-byte units (0 = max), S[19:0] = block start address.

As the current code always writes 512 bytes, it could use D[13:0] = 4 I guess? It instead uses 0, which if my understanding is correct would mean 16K blocks a 64 bytes, or 1MB. So always more than the current memory of 512KB available. Is this correct? Or maybe to rephrase the question: why would I ever write anything but 0 in there, given that I can apparently just reschedule any time?

Comments

  • I'm not entirely sure what the point of FIFO wrapping is, either.

    If you're doing video with the streamer, I guess you could use it to have the FIFO run through a wrapping line buffer autonomously. Though you'd still need to continually issue streamer commands, at which point you might as well do a non-blocking FIFO restart.

  • Ok, so it wraps around. That at least is interesting I guess. Makes implementing a ringbuffer easier (while limiting oneself to just one of course).

  • pik33pik33 Posts: 2,350

    A simple example: a function generator. Keep the waveform in the hub, program the streamer once, let it be generated.

Sign In or Register to comment.