Part Number: RM46L852
Other Parts Discussed in Thread: LAUNCHXL2-RM46, HALCOGEN
Hi!
If the MibSPI is in slave mode, the ONESHOT bit in the Transfer Group Control Register seems to be ignored and the TG stays enabled all the time.
Is this a known bug? I have not found anything about it in the errata.
I have set up the SPI to work without CS and just like in the reference manual, quote from Table 27-42:
"Note: By setting the TRIGSRC to 0, the TRIGEVT to 7h (ALWAYS), and the ONESHOTx bit to 1, software can trigger this TG. Upon setting the TGENA bit, the TG is immediately triggered.
Note: If ONESHOTx is set, the transfer is performed only once."
I have turned on the MibSPI-Mode in the Multi-buffer Mode Enable Register (MIBSPIE), that can't be the problem.
To demonstrate the problem, I made a simple mockup using the dev-board LAUNCHXL2-RM46 from TI.
You need to add one wire from J2-7 (MIBSPI3_CLK), MCU-Pin 53) to J4-7 (ETPWM1A, MCU-Pin 14).
The principle of the test is that the PWM feeds the SPI-CLK all the time and I use the pullup/pulldown feature to toggle the MOSI pin. Therefore, the transfer should read all 0's or all 1's depending on how you preset the pin - before the transfer is started.
I also explained everything in the sys_main.c
If you break the execution with a debugger after mibspiIsTransferComplete has returned 1 and the transfer is "complete", if you check the TGCTRL you will see that TGENA is still set.
As the PWM also stops when debugging, you can use single-step to advance the transfer. You will see in the TGCTRL that the PCURRENT is going up and even wrapping to 0 without clearing TGENA !!!
In the "real" product I might be able to work around the problem by manually clearing the TGENA quickly after the transfer, before the next transfer will overwrite the TG data.
Maybe there is another setting I didn't think of, that magically prevents the ONESHOT flag from working?
Any help is much appreciated,
Manuel
I attached the complete project, I used HALCoGen 04.07.01 and IAR 8.22.3
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/0777.spi_5F00_test_5F00_2020_2D00_10_2D00_09.7z
