Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

3D Hall (Magnetic sensor)

User17520
Level 1
First reply posted First question asked
Level 1
I am using STM32F303x microcontroller to established the communication with the TLE493D-W2B6 A0.
I made the reset commands as said in the manual (Start -> 0xFF -> Stop -> Start -> 0xFF -> Stop -> Start -> 0x00 -> Stop -> Start -> 0x00 -> Stop), and tried configuring the registers 0x10, 0x11 and 0x13.

3650.attach

I received acknowledgement from the sensor, thus confirming the correct usage of address. Also, I was able to turn ON/OFF the INT mode of the sensor, by changing the bits in 0x11 (MOD1) register.

3651.attach

Having said that, I was not able to read any register values and even if I read, it is giving me plain 0xFF (255) and nothing else. For example, once I configured the registers, I requested for 20 bytes (0x16 is the last register). I got 0xFF in response (20 times). This included the registers that I configured with different values. Each time I receive with an ACK from the sensor, confirming the communication being established.

3652.attach


I tried a working code (arduino) for the magnetic sensor with an Arduino Micro, and the result was same. The sensor that I used with arduino and STM32 are different but the results are quiet the same. I wasn't even able to read out the value from version register.

I even looked into your official GitHub library - https://github.com/Infineon/TLE493D-3DMagnetic-Sensor - where users commented about similar issue (reading 0xFF).

The configuration values that I used for each register are as follows (STM32)

0x10 - CONFIG - 0x10 (no trigger bits), 0x01 (parity bit set).
0x11 - MOD1 - 0x11 (no trigger bits), 0x85 ( Two Byte Master Mode with Clock stretching enabled and INT disabled and parity bit set).
0x13 - MOD2 - 0x13 ( no trigger bits), 0x40 (update rate of 24Hz).

I would like to add that I have tried other configuration settings -

- With and Without Parity bits (Config and MOD1)
- 2-byte and 1-byte mode
- Low power mode and Master mode
- INT enabled and disabled
- Different update rate

I will be glad to provide more information, if required. Thank you.
0 Likes
5 Replies
dage_4505941
Employee
5 replies posted Welcome! First reply posted
Employee
Hi,

please doublecheck whether the used controller supports "2-byte read".
If not, please be aware of the parity bit "FP" which needs to be set accordingly if you change the communication to "1-byte read".
0 Likes
User17520
Level 1
First reply posted First question asked
Level 1
Hi, thanks for the reply. Right now the 1-byte read seems to be working but there has not been a clear indication regarding the Master mode and Low-power/fast mode.
Right now, I started the sensor with low-power mode, INT enabled (1-byte read). Then, in the INT handler, I had to re-configure it to Master mode (INT disabled). This enabled me to read from the sensor.
After reading the required values, I had to re-configure it back to Low-power mode with INT. This was not specified explicitely in the user manual or in the source code (GitHub). It took me sometime to arrive at this particular sequence, which seems to be working.

Thank you.
0 Likes
User19712
Level 1
Level 1
Syncmaster wrote:
Hi, thanks for the reply. Right now the 1-byte read seems to be working but there has not been a clear indication regarding the Master mode and Low-power/fast mode.
Right now, I started the sensor with low-power mode, INT enabled (1-byte read). Then, in the INT handler, I had to re-configure it to Master mode (INT disabled). This enabled me to read from the sensor.
After reading the required values, I had to re-configure it back to Low-power mode with INT. This was not specified explicitely in the user manual or in the source code (GitHub). It took me sometime to arrive at this particular sequence, which seems to be working.

Thank you.


Can I see a spinet of your code? or would you please let me know which registered did your configure. I'm a student and completely new to this and working my way out to use TLE493D-W2B6 A0 with an Arduino UNO. Any help will be really appreciated.
0 Likes
User270
Level 5
5 solutions authored First solution authored
Level 5
Hi, maybe the source code on github can help https://github.com/Infineon/TLE493D-3DMagnetic-Sensor
0 Likes
User19712
Level 1
Level 1
forix wrote:
Hi, maybe the source code on github can help https://github.com/Infineon/TLE493D-3DMagnetic-Sensor


I tried looking at that but their libraries show too many errors while verifying the code on Arduino. I'm still looking to get the complete configuration frame work to ready a register. The datasheet is also a bit confusing because each bit is kind of connected with a new register to configure.
0 Likes