Closed exp0nge closed 6 years ago
This problem is related to an issue with the sensor: if the microcontroller cannot find the sensor, it will print these values by default, i.e. no reply is coming from the sensor.
Could you give me more details about your setup as well as the used board/sensor and board bring up procedure? I will try to help you to get the board running.
Best regards,
Manuel
@mhollfelder Here's a screen shot of the windows software evalkit (which works):
Here's my arduino config:
I guess this should have been in https://github.com/Infineon/TLE493D-W2B6-3DMagnetic-Sensor but I get the same issue... maybe due to not being the exact sensor?
Thank you very much for the screenshot, this already resolved the issue:
The libraries which are currently available for Arduino are only for TLV493D-A1B6 and TLE493D-W2B6 3D magnetic sensor variants.
As shown in the evaluation software, you have the TLE493D-A2B6 which is different from the other two sensors in terms of internal sensor read outs as well as the I2C protocol. Therefore, this library will not work for that sensor which explains why no sensor values are read out.
On which timeline do you need a library? I will try to trigger the development and align internally for the library for that sensor if needed.
Best regards,
Manuel
@mhollfelder I'm entering this - https://www.hackster.io/contests/Infineon3D
Is it possible to flash what the evalkit windows software uses then read out via serial?
It looks like I can flash with what the Windows software uses but since it starts out in power off and I don't know what to write to the registers to start it, I can't get anything using the serial connection.
If you can tell me what I need to write to what address, I can at least progress somewhere depending on how the actual serial output is being displayed for the windows software. Unfortunately that software doesn't look to be open source.
The power off is board specific as the power line VDD of the sensor is connected to a GPIO of the microcontroller to switch the sensor on and off. These kind of sensors can change their I2C address depending on the logic level applied to the pins at startup. Therefore, the ADDR pin and SDA are shared for the sensor (as well as the INT with the SCL). Unfortunately, a manual is currently missing online as far what I saw for the XMC 2Go based evaluation board for the TLE493D-A2B6. Comparing with the TLE493D-W2B6 sensor library implementation here, you should be able to power on the sensor by executing:
//TURN ON THE SENSOR
pinMode(LED2, OUTPUT);
digitalWrite(LED2, HIGH);
User Manuel of the sensor itself TLE493D-A2B6, the datasheet is stored here TLE493D-A2B6.
You would need to adapt the existing libraries to work with the registers and start the sensor in the respective mode/setup. Please note that the sensor does not support repeated starts in the I2C protocol, i.e. you would need to rewrite parts of the implementation to take care of this. Additionally, one would need to check whether the Wire library works with that sensor out of the box.
I will align with my colleagues how to proceed here and come back with a reply.
Best regards,
Manuel
Wow actually https://github.com/Infineon/TLE493D-W2B6-3DMagnetic-Sensor does seem to work, not sure why it didn't before. Thanks for the hints @mhollfelder
Perfect, thanks for the feedback here! I triggered the internal development as well and we will come back with a new library once it has been finished.
Best regards,
Manuel
@mhollfelder hi Manuel,
Is there any news on a timescale for the above mentioned Library for the A2B6?
Best wishes, Adam
Hi Adam,
we already published a repository for the A2B6 variant as well:
https://github.com/Infineon/TLE493D-3DMagnetic-Sensor
There are some issues but my latest knowledge is that the internal development team is working on fixing it. Basic reading of the sensor should work - this was the latest status which I am aware of.
I hope this gives you a first starting point :)
Best regards,
Manuel
I've tried both cartesian and spherical sketches and the same readings are printed regardless of how far or the orientation of the magnet.
Readings:
Amount = 0.17 mT; Azimuth angle (rad) = -2.36 ; Polar angle (rad) = -0.62
X = -0.10 mT; Y = -0.10 mT; Z = -0.10 mT