Forum Discussion
Altera_Forum
Honored Contributor
15 years ago2 Leds -> how many PIO?
Hi all, I'm writing a simple program on interrupt behaviour, with an interval timer (that generate timer interrupt and its handler make a ledg blink) and an hardware interrupt generated by a bu...
Altera_Forum
Honored Contributor
15 years agoIf you configured your PIO for individual bit setting, you can possibly use these:
IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(LED_PIO_BASE, led); // led on IOWR_ALTERA_AVALON_PIO_SET_BITS(LED_PIO_BASE, led); // led off led is the bit mask of the output(s) you want to set/clear: 1: for the first led 2: for the second led 3: for controlling both Should you extend the PIO for more outputs, they would be controlled by next bits: 0x4, 0x8, 0x10, 0x20, ....