APB Protocol vs Operating States conflict?

74 Views Asked by At

I'm having difficulty understanding the Operating State of the APB Protocol. In the diagram, the state ACCESS goes back to SETUP state when PREADY = 1 and there is a transfer. Also, it describes that

The bus only remains in the SETUP state for one clock cycle and always moves to the ACCESS state on the next rising edge of the clock.

How do I evaluate the state in clocks 5-9 in the waveform below?

Clk  State
1    IDLE
2    SETUP
3    ACCESS
4    ACCESS 
5    SETUP ? (following PREADY = 1 and transfer)
6    ACCESS ? (SETUP always goes to ACCESS after 1 cycle)
7    IDLE ? (PREADY = 1 and no transfer)
8    ACCESS ? (since PSEL = PENABLE = 1 and PREADY = 0)
9    ACCESS ?
            1   2   3   4   5   6   7   8   9
           _   _   _   _   _   _   _   _   _
clk      _| |_| |_| |_| |_| |_| |_| |_| |_| |_
               _______________     ___________
psel     _____|               |___|
                   ___________         _______
penable  _________|           |_______|
                           ___________     ___
pready   _________________|           |___|

1

There are 1 best solutions below

0
On

Clock cycles 5-7 are incorrect in your table. This is the correct table:

Clk  State
1    IDLE
2    SETUP
3    ACCESS
4    ACCESS 
5    ACCESS
6    IDLE
7    SETUP
8    ACCESS
9    ACCESS

5 is still in the ACCESS state since PSEL and PENABLE are still 1.

6 is in the IDLE state since PSEL and PENABLE are 0. The 1st APB transfer completed in cycle 5.

7 is the start of the 2nd APB transfer, which is the SETUP state.

It is possible to transition from ACCESS to SETUP, but that would require PSEL to remain 1. This would be a back-to-back transfer (with no IDLE between the transfers). Your waveforms do not show that scenario. But, a back-to-back transfer could look like this:

            1   2   3   4   5   6   7   8   9
           _   _   _   _   _   _   _   _   _
clk      _| |_| |_| |_| |_| |_| |_| |_| |_| |_
               __________________________
psel     _____|               
                   ___________     _______
penable  _________|           |___|
                           _______     ___
pready   _________________|       |___|

state       I   S   A   A   A   S   A   A