Can you read and write a subset of portA pins in assembly language ?
Bill Baird
Posts: 23
I would like to permanently dedicate 24bits of portA to high speed output (Max 20 MHz) and permanantly dedicate the remaining 8 bits as input for high speed input reads (>50 KBs). So I need assembly routines I believe.
The [noparse][[/noparse]pins] modifier only exists in Spin, and mov can only write all 32 bits to OUTA as best I can see.
The new full manual says something about using the MUXC and a mask, but MUXC only sets the masked bits in a destination to the value of the C flag as best as I can decifer it.
The [noparse][[/noparse]pins] modifier only exists in Spin, and mov can only write all 32 bits to OUTA as best I can see.
The new full manual says something about using the MUXC and a mask, but MUXC only sets the masked bits in a destination to the value of the C flag as best as I can decifer it.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
When you write to OUTA, only those bits set to ones in DIRA will be changed. The other bits are treated as inputs. This is assuming you want to write all 24 bits at once. If you want to change a subset of the output bits, you can read OUTA into a register, AND it with a mask to zero the bits you want to change, OR the result with the changed bits, and write the register back to OUTA. If that takes too many clocks, the other option is to arrange things so that changes can occur in groups of nine bits. Then you can use MOVI, MOVD, or MOVS with OUTA as the destination location.
-Phil
The DIRA provides the mask. Very straightforward it seems if I want to keep the direction mask constant in DIRA.
Looks like I doubled this question because at first I couldn't see my post show up in my browser, so I rewrote it.
Damn ! I don't know how to delete it either. I guess the administrator will catch it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life is one giant teacup ride.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com