Jake,
Thank you for your reply. Hope you had a great weekend. We had some colder weather in our forecast (Bozeman, Montana), so we were busy preparing our garden over the weekend. The first frost of the season was on the car windows this morning…
From what I was looking at on the scope, I felt there was a longer delay in the reading of the PIOs than what you indicated. I will take a closer look. The read for the PIOs is driven by a timer (RAW_Read). The timer is disabled when it generates an interrupt, and the Nios II program then reads the 22 PIOs. The timer is then re-started. This will provide a little break in the data reading, but it should be acceptable since we will only be reading data at a 1 usec sample rate very rarely. Still, I would like to get as close as possible to this rate.
The PIOs are read into a buffer, and after the RAW_Read timer has been restarted, there is another routine that pulls the data from the buffer and places it into sequential memory ring buffer. This routine keeps track of the number of reads, and once we have 11 sets of readings (484 bytes), a header and footer are attached to the data to create a 512 byte block. This 512 byte block is then transferred into a USB ring buffer in another memory space. This frees up the reading memory for the high sample rate reads. The data is then accumulated in the USB ring buffer memory until we have (??, currently 10) complete 512 byte blocks to send to the host using USB in ‘BLOCK Mode’ (DMA controlled).
I feel the balance between the size of the USB ring buffer and the rate at which we are reading data is something I need to play with.
In addition, I am generating signals for the system to be sent to the 12 DACs. These majority of these signals are relatively slow speed (the one fastest signal is >= ~100 usec), and I will normally only be using half of the DACs to generate signals.
Sorry for the long windedness but I wanted to give you a little more info on what else was going on. Because of the nature of the system and the requirements, any increase in reading speed/decrease in processing time needs to be implemented. If you have some pointers I can use to do this, I would appreciate it greatly and of course if you have some HDL code that could speed up the reading that would be super.
As always, thank you very much for your help. Have a great day and take care.
Fred