Forum Discussion
Altera_Forum
Honored Contributor
17 years agoDMA reading multiple PIOs
Hi,
My system contains a total of twenty two (22) 16-bit I/O ports (Altera PIOs) that are used to read external (10 bit) ADCs. My system is running at 85MHz and my maximum sample rate should be around 1usec. I am currently reading these I/O ports individually (using the IORD_ALTERA_AVALON_PIO_DATA command) and I am not getting a fast enough through-put. Although they are sequential in memory addresses, and each PIO spans 16 memory addresses i.e.; PIO#1 memory space is 0x0060a100 through 0x0060a10f PIO#2 memory space is 0x0060a110 through 0x0060a11f . . . PIO#22 memory space is 0x0060a250 through 0x0060a25f I am not certain of why there is a 16 address memory span associated with this device, but it may be that each address represents a single bit of the 16 bit value. Since I don’t know how the PIO core is structured, and since the IORD_ALTERA_AVALON_PIO_DATA command returns a 16 bit short value, I feel there must be some manipulation within this routine that fetches/extracts the 16 bits and places them into a ‘short’ structure. My question is, is there a way to use the Altera ‘DMA’ to perform a read on the Altera I/O’s? What I really need is a way for the DMA to read the PIOs sequentially and transfer this data to SRAM. I believe if this is possible, I could improve my sampling rate by offloading the read function to the DMA. Thanks in advance for any and all help. Fred12 Replies
- Altera_Forum
Honored Contributor
Yes I agree with Jake, You most likely want to to write your own custom io.
At the very least you can insure your ADC sampling is consistent. By the number of ADC's you're talking about, you could probably do some of your number crunching and pass the date to nios when it really needs it. Pete - Altera_Forum
Honored Contributor
You could use a scatter-gather DMA controller and program the descriptors to continuously read each PIO in a round-robin fashion. If you have a little HDL knowledge, you could write your own block to do this for you and ditch the PIOs altogether.
Jake