IO speeds

Questions about the BASICtools and MakeItC
Post Reply
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

IO speeds

Post by YahooArchive »

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.

Post Reply