Post Go back to editing

ADAS3022 not working

Category: Hardware
Product Number: ADAS3022

I have an EVAL-ADAS3022 with the FPGA in reset and powered using a bench power supply (no connection to a EVAL-CED1Z). My bus controller is connected to the ADAS3022 running the following code (XJEase) which I expect to yield 0x7FFF but instead yields differend results, can anyone see what I am doing wrong?

  • -- CODE --

    LOCAL ReadCycle()(INT readData)
    //CONST INT SPI_CPOL := 0; // 0 or 1 - the stable/starting state of SCLK
    //CONST INT SPI_CPHA := 1; // 0 (sample SDOUT on 1st SCLK edge) or 1 (sample on 2nd SCLK edge)

    //CONST INT CFG_DEF_VAL := 0xF7FF;
    INT i, j, writeData;

    SPI_SetSampleBeforeClockEdge(FALSE)();

    writeData := CFG_DEF_VAL;

    FOR j := 0 TO 1
    SET PIO.TEST_PIO := j[0];
    PRINT("TEST PIO - ", j[0], "\n");

    SET PD := 0, CNV := 0, RESET := 0;
    SET PD := 1;
    NANO_SLEEP(1000);
    SET PD := 0;
    NANO_SLEEP(100 * 1000 * 1000);
    SET RESET := 1;
    NANO_SLEEP(1000);
    SET RESET := 0;
    NANO_SLEEP(100 * 1000 * 1000);
    SLEEP(100);

    SPI_Initialise()();

    ToggleConversion()();
    SET nCS := 0;
    SPI_ReadWriteSerial(16, 0)(readData);
    SET nCS := 1;
    PRINT("read - 0b", BIN(readData[15..0]), " - 0x", HEX(readData[15..0]), "\n");
    SET nCS := 0;
    SPI_ReadWriteSerial(16, 0)(readData);
    SET nCS := 1;
    PRINT("read - 0b", BIN(readData[15..0]), " - 0x", HEX(readData[15..0]), "\n");

    ToggleConversion()();
    SET nCS := 0;
    SPI_ReadWriteSerial(16, 0)(readData);
    SET nCS := 1;
    PRINT("read - 0b", BIN(readData[15..0]), " - 0x", HEX(readData[15..0]), "\n");
    SET nCS := 0;
    SPI_ReadWriteSerial(16, writeData)(readData);
    SET nCS := 1;
    PRINT("read - 0b", BIN(readData[15..0]), " - 0x", HEX(readData[15..0]), "\n");

    ToggleConversion()();
    SET nCS := 0;
    SPI_ReadWriteSerial(16, writeData)(readData);
    SET nCS := 1;
    PRINT("read - 0b", BIN(readData[15..0]), " - 0x", HEX(readData[15..0]), "\n");
    SET nCS := 0;
    SPI_ReadWriteSerial(16, writeData)(readData);
    SET nCS := 1;
    PRINT("read - 0b", BIN(readData[15..0]), " - 0x", HEX(readData[15..0]), "\n");
    END;
    END;

    LOCAL ToggleConversion()()
    INT i;
    NANO_SLEEP(1000); // instead of polling busy
    SET CNV := 0;
    NANO_SLEEP(20);
    SET CNV := 1;
    NANO_SLEEP(20);
    SET CNV := 0;
    NANO_SLEEP(1500); // instead of polling busy
    END;

    -- RESULTS 1 --

    read - 0b1111110001100101 - 0xFC65
    read - 0b1000111111001111 - 0x8FCF

    read - 0b1111110001100101 - 0xFC65

    read - 0b1000111111001111 - 0x8FCF

    read - 0b1111110001100101 - 0xFC65

    read - 0b0000111111001111 - 0xFCF

    -- RESULTS 2 --

    read - 0b1111110001011100 - 0xFC5C
    read - 0b1000111111001111 - 0x8FCF

    read - 0b1111110001011100 - 0xFC5C

    read - 0b1000111111001111 - 0x8FCF

    read - 0b1111110001011011 - 0xFC5B

    read - 0b0000111111001111 - 0xFCF

    The results seem to have some pattern

  • Hi,  .

    We'll look into this and get back to you.

    Regards,
    Jo

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.