- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I just solved my problem while gathering the data to get support but the solution creates another question for me, why does what I explain below happen when I use a buffer superior to 4 bytes? I know the SPIM have a 4byte hardware buffer but why it doesn't work when using software buffer? I had the SPIM configured for 28 bytes.
Thank you.
My post:
Hi,
I'm interfacing the PSOC 4 with an ADS1298. I'm trying to get some that out of the ADS1298 so I only have to provide clock to it to receive some of the data.
I do that correctly and it sends data since I can see it in the scope. The problem is that I can't read any data with the SPIM.
This is the loop where I keep receiving data.
SPIM_1_Start();
for(;;)
{
if(DRDY_Read()==0){
for(i=0; i<27;i++){
SPIM_1_WriteByte(0);
while(!(SPIM_1_ReadTxStatus() & SPIM_1_STS_SPI_DONE));
// CyDelayUs(10);
while(!(SPIM_1_ReadRxStatus() & SPIM_1_STS_RX_FIFO_NOT_EMPTY));
if(SPIM_1_GetRxBufferSize()>0)
payload = SPIM_1_ReadRxData();
//UART_UartPutChar(payload );
}
}
}
If tried commeting the first while and the second or adding the delay with no luck. If I don't comment the if(SPIM_1_GetRxBufferSize()>0) it gets stuck there because it is not reading anything but it is receiving data since I can see it with my scope.
The solution was to change the RX buffer size to 4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob