例子1, set IOB to toggle PB0 pin which can be observed using one LED.
IFCONFIG = 0x00; // set the ports as general-purpose I/O
OEB |= 0xFF; // set PORT B as outputs
IOB |= 0x01; // set PB0 high
EZUSB_Delay(2000); // delay for ~2000 ms
IOB &= 0x00; // set PB0 low
例子 2, set PA0 pin as high output.
IFCONFIG = 0x00; // set the ports as general-purpose I/O
PORTACFG &= 0x00; // set the bit0 of PORTACFG register to “0” as GPIO
OEA |= 0x01; // set PA0 as output
IOA |= 0x01; // set PA0 high