Hi there,
In my code I have the following segment of initialization code for MibSPI1 (similar results for MibSPI3 and MibSPI5):
void tagMibSpi1::InitSpi() // initialize SPI device
{
// general MibSPI control registers initialization ------------------------
MIBSPI1GCR0 = 0x00000001; // bring this SPI out of reset state
MIBSPI1MIBSPIE = 0x00000001; // enable multi-buffer mode
MIBSPI1PC0 = 0x00000E17; // set appropriate pins to SPI functions
MIBSPI1DEF = 0x000000FF; // set default chip-selects
MIBSPI1FMT0 = 0x00010510; // set phase, data format 0 and timestamp
MIBSPI1UERRCTRL = 0x0000000A; // enable parity error detection
// transfer group 0 configuration -----------------------------------------
//
// Note: By setting the TRIGSRC to 0 (none), the TRIGEVT to 7h (always), and the
// ONESHOT bit to 1, software can trigger this TG. Upon setting the
// TGENA bit, the TG is immediately triggered. If ONESHOTx is set
// the transfer is performed only once.
MIBSPI1TG0CTRL_bit.ONESHOT = 1; // only once (need to re-enable TGENA bit after transfer)
MIBSPI1TG0CTRL_bit.TRIGEVT = 0x7; // always (for SW trigger, see note above)
MIBSPI1TG0CTRL_bit.TRIGSRC = 0x0; // disable trigger source (SW trigger)
MIBSPI1TG0CTRL_bit.PSTART = MIBSPI1_TG0_EL_START;
...
}
With the above code, I have observed that the MIBSPI1UERRCTRL and MIBSPI1TG0CTRL registers were unmodified as intended after execution of the above code. If I put a breakpoint at the line MIBSPI1GCR0= then continue, nothing changes; but if I put a breakpoint at the line MIBSPI1MIBSPIE= then continue, all is fine.
Then I see the "Auto Initialization of Multibuffer RAM" starting after bringing the SPI out of the reset state ... with the MIBSPIxGCR0=1.
My question is: what is the delay to wait after bringing the SPI out of the reset state? What register should I poll before going ahead to configure the SPI?
Thanks.