Angle (Magnetic sensor) Forum Discussions
Hi friends,
TLE5012B E5000 is showing "System error" in "Safety Word" after reading the angle value every time.
However, Status Register (that is at 00H) doesn't show any of the errors corresponding to "S_VR; S_DSPU; S_OV; S_XYOL; S_MAGOL; S_FUSE; S_ROM; S_ADCT"
Refer: Infineon-TLE5012B_Exxxx-DataSheet-v02_01-EN.pdf page 29
Thank you for providing insight on why this "System error" is observed in "Safety Word", how to overcome it.
-BJ_JW
Show LessTLE5012B The E1000 reads and writes the MODE3 register, and after I write the angle value in, occasionally the value read out is 0X8091, not the value I wrote in.
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/%E8%A7%92%E5%BA%A6-%E7%A3%81%E6%80%A7%E4%BC%A0%E6%84%9F%E5%99%A8/TLE5012B-E1000%E8%AF%BB%E5%86%99%E5%AF%84%E5%AD%98%E5%99%A8/td-p/740382
Show LessDear Sir,
I would like to define the angle versus SIN (N) Sin(P) Voltage table. (0deg~120deg)
does Infineon have the table for reference, thanks.
Show LessI need the register description and development guide for TLI5012B E1000, thanks!
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/%E8%A7%92%E5%BA%A6-%E7%A3%81%E6%80%A7%E4%BC%A0%E6%84%9F%E5%99%A8/TLI5012B-E1000%E7%9A%84%E5%AF%84%E5%AD%98%E5%99%A8%E8%AF%B4%E6%98%8E%E5%92%8C%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97/td-p/731454
Show LessI used the TLE5012E1000's SSC mode to read out the angle value, there are 7 pairs of poles on the rotating magnet, and the magnet rotates one angle turn to output seven identical cycles, what is the best way to output only one cycle?
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/%E8%A7%92%E5%BA%A6-%E7%A3%81%E6%80%A7%E4%BC%A0%E6%84%9F%E5%99%A8/TLE5012B-E1000%E8%AF%BB%E8%A7%92%E5%BA%A6/td-p/732837
Show LessI have read the angle value using the SSC mode of the TLE5012E1000. I want to read the angle using IIF mode, but there is no output from the IFA, IFB, and IFC pins when the chip is powered up. How can I solve this problem?
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/%E8%A7%92%E5%BA%A6-%E7%A3%81%E6%80%A7%E4%BC%A0%E6%84%9F%E5%99%A8/TLE5012E1000/td-p/475370
Show Less(Reposting in the correct forum)
I'm using the TLE5012B over SPI(SSC) with the STM32H503CB microcontroller. I found the Arduino library here (https://github.com/Infineon/TLE5012-Magnetic-Angle-Sensor/tree/master) and found that by implementing the Platform Abstraction Layer, I could get the same functionality on any microcontroller, so I went ahead and began work on that for the above microcontroller. Primarily, I implemented the SPI sendReceive function, and tested that I could get angles correctly. Since I have the sensor mounted on the back of a motor with a magnet, I verified that rotating the magnet gets me fairly accurate readings to around 0.1 degrees.
Where I'm having issue is the CRC and safety word, but before worrying about the CRC, I noticed that the STAT nibble returned is not all 1s like it should be in the datasheet. The library calls this an INVALID_ANGLE_ERROR, but who knows if that's the issue.
I tried with a more deterministic example than reading an angle, and tried to follow exactly the example given in 5.2.4 on the CRC, where I tried to enable prediction. This involves sending the command "write to mod 2", which is 0x5081, and then the data "enable prediction", which is 0x0804. I expect only the safety word as a response. I got back the following safety word: 0xef13, or 0b1110111100010011. Now notice that the first three bits are 1, but the fourth is 0, hence the INVALID_ANGLE_ERROR response. You may also notice that the CRC is wrong ( it is supposed to be 0x89, not 0x13).
This has me stumped, since by all metrics the angle readings are coming back very accurately. I have evidence that I can write to the chip since I have been able to set the filter settings in MOD1 and noticed a significant decrease in the spread (min-max values when not moving the magnet).
I attached my entire stm32 project for completeness, but I'll try to put what I believe to be the most relevant information here.
Below is my "sendReceive" function, which is the core function used by the library to talk over SSC with the sensor.
// This function is used by the library (and me) to talk to the TLE5012B over SSC. It sends sent_data and waits for the sensor 130ns and then receives a response of a given length.
SPIC::Error_t SPIC::sendReceive(uint16_t* sent_data, uint16_t size_of_sent_data, uint16_t* received_data, uint16_t size_of_received_data){
uint8_t conv_sent_data[2*size_of_sent_data];
uint8_t conv_received_data[2*size_of_received_data];
for (int i = 0; i < size_of_sent_data; i++) {
conv_sent_data[i * 2] = (uint8_t)sent_data[i] & 0xFF; // Low byte
conv_sent_data[i * 2 + 1] = ((uint8_t) (sent_data[i] >> 8)) & 0xFF; // High byte
}
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET);
HAL_SPI_Transmit(this->spi, conv_sent_data, size_of_sent_data, 100);
// Wait the required t_wr period
for (int i = 0; i < 32; i++){
asm("NOP");
}
HAL_SPI_Receive(this->spi, conv_received_data, size_of_received_data, 100);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET);
for (int i = 0; i < size_of_received_data; i++) {
received_data[i] = (conv_received_data[i * 2 + 1] << | conv_received_data[i * 2];
}
return OK;
}
Here I am trying to replicate the safety word response from the datasheet:
// This is copied from the user manual, 5.2.4
uint16_t write_to_mod2 = 0x5081; // Write to the mod2 register
uint16_t enable_prediction = 0x0804;
uint16_t set_prediction_data[2] = {write_to_mod2, enable_prediction};
uint16_t get_prediction_safety;
spic.sendReceive(set_prediction_data, 2, &get_prediction_safety, 1);
// The result, placed in get_prediction_safety, here has the wrong status and CRC values.
// Result here: 0xEF13
// Expected result: 0xFE89
Here is my SPI initialization function. I thought that this was all good since I could read angles from the sensor, but maybe I configured something wrong here?
/**
* @brief SPI2 Initialization Function
* @param None
* @retval None
*/
static void MX_SPI2_Init(void)
{
/* USER CODE BEGIN SPI2_Init 0 */
/* USER CODE END SPI2_Init 0 */
/* USER CODE BEGIN SPI2_Init 1 */
/* USER CODE END SPI2_Init 1 */
/* SPI2 parameter configuration*/
hspi2.Instance = SPI2;
hspi2.Init.Mode = SPI_MODE_MASTER;
hspi2.Init.Direction = SPI_DIRECTION_1LINE;
hspi2.Init.DataSize = SPI_DATASIZE_16BIT;
hspi2.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi2.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi2.Init.NSS = SPI_NSS_SOFT;
hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_32;
hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi2.Init.TIMode = SPI_TIMODE_DISABLE;
hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi2.Init.CRCPolynomial = 0x7;
hspi2.Init.NSSPMode = SPI_NSS_PULSE_DISABLE;
hspi2.Init.NSSPolarity = SPI_NSS_POLARITY_LOW;
hspi2.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA;
hspi2.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_00CYCLE;
hspi2.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_00CYCLE;
hspi2.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_DISABLE;
hspi2.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_DISABLE;
hspi2.Init.IOSwap = SPI_IO_SWAP_DISABLE;
hspi2.Init.ReadyMasterManagement = SPI_RDY_MASTER_MANAGEMENT_INTERNALLY;
hspi2.Init.ReadyPolarity = SPI_RDY_POLARITY_HIGH;
if (HAL_SPI_Init(&hspi2) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN SPI2_Init 2 */
/* USER CODE END SPI2_Init 2 */
}
Below are the relevant schematic snippets, basically just showing how the sensor is connected to the microcontroller. Hopefully nothing exciting there.
In case anyone is curious, I tried scaling down the BAUD rate to 976.562kbps (originally it was around 7.8Mbps), with no change. I thought anything under 8Mbps should work, but the datasheet wasn't super clear (it just said 8Mbps typical, with no min or max values).
That's all of the relevant bits I think.
Max
Show Less
Hello, Infineon Team :Currently we are using a program that communicates with the TLE5012BE1000 via the four SPI1 lines on the TC233 and the three SSC lines on the TLE5012BE1000, hoping to read the angle and fault information at an interrupt frequency of 20K. Currently the SPI communication of the TC233 is an interrupt, the spi interrupt communication baud rate is 4M, and the program is a multitasking program, but due to adding a read wait statement to the spi communication function, currently only one register in the adc interrupt can communicate with the TLE5012. However, due to the read wait statement added in the spi communication function, only one register of TLE5012 can be communicated with in the adc interrupt, and adding the statement of communicating with another register in the collaborative task will cause the whole program to be stuck. Currently my requirement is to read the angle value in the 20K adc interrupt, while still communicating with other registers of the TLE5012 in other tasks. Any help on this would be greatly appreciated.
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/%E8%A7%92%E5%BA%A6-%E7%A3%81%E6%80%A7%E4%BC%A0%E6%84%9F%E5%99%A8/SPI-communication-error-between-TLE5012-and-TC233/td-p/699902
Show LessHello, Infineon team: We are currently using the TLE5012BE1000 for our application. Currently, the solution we are using is to communicate with the three SSC wires on the TLE5012BE1000 through the TLE5012BE1000. TC233 sends a command to the TLE5012BE1000 to capture the data on the bus through the oscilloscope, and found that there is response data, but in the return parameters of the iFXQSPI_spimaster_exchange () function, there is no data. The problem is currently I haven't found a good solution, can you help solve it; in addition, the TLE5012BE1000 captured by the oscilloscope sends the SPI data on the TC233 chip and the TC233's SPI configuration.
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/%E8%A7%92%E5%BA%A6-%E7%A3%81%E6%80%A7%E4%BC%A0%E6%84%9F%E5%99%A8/SPI-communication-error-between-TLE5012-and-TC233/td-p/663394
Show Less