Hi Tom
I have now performed the test. The SPI control registers are copied to an array on startup for checking later and the present SPI contents can be read when desired.
Here are the results.
1. Power up.
Input states: 0x007ffc7c
QSPI original registers
0x0104 0x0404 0x0000 0x0000 0x0000 0x0000
QSPI registers now
0xb704 0x0000 0x0110 0x0001 0x0012 0x0000
2. After a RSTI reset
Input states: 0x03c1fff1
QSPI original registers
0x0104 0x0404 0x0000 0x0000 0x0000 0x0000
QSPI registers now
0xb704 0x0000 0x0110 0x0001 0x0012 0x0000
Registers are QMR QDLYR QWR QIR QAR QDR
The result shows that the resister contents are identical - after a reset and after configuration. Input state displays the value received from the shift register chain in each case. Here it is seen (remembering that only 26 bits are read in and so the 6 MSBits are '0' and not used) that the 26 bits of data are the same but in the second case (after RSTI reset) are shifted by 6 bits to the right.
I repeat that the data arriving from the shift register chain is identical in each case (confirmed with logic analyser) and this shows that the shift is in the QSPI input buffer.
The questions are still:
- Why is this happening?
- How can it be avoided / corrected?
Any ideas??
Regards
Mark
www.mjbc.ch
Hi Tom
Thanks - that forced me to get down to detailed work again.
I am not sure that the FAQ is relevant to the ColdFire QSPI because I can not find the SPE bit in question. What I did however do was:
1. Built a long delay after the first transfer to ensure that nothing was taking place before something was ready. This didn't seem to have any effect and resets still caused the shift to occur.
2. I rebuilt everything using SPI interrupts so that I didn't have to poll the SPIF flag on the first read. This again didn't change the characteristics.
3. I then removed the first read to confirm that it was stable in the normal mode (using SPI interrupts and polling shift register inputs via the interrupt every 700us). It was, so I returned my attention to the first read again.
4. I then made a change in the way that the first byte (actually a 16 bit transfer) was read. It was being read with CPHA at '0' and the phase was changed to '1' before the fast polling started. I changed the phase (so that there was no difference) and the problem has gone.
I conclude that it had something to do with the phase change, however I can not explain why it only produced a shift after a RSTI reset (but not every time as I found - it tended to happen more frequently when the RSTI '0' was longer - 1 to 2s).
Therefore it is probably that the problem has been resolved - I avoid the phase change, which is unnecessary anyway.
Since I know that if I miss out the first read (required to read a few configuration bits in the shift register chain immediately after reset) there is never a problem. There is also the possibility of bit banging them over GPIO before converting to QSPI operation. But I have just tested a lot with short and long RSTI resets and haven't seen the issue since the CHPA modification, so it does look to be stable.
Very strange but if it works its best not to touch it again.
Regards
Mark
PS. I have another strange but urgent issue at the following. Maybe you missed it?
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=672
It is for a different project (M52235) which should start in 2 weeks time but we haven't been able to prove that it is possible. PLL issue which is also being very stubborn...
(Alban highlighted link)
Message Edited by Alban on 2006-08-31 05:29 PM