Altera_Forum
Honored Contributor
16 years agoneed help with my own peripheral device
I have finished writing a peripheral device.
it communicates with niosII cpu using avalon-mm bus. but when i read from it, i can't get the value i want. and writing to it also has no effect on it. the reg.h file i have defined is: /*************************************/# include <io.h># define IOADDR_ALTERA_AVALON_MM_DAQ_BOARD_COMMAND(base) __IO_CALC_ADDRESS_DYNAMIC(base, 0)# define IOWR_ALTERA_AVALON_MM_DAQ_BOARD_COMMAND(base, data) IOWR_32DIRECT(base,0,data)# define IORD_ALTERA_AVALON_MM_DAQ_BOARD_COMMAND(base) IORD_32DIRECT(base,0)# define IOADDR_ALTERA_AVALON_MM_DAQ_BOARD_DATA(base) __IO_CALC_ADDRESS_DYNAMIC(base, 4)# define IORD_ALTERA_AVALON_MM_DAQ_BOARD_DATA(base) IORD_32DIRECT(base,4) The vhd file is attached.