Other Parts Discussed in Thread: HALCOGEN
i am a beginner , having some doubt.. my task is to recieve 100 bytes of data through spi and transmit the same through can.
by studying the TRM of TMS570LS3137, i understood at max 2 bytes of data can be recieved through spi function mibspiGetData(). and through can 1 byte of data can be transferred through canTransmit() function.
My questions are:
1. I studied CAN can transmit 0-8 bytes of data, but canTransmit() function is limiting it to 1 byte , why so ?
2. also i am facing problem in accessing 1 byte data (for can transmit ) from 2byte data stored in buffer after spi . Please help me with this
my code:
/* USER CODE BEGIN (0) */
/* USER CODE END */
/* Include Files */
#include "sys_common.h"
#include "mibspi.h"
#include "can.h"
/* USER CODE BEGIN (1) */
int data;
int *pdata;
uint16 rxbuffer[];
uint8 RB[];
uint8 buff;
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
int main(void)
{
/* USER CODE BEGIN (3) */
mibspiInit();
canInit();
int i,j;
for(i=0;i<10;i++)
{
for(j=0;j<5;j++)
{
rxbuffer[]= *(pdata);
pdata++;
mibspiGetData(mibspiREG1,0,rxbuffer);
}
/*stuck over here...*/
/* USER CODE END */
return 0 ;
}