Jul 21, 2019
11:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 21, 2019
11:19 PM
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.
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.
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.
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.
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.
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.
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.
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.
5 Replies
Jul 22, 2019
05:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 22, 2019
05:48 AM
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".
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".
Jul 22, 2019
06:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 22, 2019
06:07 AM
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.
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.
Jun 11, 2020
11:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2020
11:54 AM
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.
Jun 12, 2020
12:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 12, 2020
12:28 AM
Jun 13, 2020
07:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 13, 2020
07:54 AM
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.