Jan 21, 2020
04:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 21, 2020
04:18 AM
Hi all:
I am facing the old problem of SPI APP(4.3.28) in receiving data from a ADC. The SPI app operate in full duplex mode, I used the SPI APP (SPI_MASTER_Transfer )to transfer data on the SPI bus ,
and can see the data on scope,but in DAVE receive buffer get no data .The receive index also stay zero. I find that this is an old bug of SPI APP
(https://www.infineonforums.com/threads/4257-Possible-Bug-in-SPI_MASTER-app). Have there any way to workaround this bug?
Thanks a lot.
I am facing the old problem of SPI APP(4.3.28) in receiving data from a ADC. The SPI app operate in full duplex mode, I used the SPI APP (SPI_MASTER_Transfer )to transfer data on the SPI bus ,
and can see the data on scope,but in DAVE receive buffer get no data .The receive index also stay zero. I find that this is an old bug of SPI APP
(https://www.infineonforums.com/threads/4257-Possible-Bug-in-SPI_MASTER-app). Have there any way to workaround this bug?
Thanks a lot.
Solved! Go to Solution.
- Tags:
- IFX
1 Solution
Mar 09, 2020
08:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 09, 2020
08:49 PM
Thanks for your answer. I bypassed this issue by read USIC2_CH1 RBUF0 directly, not an elegent way, but it is work.
4 Replies
Jan 30, 2020
03:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 30, 2020
03:28 AM
Hi,
Could you share the configuration of the SPI_MASTER APP?
Could you share the code where you invoke the SPI_MASTER_Transfer and you wait for the transfer to finish?
Regards,
Jesus
Could you share the configuration of the SPI_MASTER APP?
Could you share the code where you invoke the SPI_MASTER_Transfer and you wait for the transfer to finish?
Regards,
Jesus
Attachments are accessible only for community members.
Mar 02, 2020
08:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 02, 2020
08:34 PM
Hi,
TIME CRITICAL PLEASE HELP!
I am seeing the same issue with SPI Master receive on XMC4800. I am using DIRECT Mode for both transmit and receive, no FIFO enabled, word length set to 8.
I see the data on the logic analyzer and all the receive data is there, but my SPI_MASTER_Receive function reads the received data intermittently and at other times reads either 0x00 or 0xFF.
I have followed various other threads on the same topic and patched bits and pieces but of no use. I need for this to work consistently.
I call a routine called Futek_Init(), right after DAVE_Init, to set custom settings on the SPI and the function definition for Futek_Init() is in futek_driver.c
Currently I am using SPI_MASTER_Receive, but I would also like to make it work with SPI_MASTER_Transfer.
I have written a function Futek_Transfer in futek_driver.c which uses SPI_MASTER_Transfer, but I have not tested it since SPI_MASTER_Receive is not working consistently. Please suggest edits to SPI_MASTER_Transfer as well.
main.c
void FutekDRDYIRQHandler(void)
{
DBG_PRINTF("DRDY Falling edge received, current state: %d\n", futek_state);
if (futek_state == 4)
futek_state = 0;
futek_state++;
}
int main(void) {
dave_status = DAVE_Init(); /* Initialization of DAVE APPs */
Futek_Init(); //defined in futek_driver.c
INTERRUPT_Enable(&INTERRUPT_1);
uint8_t send_command = 0x00;
while (1U) {
// ESC main loop
//DIGITAL_IO_SetOutputHigh(&VP_MOSI);
switch (futek_state)
{
case 1:
//DBG_PRINTF("Edge has fallen, sending command\n");
//Send command using SPI Transmit
DBG_PRINTF("sending command: 0x%02X\n", send_command);
Futek_Send_Command(send_command);
send_command++;
if (send_command == 0x0D)
send_command = 0x00;
futek_state++;
break;
case 2:
//DBG_PRINTF("Command sent\n");
//Do nothing
break;
case 3:
//DBG_PRINTF("Edge has fallen reading data\n");
//Read data using SPI Receive
Futek_Read_Response();
futek_state = 0;
break;
default:
//DBG_PRINTF("Data Read\n");
break;
}
}
TIME CRITICAL PLEASE HELP!
I am seeing the same issue with SPI Master receive on XMC4800. I am using DIRECT Mode for both transmit and receive, no FIFO enabled, word length set to 8.
I see the data on the logic analyzer and all the receive data is there, but my SPI_MASTER_Receive function reads the received data intermittently and at other times reads either 0x00 or 0xFF.
I have followed various other threads on the same topic and patched bits and pieces but of no use. I need for this to work consistently.
I call a routine called Futek_Init(), right after DAVE_Init, to set custom settings on the SPI and the function definition for Futek_Init() is in futek_driver.c
Currently I am using SPI_MASTER_Receive, but I would also like to make it work with SPI_MASTER_Transfer.
I have written a function Futek_Transfer in futek_driver.c which uses SPI_MASTER_Transfer, but I have not tested it since SPI_MASTER_Receive is not working consistently. Please suggest edits to SPI_MASTER_Transfer as well.
main.c
void FutekDRDYIRQHandler(void)
{
DBG_PRINTF("DRDY Falling edge received, current state: %d\n", futek_state);
if (futek_state == 4)
futek_state = 0;
futek_state++;
}
int main(void) {
dave_status = DAVE_Init(); /* Initialization of DAVE APPs */
Futek_Init(); //defined in futek_driver.c
INTERRUPT_Enable(&INTERRUPT_1);
uint8_t send_command = 0x00;
while (1U) {
// ESC main loop
//DIGITAL_IO_SetOutputHigh(&VP_MOSI);
switch (futek_state)
{
case 1:
//DBG_PRINTF("Edge has fallen, sending command\n");
//Send command using SPI Transmit
DBG_PRINTF("sending command: 0x%02X\n", send_command);
Futek_Send_Command(send_command);
send_command++;
if (send_command == 0x0D)
send_command = 0x00;
futek_state++;
break;
case 2:
//DBG_PRINTF("Command sent\n");
//Do nothing
break;
case 3:
//DBG_PRINTF("Edge has fallen reading data\n");
//Read data using SPI Receive
Futek_Read_Response();
futek_state = 0;
break;
default:
//DBG_PRINTF("Data Read\n");
break;
}
}
Mar 09, 2020
08:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 09, 2020
08:49 PM
Thanks for your answer. I bypassed this issue by read USIC2_CH1 RBUF0 directly, not an elegent way, but it is work.
Mar 09, 2020
08:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 09, 2020
08:55 PM
Hi,saili_desai;
Do you called the SPI_MASTER_Receive() in your interrupt routine? Thanks & regards.
Do you called the SPI_MASTER_Receive() in your interrupt routine? Thanks & regards.