This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SN74V263: SN74V263 Write/Read Issue: FF Flag and Read Cycle Timing

Part Number: SN74V263

Tool/software:

Hi,

I'm working on a project using the SN74V263 FIFO in standard mode with a 9-bit input and output bus width. I'm facing an issue with my write and read operation and the status flags.

My system uses an external 50 MHz oscillator to drive the WCLK pin, which writes data into the FIFO. My microcontroller (MCU) is a PIC running at 120 MHz (1 machine cycle = 60MHz).


The Problem:

1. During Write:
I have configured a change notification interrupts for HF and FF flags. I am setting WREN = 1 when HF = 0 but FF flag is also changing to LOW indicating that write didn't stop.

I am using the following code structure for my write operation:

void enable_fifo_write(void)
{
    // Disable reading from FIFO
    FIFO_REN = 1;

    // Enable writing into FIFO
    FIFO_WREN = 0;

    // Perform Partial Reset
    FIFO_PRS = 0;
    fifo_usec_delay(1);
    FIFO_PRS = 1;

    // Clear interrupt flag

    // Enable change notification interrupt for FF, EF and HF flags

    // Enable CN interrupt globally

    // After the first write is performed,
    // EF goes high after two low-to-high transitions on RCLK
    FIFO_RCLK = 1;
    FIFO_RCLK = 0;

    FIFO_RCLK = 1;
    FIFO_RCLK = 0;
}

2. During Read:
I am trying to perform a read operation when the FIFO is full (FF = 0), but the flag status isn't changing especially the FF flag.

As per my understanding when FIFO is FULL (FF = 0), a single read operation will cause FF to change from LOW to HIGH after 2 RCLK transitions.

I even tried reading the FIFO up to the max FIFO size but didn't observe any change in the flags (FF, HF and EF).

I am using the following code structure for my read operation:

void read_data_from_fifo(void)
{
    uint16_t readcount = 8200;

    while(readcount-- > 0)
    {
        fifo_read_init();
        raw_data = fifo_read_start();
    }
}

void fifo_read_init(void)
{
    FIFO_REN = 0;
    __asm__ volatile("nop");
    
    FIFO_OE = 1;
    __asm__ volatile("nop");
    
    FIFO_RCLK = 0;
    __asm__ volatile("nop");
    
    // REN should be LOW when the RCLK goes from LOW->HIGH.
    FIFO_RCLK = 1;
    __asm__ volatile("nop");
}

void fifo_read_start(void)
{
    uint16_t read_data;
    
    // When RCLK is HIGH, OE should go from HIGH-> LOW before reading from the port.
    FIFO_OE = 0;
    
    // REN should go high while RCLK is HIGH
    FIFO_REN = 1;
    
    __asm__ volatile("nop");
    
    FIFO_RCLK = 0;
    __asm__ volatile("nop");
    
    // By this time tOLZ time has elapsed and data on Q0-Qn are valid.
    // Read 9-bit data from the FIFO's output port
    read_data = PORTD & 0x01FF;
    
    return read_data;
}


My Analysis

  1. I have correctly configured the device for standard mode during the master reset.
  2. I'm concerned that my MCU, despite running at 120 MHz (1 machine cycle = 60MHz), is too slow to keep up with the 50 MHz write clock, and the FIFO is becoming full before my software can react.
  3. I believe my read function may not be adhering to the timing requirements of the SN74V263.

Can you please advise on the correct sequence of signals for a single-word or continuous read in standard mode, paying close attention to the timing requirements for REN, OE, and RCLK?

Thank you for your assistance.

Regards,

