Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- You don't need a fifo core.... The fifo core is only if you want to buffer avalon streaming data to avalon memory mapped data. I'm not sure how you are using the ADCs but my suspicion is that it is done through NIOS. Hence all you need to do is safe the sampled data into an array in C code (i.e. buffering in on-chip ram). The when you send out your uart information, you will be taking data out of that array. In another one of your threads I posted a link to code that used uart interrupts. In that code, buffers are also used to store data for send out and collect incoming data. They were RxBuffer and TxBuffer. Look through that code, you should get an idea of how to use these buffer arrays. If you want to use SDRAM, then you need to use IOWR and IORD functions to write your ADC data to specific SDRAM addresses, and then read the data out to send via uart. It's easier to use on-chip ram if you have the memory blocks. --- Quote End --- Hi Krasner, Thanks for your reply. OK, now I know there are two options, either buffering in on-chip ram or SDRAM I have an issue where the rate the data is sent to serial port (50Hz) is way faster than the serial port can receive (8Hz). The incoming signal (50Hz) is from ADC receiver in VHDL block sent to the Nios. Basically, what I have is, data is sent from fpga vhdl block to NIos II system, Nios II system sends the data to serial port, Matlab access the serial port to real time plot the graph. 1. My question is, how by using say buffering in on-chip ram will help in this context? By doing so, I will still be losing some of the cycles? Am I right? 2. I just want to know if I understand the difference between the two, buffering in on-chip ram will require me to assign the data to an array (just like normal array assignment in C code?) and buffering in SDRAM would require me to use the iowr/iord because sdram is not built inside Nios, am I right? 3. What is the difference between "buffering in on-chip ram" and "assigning a data to the on-chip ram"? 4. I assume I do not use interrupt in this case right? 5. I did google and found this fifo example in C code, (http://coactionos.com/embedded%20design%20tips/2013/10/02/tips-a-fifo-buffer-implementation/ (http://coactionos.com/embedded%20design%20tips/2013/10/02/tips-a-fifo-buffer-implementation/)) Why people want to do the complicated fifo way if a normal array assignment in C can do the same?? Thank you in advance.