Altera_Forum
Honored Contributor
14 years agoSpi_slave_to_avalon_mm + qsys + pio
Hi!
I try to implement very simple design using QSYS. It's SPI to GPIO converter (it's just a part of much more complicated design). I just want to control some GPIOs sending appropriate command via SPI . In QSYS I added SPI_SLAVE_TO_AVALON_MM_MASTER_BRIDGE which is connected to PIO. PIO is configured as 8-bit output register. QSYS automatically set the PIO's base address to 0x00 - 0x1f. I attach a screen-shot with a view of design from QSYS. Now the problem is that I can't find in "Embedded Peripherals IP" documentation what I exactly have to send via SPI to set PIO outputs in appropriate state. I know that in order to set any of the outputs to 1 or 0 I have to write to "Data" register(offset = 0) of PIO. In "Embedded Peripherals IP" documentation I found a very short example of "Bits ti AVALON-MM Transaction". But I don't understand what are "escape characters"(0x4D) for? What are "Idle characters"(0x4A) for? And what about an address where I have to send the data? The base address that QSYS assigned to PIO is 0x00 and offset of "data register" is 0 so is the data reg address 0x00 + 0 = 0x00? Or am I wrong? I would appreciate any help. Kind regards, Krzysiek :-)