infineon4engi@twitter twitter

infineon4engineers Facebook

infineon@linkedin linkedin

infineon@youtube youtube


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    New Member New Member Adam Metcalf is on a distinguished road
    Join Date
    Oct 2019
    Posts
    1
    Points
    30

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

    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.h> // 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?

  2. #2
    Intermediate Intermediate forix is on a distinguished road
    Join Date
    Feb 2012
    Location
    Munich
    Posts
    68
    Points
    338.125
    You may try this: Library for Infineons's 3D magnetic sensor TLE493D for Arduino.
    https://github.com/Infineon/TLE493D-3DMagnetic-Sensor

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.