1
Discussion - Software / Re: MPSSE commands on falling or rising edge?
« on: February 22, 2019, 12:53:16 pm »
Maybe I tried to explain the problem in rather confusing way. I will try again:
Let assume that memory device work in mode 0 or mode 3. let us decide to use mode 0.
Where CPOL = 0, CPHA = 0, mode 0.
For this mode, input data is latched in on the rising edge of serial clock (C), and
output data is available from the falling edge of C.
So when we let say my program is used to read one word data from a random address:
one write command plus address is used and then on the side mpsse we should use on the
raising edge sampling in to get the data from from spi flash componenet?
That is why the sample in "Interfacing FT2232H Hi-Speed Devices To SPI Bus Application Note AN_114" (page 13) looks very odd:
//send WRITE command O
utputBuffer[dwNumBytesToSend++] = MSB_FALLING_EDGE_CLOCK_BIT_OUT;
OutputBuffer[dwNumBytesToSend++] = 2;
OutputBuffer[dwNumBytesToSend++] = READ;
//send address
OutputBuffer[dwNumBytesToSend++] = MSB_FALLING_EDGE_CLOCK_BIT_OUT;
OutputBuffer[dwNumBytesToSend++] = 7;
OutputBuffer[dwNumBytesToSend++] = (BYTE)(address);
//read data
OutputBuffer[dwNumBytesToSend++] = MSB_FALLING_EDGE_CLOCK_BYTE_IN;
OutputBuffer[dwNumBytesToSend++] = '\x01';
OutputBuffer[dwNumBytesToSend++] = '\x00'
The question is why we are using MSB_FALLING_EDGE_CLOCK_BYTE_IN?
Why FALLING_EDGE instead of RAISING_EDGE?
Let assume that memory device work in mode 0 or mode 3. let us decide to use mode 0.
Where CPOL = 0, CPHA = 0, mode 0.
For this mode, input data is latched in on the rising edge of serial clock (C), and
output data is available from the falling edge of C.
So when we let say my program is used to read one word data from a random address:
one write command plus address is used and then on the side mpsse we should use on the
raising edge sampling in to get the data from from spi flash componenet?
That is why the sample in "Interfacing FT2232H Hi-Speed Devices To SPI Bus Application Note AN_114" (page 13) looks very odd:
//send WRITE command O
utputBuffer[dwNumBytesToSend++] = MSB_FALLING_EDGE_CLOCK_BIT_OUT;
OutputBuffer[dwNumBytesToSend++] = 2;
OutputBuffer[dwNumBytesToSend++] = READ;
//send address
OutputBuffer[dwNumBytesToSend++] = MSB_FALLING_EDGE_CLOCK_BIT_OUT;
OutputBuffer[dwNumBytesToSend++] = 7;
OutputBuffer[dwNumBytesToSend++] = (BYTE)(address);
//read data
OutputBuffer[dwNumBytesToSend++] = MSB_FALLING_EDGE_CLOCK_BYTE_IN;
OutputBuffer[dwNumBytesToSend++] = '\x01';
OutputBuffer[dwNumBytesToSend++] = '\x00'
The question is why we are using MSB_FALLING_EDGE_CLOCK_BYTE_IN?
Why FALLING_EDGE instead of RAISING_EDGE?