Post Go back to editing

ADE9000 - Streaming Waveform Buffer in Fixed Rate Mode

Hi,

I am trying to stream back 1024 samples from the ade9000 using the continuous mode. I can read the resampled data just fine, and also the fixed data fine as long as it is in "Stop when Buffer is Full Mode". I am using a raspberry pi 4 connected via spi. When I stream back continuous samples the data appears disjoint. I have tried just using the burst read to read 1024 samples worth (all channels). this is the out put.

 

I have also tried  setting WFB_PG_IRQEN to 0x8000 in order to indicate that the page 15 has been filled. I then set the CS pin low and poll STATUS0 until bit 17 is set. I reset STATUS0 bit 17 then finish by putting CS High. I start a burst read of the buffer for all of its points. Then loop back to polling the STATUS0 and repeat until I have 4 buffers worth. I get similar looking data. I am not sure what I am doing wrong here but I know this is possible with the tabview code. Could anyone explain how this is meant to be done with sudo code?

Parents
  • I setup 


    ADE_SPI_WRITE(ADDR_WFB_PG_IRQEN,0x8080,0x2); //set irq for half full and full
    ADE_SPI_WRITE(ADDR_MASK0,0x20000,0x4); //enable wfb_pg_irq
    ADE_SPI_WRITE(ADDR_WFB_CFG,0x03F0,0x2); //set dready to 8khz after pf continuous fill fixed samples no neutral

    void IRQ0_irq(){

    ADE_SPI_WRITE(ADDR_STATUS0,ADE_SPI_READ(ADDR_STATUS0,0x04),0x4); // clr page irq in stats0

    //determine if 1st half or second half is to be read.

    // make sure you can get all data out before next IRQ 


    if (ADE_SPI_READ(ADDR_WFB_TRG_STAT,0x04) && 0xf000000 == 0x70000000)
    get_1st_half_buffer();  // 0x800 to 0xBFF


    if (ADE_SPI_READ(ADDR_WFB_TRG_STAT,0x04) && 0xf000000 == 0xf0000000){
    get_2nd_half_buffer(); //0xC00 to 0xFFF

    }

  • Ok so I think this works for me. What I changed is minor but thanks a bunch.

    void read_continuous(int samples)
    {
    SPI_Write_16(ADDR_WFB_PG_IRQEN, 0x8080); //set irq for half full and full
    SPI_Write_32(ADDR_MASK0, 0x20000); //enable wfb_pg_irq
    SPI_Write_16(ADDR_WFB_CFG, 0x03F0); //set dready to 8khz after pf continuous fill fixed samples no neutral
    SPI_Write_32(ADDR_STATUS0, SPI_Read_32(ADDR_STATUS0));
    While (points_read < samples)
    {
    if ((SPI_Read_16(ADDR_WFB_TRG_STAT) & 0xf000) == 0x7000)
    {get_1st_half_buffer();  // burst read 0x800 to 0xBFF}
    if ((SPI_Read_16(ADDR_WFB_TRG_STAT) & 0xf000) == 0xf000)
    {get_2nd_half_buffer();  // burst read 0xC00 to 0xFFF}
    }
    }
Reply
  • Ok so I think this works for me. What I changed is minor but thanks a bunch.

    void read_continuous(int samples)
    {
    SPI_Write_16(ADDR_WFB_PG_IRQEN, 0x8080); //set irq for half full and full
    SPI_Write_32(ADDR_MASK0, 0x20000); //enable wfb_pg_irq
    SPI_Write_16(ADDR_WFB_CFG, 0x03F0); //set dready to 8khz after pf continuous fill fixed samples no neutral
    SPI_Write_32(ADDR_STATUS0, SPI_Read_32(ADDR_STATUS0));
    While (points_read < samples)
    {
    if ((SPI_Read_16(ADDR_WFB_TRG_STAT) & 0xf000) == 0x7000)
    {get_1st_half_buffer();  // burst read 0x800 to 0xBFF}
    if ((SPI_Read_16(ADDR_WFB_TRG_STAT) & 0xf000) == 0xf000)
    {get_2nd_half_buffer();  // burst read 0xC00 to 0xFFF}
    }
    }
Children
No Data