Jump to content

Udayan Mallik

Members
  • Posts

    52
  • Joined

  • Last visited

Community Answers

  1. Udayan Mallik's post in Ethernet Port in Eclypse Z7 was marked as the answer   
    @artvvb
    After much experimentation my lwip_echo_server routine is now operational. I can ping an Eclypse Z7 card. Since I use Vitis 2021.2 a large part of online help tends to be useless. I proceeded as follows.
     
    1. To confirm that the Realtek PHY chipset can communicate with a Zynq FPGA I used the document found here https://media.digikey.com/pdf/Data Sheets/Digilent PDFs/Eclypse_Z7_HRM_Web.pdf 
    2. To use lwip resources I altered the Board Support Package in Vitis.
     A. In the Platform project - Double click the Platform.spr file.
    B. Click the ps7_cortex_a9->Zynq fsbl->Board Support Package Tab in the drop down menu.
    C. Click on the "Modify BSP Settings ..." tab near the top of the page.
    i. In the Overview tab - Select lwip211 libraries.
    ii. Then click the Standalone tab.
    Set the use_axieth_on_zynq to 0 (since the ZYNQ GEM will be used).
    D. Click the ps7_cortex_a9->Standalone on ps7_cortex_a9_0
    E. Click on the "Modify BSP Settings ..." tab near the top of the page.
    i. In the Overview tab - Select lwip211 libraries.
    ii. Then click the Standalone tab.
    Set the use_axieth_on_zynq to 0 (since the ZYNQ GEM will be used).
     F. Create a new Application program with the lwip_server_echo option (instead of Hello World) and voila! You have ethernet connection. You can ping IP address 192.168.1.10.

  2. Udayan Mallik's post in Eclypse Z7, Using 2 Channels of DAC simultaneously was marked as the answer   
    @artvvb Here it is. You are required to modify the "main" routine and the "dacRampDemo" routine as shown below.
    void dacRampDemo(float offset, float amplitude, float step, uint8_t channel, uint8_t frequencyDivider, uint8_t gain)
    {
        ZMODDAC1411 dacZmod(ZMOD_DAC_BASE_ADDR, DMA_DAC_BASE_ADDR, IIC_BASE_ADDR, FLASH_ADDR_DAC, DMA_DAC_IRQ);
    xil_printf("Not Doing anything\n\r");
    uint32_t *buf;
    float val;
    uint32_t valBuf_1, valBuf_2;
    int16_t valRaw;
    size_t length = (int)(amplitude/step) << 2;
    int i;
    if (length > ((1<<14) - 1))
    {
    // limit the length to maximum buffer size (1<<14 - 1)
    length = ((1<<14) - 1);
    // adjust step
    step = amplitude/(length>>2);
    }
    buf = dacZmod.allocChannelsBuffer(length);
    dacZmod.setOutputSampleFrequencyDivider(frequencyDivider);
    dacZmod.setGain(channel, gain);
    dacZmod.setGain(channel-1, gain);
    i = 0;
    // ramp up
    for(val = -amplitude; val < amplitude; val += step)
    {
        valRaw = dacZmod.getSignedRawFromVolt(val + offset, gain);
        valBuf_1 = dacZmod.arrangeChannelData(channel, valRaw);
        valBuf_2 = dacZmod.arrangeChannelData(channel-1, valRaw);
        buf[i++] = (valBuf_1<<16) | (valBuf_2>>16);
    }
    // ramp down
    for(val = amplitude; val > -amplitude; val -= step)
    {
        valRaw = dacZmod.getSignedRawFromVolt(val + offset, gain);
        valBuf_1 = dacZmod.arrangeChannelData(channel, valRaw);
        valBuf_2 = dacZmod.arrangeChannelData(channel-1, valRaw);
        buf[i++] = (valBuf_1<<16) | (valBuf_2>>16);
    }
    // send data to DAC and start the instrument
    dacZmod.setData(buf, length);
    dacZmod.start();
    dacZmod.freeChannelsBuffer(buf, length);
    }
    int main()
    {
        init_platform();
        xil_printf("Hello Eclypse Z7!\n\r");
        //xil_printf("Testing ADC ZMOD...\n\r");     // COMMENTED
        //adcDemo(0, 0, TRANSFER_LEN);            // COMMENTED
        xil_printf("Testing DAC ZMOD...\n\r");
        dacRampDemo(-0.05, 3.90, 0.005, 1, 255, 1);
        cleanup_platform();
        return 0;
    }
×
×
  • Create New...