--- Quote Start ---
originally posted by fplank@Jun 5 2006, 02:55 AM
hello
thanks, but i know this paper (nios ii hardware development tutorial ) allready. this paper shows fine how to build a soc with standard components.
but my problem is, that i have a own component topach_avalonslave wich a
avalonreadslave base adr:0xyyyyyyyy and avalonwriteslvae base adr: 0xzzzzzzzz
and my question is how can i write an value like int i=2 on the avalonwriteslave and how can i read the value from the avalonreadslave?
can i use the macros like
iowr_altera_avalon_pio_data(????;i);
thanks for your help
lg florian
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15908)
--- quote end ---
--- Quote End ---
Hi lg florian,
It sounds like what you want to do are memory mapped IOs. You can declare a pointer to the address locations directly (or use the system.h declarations of the component's base address with an offset).
Then you only have to write a value to a pointer location or read back a value from a pointer location in your program.
It may look something like this (this is a very simple way of doing this, I'm sure there are much better ways):
// defines LED_BASE to have address value # define LED_BASE 0xyyyyyyyy
volatile unsigned int *led_port = ((volatile unsigned int *) (LED_BASE));
// declares pointer to LED_BASE address location
.
.
void main()
.
.
*led_port = 0x5555aaaa; // writes value to LEd_BASE address
.
.
I hope this helps.
Regards,
-ATJ