It is true that in FX3, IO Pins are not grouped. So you have to write the values individually to the GPIOs. However you can reduce the time delay between writing to one GPIO and another, by writing directly using the registers instead of APIs. By this, even though you write individually one by one, as this operation is very fast, it would appear that all the 8 GPIOs are written at the same time.
You can write to a GPIO by setting the b0 Bit (LSB) of the GPIO_SIMPLE register as 1 or 0 using the firmware. There are 61 GPIO_SIMPLE registers. The base address is 0xE0001100 . The address of each is calculated as GPIO_SIMPLE(x) = 0xE0001100 + (x*0x4). Hence GPIO_SIMPLE(0) is at address 0xE0001100, GPIO_SIMPLE(1) is at address 0xE0001100 + 0x4 and so on. The definition of each of these is the same. (Refer section 10.22.1 in FX3 TRM).
For example to set GPIO as 1:
The address is 0xE0001100 + 2 * 0x04 = 0xE0001108
To set the MSB of this as 1,
*(uint32 *)(0xE0001108) |= 1;
Similarly, you can do for 7 other GPIOs.
- Madhu Sudhan
That makes sense. Thanks for your help.
One more question if I may. The example you supplied shows a fast way to write to the I/O pins using direct addressing. Would you be able to help me to read data quickly from a simple I/O port using direct addressing too?
Thanks in advance.