P2 PASM RDFAST
pic18f2550
Posts: 400
Hello,
I need a fast routine to load 64 long from HUBRAM to COGRAM.
I thought about rdfast.
var byte buf[64] PUB main() coginit(COGEXEC_NEW, @code, @buf) DAT org code rdlong linebuf,ptra rdfast #64,linebuf ' ........ Code .......... jmp #code linebuf res 64
Is this correct?
Comments
Why not just do:
Also: long buf [64]
Btw, rdfast doesn't read anything, it sets up so you can normally use the'read fast' instructions rflong/rfword/rfbyte although the setq method is stacks simpler for reading in a buffer and super fast.
See the FAST BLOCK MOVES section in the doc.
The main reason is he doesn't read/speak English. Has to translate what we tell him here. The docs don't translate well.
Found it.
With this, reloading driver parts is child's play.
SETQ #x 'x = number of longs, minus 1, to read
RDLONG first_reg,S/#/PTRx 'read x+1 longs starting at first_reg
What I still suspect is that "PTRx" must be used.
As far as I know, PTRx is read-only.
Is there another way to set 4 or more different values?
No, PTRx is not required in the RDLONG following SETQ, you can pick any register with an address to start reading from. If it is not PTRA or PTRB then you just won't get this register updated at the end of the transfer. i.e. this register's original value will be left intact, but the burst will still occur. This is the "RDLONG first_reg, S" case above, where S can be any non-PTRx register.
Thank you