PIO communication between software and hardware
I have a system I'm attempting to build that needs to transfer data between the C software and the verilog HDL. I was attempting this using bidirectional PIOs. Now if I understand these correctly the output of a PIO gets written to the base address register of the PIO which is determined by the system.h
ie IOWR(PIO_0_BASE, 0, 0x1) Now when this occurs and I am debuging the code in the Nios IDE no change is made to that address in memory. I can write to the offset of 1. Now dong some reading I believe this is due to the PIO in output mode only drives that value to the PIO connection but doesn't necessarily set it. So within the instantiaion of the Nios cpu I created a register that should hold this value of the PIO. However from what I can see this register does not get the data. My question is two fold here. Is there a better way to communicate between software and hardware? I should mention that this data I am writing from software needs to go across the GPIO connectors on the DE2 evaluation board. Or the easier route here is that am I missing something within my code or has anyone completed a similar design where you write data from software to a PIO that is stored in some register or memory location that can be written to a GPIO at a later (less than a second)? Thanks for any help you can provide. If this sounds confusing and you think you can help please just ask for a better explanation since I tried to make this as general as possible without diving into code too much.