You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code is not working since USI5 workaround sends 7 bits instead of 8 after spi_initialize() which makes bResetAdjust = USI5_ADJUST.
It is not clear for me when USI5 error appears. Does it appear only one time after MSU reset? Then spi_initialize() should not touch bResetAdjust if it was already used.
Also using such variable impacts on performance. Every call of spi_send() checks if needed to workaround this error.
I suggest another way.
When this error should appear we turn off MOSI and CLK, then writing 1 to USICNT, wait for transmit to complete and read incoming "byte". Then we turn on MOSI and CLK.
In such case our spi_send() looks shorter:
USICNT = 8;
while (!(USICTL1 & USIIFG)) {
; // wait for an USICNT to decrement to 0
}
return USISRL; // reading clears RXIFG flag
instead of
// SPI master generates one additional clock after module reset if USICKPH is set.
if ( bResetAdjust == USI5_ADJUST ) {
USICNT=7; // adjust first time send
bResetAdjust = USI5_SENT;
}
else {
USICNT = 8;
}
while (!(USICTL1 & USIIFG)) {
; // wait for an USICNT to decrement to 0
}
return USISRL; // reading clears RXIFG flag
So if someone can check what is needed to get USI5 the code can be improved.
The text was updated successfully, but these errors were encountered:
eurol
added a commit
to eurol/msp430-lg-core
that referenced
this issue
Sep 27, 2019
Issue energia#117
Also 16-bit SPI data exchange is changed
spi_tx() call changed to spi_transmit() - it did not compiled at all
Need to check at different modes of SPI.
We have some issue.
This code is not working since USI5 workaround sends 7 bits instead of 8 after spi_initialize() which makes bResetAdjust = USI5_ADJUST.
It is not clear for me when USI5 error appears. Does it appear only one time after MSU reset? Then spi_initialize() should not touch bResetAdjust if it was already used.
Also using such variable impacts on performance. Every call of spi_send() checks if needed to workaround this error.
I suggest another way.
When this error should appear we turn off MOSI and CLK, then writing 1 to USICNT, wait for transmit to complete and read incoming "byte". Then we turn on MOSI and CLK.
In such case our spi_send() looks shorter:
instead of
So if someone can check what is needed to get USI5 the code can be improved.
The text was updated successfully, but these errors were encountered: