- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an SOPC system with some custom components and 2 Altera PIO components. I am trying to write to a PIO using this function, for example:
IOWR(PIO_0_BASE, 3, 0x0); // Clear edge capture register However, I get a compile error saying that PIO_0_BASE is undeclared, even though i am doing a# include "system.h" at the top of my code. Isn't that the preferred way to access components in the system? My code will work if I copy this file from system.h into my code: # define PIO_0_BASE 0x00010800 But that defeats the purpose of having all the registers defined in one place! I was under the impression (from reading the niow SW dev manual) that you don't normally have to explicity# include system.h. anyway. Any ideas on what I'm doing wrong? I'm relatively new to C AND the Nios so this may be a C newbie error or a Nios newbie error. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gifLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look at the software templates/examples. Any that need base addresses, always# include "system.h".
What's more, for the PIO, you'll probably want to be including altera_avalon_pio_regs.h. Cheers, - slacker- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, slacker.
Including system.h AND altera_avalon_pio_regs.h worked. --- Quote Start --- originally posted by slacker@Mar 22 2007, 11:03 AM look at the software templates/examples. any that need base addresses, always# include "system.h".
what's more, for the pio, you'll probably want to be including altera_avalon_pio_regs.h.
cheers,
- slacker
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=22429)
--- quote end ---
--- Quote End ---
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page