Results 1 to 3 of 3

Thread: DE10-NANO - NIOS+ADC+DMA+ONCHIP MEMORY+HDMI on Platform Designer

  1. #1
    Join Date
    Jan 2018
    Posts
    4
    Rep Power
    1

    Question DE10-NANO - NIOS+ADC+DMA+ONCHIP MEMORY+HDMI on Platform Designer

    Hello everyone, I'm new with FPGA, NIOS2 and Platform Designer and I have the DE10-nano board. As a project, I want to make a digital oscilloscope (a simple one at first).

    I have Quartus Prime Lite Edition 17.1 and Nios II SBT.

    The project consists on the following steps as I see it:
    1. Sample 12-bit data from ADC channel 0.
    2. Get the sampled data from the ADC to the on-chip memory through a DMA.
    3. Show on LCD connected through HDMI a waveform made from the data saved on the on-chip memory.

    Everything is controlled from a NIOS II Processor.


    I've been using the ADC demonstration provided by terasIC to sample data from channel 0 (only one channel) successfully.

    I tried adding a DMA controller and a On-chip memory to the Platform Designer to get all the sampled data from the ADC to the memory without success.

    If someone can shed some light I would really appreciate that.

    Hope I didn't miss any important information.

    Thank you very much in advance

  2. #2
    Join Date
    May 2013
    Posts
    794
    Rep Power
    1

    Default Re: DE10-NANO - NIOS+ADC+DMA+ONCHIP MEMORY+HDMI on Platform Designer

    Without seeing your design or details on what's not working and what troubleshooting you've tried so far, it's hard to help you out.

  3. #3
    Join Date
    Jan 2018
    Posts
    4
    Rep Power
    1

    Default Re: DE10-NANO - NIOS+ADC+DMA+ONCHIP MEMORY+HDMI on Platform Designer

    Hi, I attached my design.

    I don't understand how to initialize the DMA via NIOS2 - that's why I post the NIOS C code to get the ADC working from the board demonstration files. Hope you could show me what to add to get the data to the memory.

    Code:
    #include <stdio.h>
    #include <io.h>
    #include <unistd.h>
    
    #include "system.h"
    
    void main(void){
        int ch = 0;
        const int nReadNum = 10; // max 1024
        int i, Value, nIndex=0;
    
        printf("ADC Demo\r\n");
        while(1){
            ch = IORD(SW_BASE, 0x00) & 0x07;
    
            printf("======================= %d, ch=%d\r\n", nIndex++, ch);
            // set measure number for ADC convert
            IOWR(ADC_LTC2308_BASE, 0x01, nReadNum);
    
    
            // start measure
            IOWR(ADC_LTC2308_BASE, 0x00, (ch << 1) | 0x00);
            IOWR(ADC_LTC2308_BASE, 0x00, (ch << 1) | 0x01);
            IOWR(ADC_LTC2308_BASE, 0x00, (ch << 1) | 0x00);
            usleep(1);
    
            // wait measure done
            while ((IORD(ADC_LTC2308_BASE,0x00) & 0x01) == 0x00);
    
            // read adc value
            for(i=0;i<nReadNum;i++){
                Value = IORD(ADC_LTC2308_BASE, 0x01);
                printf("CH%d=%.3fV (0x%04x)\r\n", ch, (float)Value/1000.0, Value);
            }
    
            usleep(200*1000);
        } // while
    }

    Thank you in advance
    Attached Images Attached Images
    Last edited by SlimJohnny; May 4th, 2018 at 12:21 AM.

Similar Threads

  1. Is there an Editor in Platform Designer?
    By MaxplusII4ever in forum Quartus II and EDA Tools Discussion
    Replies: 4
    Last Post: May 3rd, 2018, 04:27 PM
  2. Platform Designer BFM bug
    By b_alban in forum Quartus II and EDA Tools Discussion
    Replies: 2
    Last Post: April 5th, 2018, 12:34 AM
  3. TerasIC DE10 NANO HDMI. Simplest example to start from, creating graphics.
    By paul.g.griffiths in forum Development Kit Related
    Replies: 8
    Last Post: January 29th, 2018, 07:12 AM
  4. BluePrint Platform Designer
    By mohsin_qau in forum Quartus II and EDA Tools Discussion
    Replies: 5
    Last Post: January 21st, 2018, 03:24 PM
  5. BluePrint Platform Designer and A++
    By flz47655 in forum Quartus II and EDA Tools Discussion
    Replies: 2
    Last Post: December 7th, 2016, 09:28 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •