This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MRD2EVM: SPI communication of TMS37157 is not working

Part Number: MRD2EVM
Other Parts Discussed in Thread: TMS37157, MSP430F2274

Hi there,

  Re case numbers, CS0210583 & CS0218724:

I tried both ST and Atmega8 micro controllers in combination with TMS37157 . SPI in neither of them works properly According to the data sheet I was sending the data 2, 0 and 4 and waiting to get manufacture ID from the first page of the TMS.

AS you can see in the attached image, 2 was sent by rising edge of the clock but I got an erroring busy pin, the busy after sending 2 ,several times went up and down and then stayed low. The codes recommended in 2E2, was according to the registers of the MSP,( Texas instruments micro)and it couldn’t help me. Please kindly find the following codes and attached images.

Any suggestion would be greatly appreciated.

while (1) { //HAL_GPIO_WritePin(O1_GPIO_Port, O1_Pin,GPIO_PIN_SET); /*HAL_Delay(500); HAL_GPIO_TogglePin(O1_GPIO_Port,O1_Pin); HAL_Delay(500); HAL_GPIO_TogglePin(O1_GPIO_Port,O1_Pin);*/ HAL_Delay(10000); count_spi=0; HAL_GPIO_WritePin(PUSH_GPIO_Port, PUSH_Pin,GPIO_PIN_SET); //HAL_SPI_Transmit(&hspi1,buffer_tx1,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx1,buffer_rx,1,100); //HAL_GPIO_TogglePin(O1_GPIO_Port,O1_Pin);*/ /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } void EXTI9_5_IRQHandler(void) { /* USER CODE BEGIN EXTI9_5_IRQn 0 */ /* USER CODE END EXTI9_5_IRQn 0 */ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_7); /* USER CODE BEGIN EXTI9_5_IRQn 1 */ count_spi++; HAL_GPIO_WritePin(PUSH_GPIO_Port, PUSH_Pin,GPIO_PIN_RESET); //HAL_GPIO_WritePin(O1_GPIO_Port, O1_Pin,GPIO_PIN_SET); if (count_spi==2) { //HAL_SPI_Transmit(&hspi1,buffer_tx2,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx2,buffer_rx,1,100); } if (count_spi==3) { //HAL_SPI_Transmit(&hspi1,buffer_tx3,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx3,buffer_rx,1,100); } if (count_spi==4) { //HAL_SPI_Transmit(&hspi1,buffer_tx4,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx4,buffer_rx,1,100); } if (count_spi==5) { //HAL_SPI_Transmit(&hspi1,buffer_tx5,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx5,buffer_rx,1,100); } if (count_spi==6) { //HAL_SPI_Transmit(&hspi1,buffer_tx6,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx5,buffer_rx,1,100); } if (count_spi==7) { //HAL_SPI_Transmit(&hspi1,buffer_tx7,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx5,buffer_rx,1,100); } if (count_spi==8) { //HAL_SPI_Transmit(&hspi1,buffer_tx8,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx5,buffer_rx,1,100); } if (count_spi==9) { //HAL_SPI_Transmit(&hspi1,buffer_tx8,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx5,buffer_rx,1,100); } if (count_spi==10) { //HAL_SPI_Transmit(&hspi1,buffer_tx8,1,100); HAL_SPI_TransmitReceive(&hspi1,buffer_tx5,buffer_rx,1,100); } /* USER CODE END EXTI9_5_IRQn 1 */ }