Using Infineon TLE493D-A2B6 with Teensy 3.2 (or arduino)

Announcements

Measure CO2 When It Matters - Infineon’s XENSIV™ PAS CO2 now comes in SparkFun Red. Check it now!

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

cross mob
User18329
Level 1
Level 1
First question asked
I am using (or attempting to use) a teensy 3.2 using the Arduino IDE to interact with a 3-axis hall effects sensor (the Infineon TLE493D-A2B6). The sensor can only be interacted with via I2C, and it has 2 addresses. The first address (6A Hex) is the write address. 6B Hex is the read address. As an initial test, I am trying to write some configuration data, and then read back some sensor data (initially just 1 register worth of data, essentially the MSB for the x-axis). Here is my Arduino code:

// Define includes

#include // Wire header file for I2C and 2 wire

//

int HallAddressWrite = 0x6A; // Device write address

int HallAddressRead = 0x6B; // Device write address

byte X_Axis_MSB = 0x00; // Bx MSB register

byte Y_Axis_MSB = 0x01; // By MSB register

byte Z_Axis_MSB = 0x02; // Bz MSB register

byte xy_Axis_LSB = 0x04; // Bx, By LSB register

byte z_Axis_LSB = 0x05; // Bz, By LSB register

byte config_Address = 0x10; //config register

byte value=0; //init value

int baudRate = 9600;



The above section is initialisation stuff. Hardcoding register addresses etc.

void setup() {

Serial.begin(baudRate); // Set Serial Port speed

delay(1000);

Wire.begin(); // Join the I2C bus as a master

Wire.beginTransmission(HallAddressWrite); // Address the sensor for writing

Wire.write(config_Address); // Address the Configuration register

Wire.write(0); // write the value to register

Wire.endTransmission(); // Stop transmitting

delay(100);

}




The above section is writing 00000000b register 10H



void loop() {

Wire.beginTransmission(HallAddressRead); // Address the sensor for Reading

Wire.write(X_Axis_MSB); // Write pointer register

Wire.requestFrom(HallAddressRead, 1); // 1 byte from sensor.

value = Wire.read(); // Read byte from register 12

Wire.endTransmission(); // Stop transmitting

Serial.println(value);

delay (500);

}




I find that value always equals 255 (11111111b).



Has anyone got any idea how I should be interacting with this device, or can provide some advice?
0 Likes
1 Solution
User270
Level 5
Level 5
5 solutions authored First solution authored
You may try this: Library for Infineons's 3D magnetic sensor TLE493D for Arduino.
https://github.com/Infineon/TLE493D-3DMagnetic-Sensor

View solution in original post

0 Likes
1 Reply
User270
Level 5
Level 5
5 solutions authored First solution authored
You may try this: Library for Infineons's 3D magnetic sensor TLE493D for Arduino.
https://github.com/Infineon/TLE493D-3DMagnetic-Sensor
0 Likes