Tanuj Kumar

  • Hi Tanuj,

    Let me discuss this with our team and see if we can figure out a solution.

  • Hello Albert,

    Just following up on this issue. Could you please provide an update or let me know if any further details are needed from my side?

    Regards,

    Tanuj Kumar

  • Hi Tanuj,

    Apologies for the delay. This seems to have gotten lost in the E2E inbox. 

    Below is the timing diagram for the usage of this device. Is there any built in delay on your signal changes or are they happening as fast as possible back to back?

  • Hello Albert,

    It's fine but making this FIFO our is very critical to our project.

    I was referring to both Figure 8 and 10. But that didn't solve read issue.

    I want to read data from FIFO in Standard mode (FWFT/SI = 0), I am able to write data into FIFO and corresponding flags are updating as per the HW specifications.

    Below is the captured snippet for 5 read cycle:

    I believe, when FIFO is full (FF = 0), one successful read can cause FF to go HIGH but this is not happening.

    This waveform seems similar to the the one that you suggested.

    is there anything that i am doing wrong ?

    Regards,

    Tanuj Kumar

  • Hi Tanuj,

    What are you setup and hold times? Specifically between write and read enable. I was not able to determine from your code.

    The issue sounds most like a timing violation, as in the signal is not being set before you perform another action. 

  • Hello Albert,

    We are using the SN74V263 in standard mode on a board where an external, free-running 50 MHz clock continuously drives WCLK from power-on. The host MCU has no means to gate or disable this clock.

    During write operations: The FIFO full (FFn), half-full (HFn), and empty (EFn) flags all change as expected, confirming:

    1. Proper alignment and timing of WEN and WCLK signals from the MCU, even without explicit clock control.
    2. We are reliably meeting the datasheet setup and hold requirements for data (tDS, tDH).

    Note: We have not directly tapped wires across the WCLK or data lines for physical signal capture.

    I have attached waveforms from our analyzer illustrating the FIFO Write & Read Cycles, FIFO Write Cycle, tENS (Enable Setup Time), and tENH (Enable Hold Time).

    Fig: FIFO Write & Read Cycle

    Fig: FIFO Write Cycle

    Fig: tENH (Enable Hold Time)

     

    tENS (Enable Setup Time)

    Initialization Code:

    static inline void initialise_fifo_std_mode(void)
    {
        FIFO_REN  = 1;
        FIFO_OE   = 1;
        FIFO_RCLK = 0;
        FIFO_WREN = 1;
        FIFO_SEN  = 1;
        FIFO_FWFT = 0;  // Standard mode
        FIFO_RS = 0;
        clock_delay(1);
        FIFO_RS = 1;
    }
    

    Write Example:

    static inline void enable_fifo_write_std_mode(void)
    {
        FIFO_PRS = 0;
        fifo_usec_delay(1);   
        FIFO_PRS = 1; 
        FIFO_REN = 1;
        RED_LED  = 0;
        FIFO_WEN = 0;
        FIFO_RCLK = 1; __asm__ volatile("nop");
        FIFO_RCLK = 0; __asm__ volatile("nop");
        FIFO_RCLK = 1; __asm__ volatile("nop");
        FIFO_RCLK = 0;
    }
    

    Read Example:

    static inline void enable_fifo_read_std_mode(void)
    {
        uint16_t read_data;    
        unsigned int count;
        
        FIFO_WEN  = 1;
        FIFO_OE   = 0;
        FIFO_REN  = 0;
        FIFO_RCLK = 0;
        __asm__ volatile("nop");
        __asm__ volatile("nop");
        for(count = 0; count < 5; count++)
        {
            FIFO_RCLK = 1;   
            __asm__ volatile("nop");
            FIFO_RCLK = 0;
            __asm__ volatile("nop");
            read_data = PORTD & 0x01FF;
            __asm__ volatile("nop");
        }
        FIFO_OE  = 1;
        FIFO_REN = 1;
        RED_LED  = 0;
        while(1) { RED_LED = ~RED_LED; fifo_msec_delay(100); }
    }

    Despite successful write operations (verified by flag transitions), we face issues during read: the FIFO does not update the FFn flag or correctly advance the read pointer during burst read cycles. We have verified timing with NOP-based delays between signal transitions, each ~40 ns, which should meet or exceed the datasheet’s requirements (tENS, tENH, etc.).

    Could you please review our approach and code, and advise what else could prevent the FIFO from updating its status during reads given this always-running WCLK scenario?

    Regards,

    Tanuj Kumar

  • Hi Tanuj,

    It's a bit difficult to see the full picture without the WRCLK and data. 

    My current understanding is that writing works and sets the correct flags, however, reading does not set the correct flag (FF) to low. 

    You mention that the WRCLK is continuously toggling. Is it possible that you are writing too fast which is overwriting the reads, i.e. RCLK is too slow for the WRCLK. 

  • Hello Albert, 

    The WEN pin is set to HIGH when a READ is performed. So even though RCLK is slow compared to WCLK the write operation can't take place.
    Additionally, when the fifo is FULL, the FFn flag goes LOW, inhibiting further write operation. If the read operation were successfully performed, we would expect to see FFn flag transitioning to HIGH in the trace, as a single successful read should make the fIFO no longer full. However, this change is not observed.

    Are there any specific timing requirements between OE, REN, and RCLK that could result in a read cycle not being triggered, even if REN and RCLK otherwise appear correct? In our application, OE is set LOW before and remains LOW throughout each read operation. Is this the recommended procedure, or are there possible subtleties with OE timing or operation that could impact read behavior or internal flag status?

    I understand that diagnosing the issue solely from the waveform can be challenging, but could you please review our steps and confirm whether our procedure for triggering read operation is correct ?

    Regards,

    Tanuj Kumar

  • Hi Tanuj,

    I honestly do not see a glaring problem in the implementation. The OE signal is being set correctly as far as I understand. 

    Just as a quick test, is the correct data actually being read (disregarding the FF signal)?

    To further help with this, is there any way to actually probe WCLK and the data input? 

  • Hello Albert,

    Thank you for confirming the implementation.

    The problem was related to the RT (Retransmit Mode) pin, i wasn't driving it.

    The default pin status, that connects RT line, was LOW (0) which was actually enabling the retransmit mode.

    Once I disabled it, FIFO Read started working as expected.

    I am sharing the updated initialization code for reference, i hope this might be helpful for others as well.

    static inline void initialise_fifo_std_mode(void)
    {
        // Set initial state for control signals
        FIFO_REN  = 1;
        FIFO_OE   = 1;
        FIFO_RCLK = 0;
        FIFO_RT   = 1;  //Disable retransmitting of data
        FIFO_WREN = 1;
        FIFO_SEN   = 1;
        FIFO_FWFT   = 0;    // Standard mode
        
        // Reset FIFO
        FIFO_RS = 0;
        __asm__ volatile ("nop");
        FIFO_RS = 1;
    }



    Regards,

    Tanuj Kumar