The fastest way to do this is most likely using IN
For port 1, bit 5 that is IN(37)
You could also use IO(37), but as the help files state, IO also reconfigures the
port to being an input, whether it needs to or not. IN just reads the port and
masks the bit.
Reading GPIO1_DATA for the BASICchip or FIO1PIN for the LPC17xx parts is
probably about equivalent, I have not tested it.
It may be faster to assign a variable to hold the address of the port and then
reading that variable as a pointer to memory.
In any case the difference will be quite small. On the BASICchip IN(x) takes
much less than 1 usec.
Questions about the BASICtools and MakeItC
1 post • Page 1 of 1