Altera_Forum
Honored Contributor
18 years agousing PIOs to communicate with an LCD controller
Hi everyone. Karthik here.
I am using an LCD controller to communicate with the optrex lcd module and i want to send the data to the controller from the nios processor thru pios. can anyone tell me where i can find information about the macros defined in the altera_avalon_pio_regs.h header file. i am using the following code to do this but im not getting any transitions on the pios (on the scope) # include "stdio.h"# include "system.h"# include "altera_avalon_pio_regs.h"# include "alt_types.h" int main (void) { alt_u8 data[15]={0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54, 0x55}; alt_u8 reset; alt_u8 we; volatile int ack; volatile int i; reset = 1; do { ack = IORD_ALTERA_AVALON_PIO_DATA(LCD_ACK_PIO_BASE); }while (!(ack)); we=1; while(1) { for(i=0;i<16;i++) { IOWR_ALTERA_AVALON_PIO_DATA(LCD_DATA_PIO_BASE,data[i]); ack = IORD_ALTERA_AVALON_PIO_DATA(LCD_ACK_PIO_BASE); while (!(ack)); } i=0; } return (0) ; }