- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The best way to debug something like this is to add SignalTap probes on the Avalon bus and your component's external interfaces, and see what is happening.
When you created your component, did you remember to increase the read wait cycles from the default 1 to 2?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I did increase it.
thanks and I'll try SignalTap.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you made sure that you aren't holding the component in reset? I see that you have used a "if reset = '1' then" jobby. Whenever I've written components I've always opted for a "if reset = '0' then". I do this as the examples I learned from all used active low reset. Just a suggestion, and apologies if this is a rubbish suggestion.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you build an SOPC component, signals are active high, except if you add '_n' to the name. i.e. if you call your reset signal 'reset', then it is active high. If you call it 'reset_n', then it is active low, and SOPC builder will invert the signal for you.
I prefer to use active high signals when I can, and when I don't/can't, I always add a _n to the name, even if I'm not working with SOPC builder. In my opinion using things like "if reset = '0' then" is less intuitive and makes code more difficult to maintain.- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page