Other Parts Discussed in Thread: TMS570LS0432, HALCOGEN
主题中讨论的其他器件:TMS570LS0432、 TPIC7218、 HALCOGEN
我们希望通过 TPIC7218 -Q1与 TMS570LS0432进行通信(SPI)、因此发送读取命令和写入命令 I 难以通信、因此 也发送器件 ID 和制造 ID。
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.
Other Parts Discussed in Thread: TMS570LS0432, HALCOGEN
我们希望通过 TPIC7218 -Q1与 TMS570LS0432进行通信(SPI)、因此发送读取命令和写入命令 I 难以通信、因此 也发送器件 ID 和制造 ID。
您好,Norikazu!
这是我团队成员讨论的延续、我们将使用 TM570LS0432控制器设置 TPIC7218的 SPI 接口。
附加的引脚供您参考、

我们尝试通过在 V_Relay 附近添加分压器电路来检查电压、方法是通过启用地址0x11的 GE_MR 位来启用 GMR 引脚。 我认为我们无法写入(传输)数据或命令、下面是我们正在处理的代码片段。 您能在这方面提供帮助吗? 读取操作正常工作、因为我们会从特定地址获取一些数据。 如果需要、我可以与您共享 HALCoGEN 配置。
/* USER CODE BEGIN (0) */
/*-----------TPIC7218 MIBSPI CODE---------*/
#include"system.h"
#include<stdio.h>
#include"gio.h"
#include"mibspi.h"
#include"spi.h"
#include"mibspi_TxRx.h"
#include"Delay.h"
/* USER CODE END */
/* Include Files */
#include "sys_common.h"
/* USER CODE BEGIN (1) */
void Write_Enable(uint8_t add,uint8_t value);
uint8_t read_ID(uint8_t value);
/* 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) */
uint8_t DATA[1]={0};
mibspiDAT1_t dataconfig1_t;
/* USER CODE END */
int main(void)
{
/* USER CODE BEGIN (3) */
gioInit();
mibspiInit();
Write_Enable(0x11, 0x1F); //This is to enable the GMR Pin by setting up GE_MR bit of 0x11 address
Delay_second(100); // This delay is of 100 ms
printf("GMR=%X\n", read_ID(0x11));
while(1)
{
printf("Status of F_GMR =%X \t", read_ID(0x06));
printf("Status of V_REF bit = %X \n", read_ID(0x1D));
Delay_second(1000);
}
}
/* USER CODE BEGIN (4) */
void Write_Enable(uint8_t add,uint8_t value)
{
uint8_t data[2];
data[0]=add;
data[1]=value;
dataconfig1_t.CS_HOLD = TRUE;
dataconfig1_t.WDEL = FALSE;
dataconfig1_t.DFSEL = DATA_FORMAT1;
dataconfig1_t.CSNR = 0xFE;
mibspiTransmitData(mibspiREG1, &dataconfig1_t, 2,data);
}
uint8_t read_ID(uint8_t value)
{
uint8_t add =(0x80)|value;
dataconfig1_t.CS_HOLD = TRUE;
dataconfig1_t.WDEL = FALSE;
dataconfig1_t.DFSEL = DATA_FORMAT1;
dataconfig1_t.CSNR = 0xFE;
mibspiTransmitData(mibspiREG1, &dataconfig1_t, 2,&add);
mibspiReceiveData(mibspiREG1, &dataconfig1_t,1, &add,DATA);
return DATA[0];
}
/* USER CODE END */
跳跃解决方案、
此致、
Agnideep。