
Originally Posted by
cncmachineguy
Is it safe to assume DT_INT cost about 20 cycles when not used with PBP handler? This is just good to know.
With the 16F1's that's about what it takes to get IN and OUT of DT_INTS.
I didn't count it to the exact number of cycles. It can change depending on the setup.
I must admit, I'm not sure I get the rules for using LATx, ...
Throughout the manual you'll find this statement frequently ... "Pin is automatically made an input" or output.
So those commands will try to set the TRIS bit each time it executes.
When you give it a PORTx.x pin, PBP finds the TRISx.x bit by adding $80 to the ports address.
Here's the .LST from a LOW PORTA.0
Code:
00194 ; C:\ISIS\5US_INTS\ASMCNCGUY5US.PBP 00076 Z0001D LOW PORTA.0
001F 00195 Z0001D
00196 LOW?T _PORTA??0
001F 100C M bcf PORTA, 000h
0020 0021 M movlb (((PORTA) + 80h)) >> 7
00000001 M PREV_BANK = (((PORTA) + 80h)) >> 7
0021 100C M bcf ((PORTA) + 80h), 000h
But if you give it LATA.0, adding $80 makes it point to ANSELA instead of TRISA.
The TRIS bit doesn't get set, and the ANSELA gets changed.

I think I am most excited about the PRx knowledge.
And now you know why not to use LATx.x as a pin.
Knowledge is Power, and Power is intoxicating ...
Please drink responsibly.
Bookmarks