cancel
Showing results for 
Search instead for 
Did you mean: 

Community Information

Michael_K
New Contributor II

Hello everybody,

Hardware: PSoC 4 Pioneer Kit 042

2x TLE493D 3D Hallsensors 


The problem is that after I flash or reset the board, the sensors are sometimes (almost every second reset) not initialized correctly.
After the reset I get a normal communication or only the first sensor is initialized and the second one gets stuck and there are only interrupts on the SDC line.

Although I only have a delay of 150 µs between the initialization of the first and second sensor in my source code, I measure a delay after the reset of the board of 60 ms as shown in the picture.

Michael_K_0-1637853881726.png

The reset() function resets both sensors by sending 0xFF twice and 0x00 twice with a delay of 30 µs to the I2C bus as described in the User Manual.

After that I initialize the sensor one with the address 0x22 and then the Vcc of the second sensor power up and init the second sensor with the address 0x35

 

// ---------------------------------------------------------
    /*********************************************************
    * Configuration and initialization of the TLE493D sensor
    ********************************************************/
    reset();
        // Power Off / Power On the TLE493D
    VDD_sensor_Write(0);
        
    TLE493D_Init(TLE493D_AW2B6_I2C_A1_ADDR);
    VDD_sensor_Write(1);
    CyDelayUs(150); // Small Delay
    TLE493D_Init(TLE493D_AW2B6_I2C_A0_ADDR);
    UART_PutString(" Beginne mit der Kalibrierung  ");
    UART_PutCRLF();
    CyDelay(100);

 

 

Why does this error happen and where does the 60 ms delay come from?

 

 Best Regards

Michael 

0 Likes
9 Replies
BiBi_1928986
Valued Contributor

Hello.

You might want to check this thread having similar issue, but not resolved by Infineon yet.
TLE493DW2B6A1HTSA1 I2C address - Infineon Developer Community

BTW, those I2C address's don't match the Infineon TLE493D datasheet.
Product Name (infineon.com)

Can you provide complete part number.

Have you configured KIT-042 for 3.3V operating voltage?
This sensor is 3.3V only, not 5V.

0 Likes
Michael_K
New Contributor II

Hello Bibi,

the voltage is 3.3 V at the I²C bus and at the VDD pins.

I have two self-made breakout boards with the sensor TLE493DA2B6HTSA1CT from digi-key and two TLE493D-W2B6 3Dsense Shields2Go.

I had a delay of 60 ms in my init procedure and after I removed it, it ran better, but still not 100%.  And I think it also has an influence if two sensors of type W2B6 or A2B6 are connected. I had felt less problems when they are the same.

On Monday I will examine it with an oscilloscope, so that I may see more than with the digital logic analyzer.

I will check the link and keep you up to date.

Best Regards and have a nice weekend

Michael

0 Likes
Michael_K
New Contributor II

Hello Bibi,

 

she sensor is operated with 3.3 V at the VDD pin. The SDA and SCL are also connected to 3.3 V pullup resitor.

I have two self made breakout boards with a TLE493D-A2B6 (TLE493DA2B6HTSA1 by digi key) and two TLE493D-W2B6 3DSense Shields2Go from Infineon(TLE493DW2B6MS2GOTOBO1 from Mouser).


I had added a "startup" delay in the init() procedure and when removing it worked better, but not 100% either. Also, I feel that it works better if they are both the same sensors and not A2B6 with the W2B6.

I will measure it with an oscilloscope to look at the voltage waveforms as well and check the link on Monday.

 

Best Regards and have a nice weekend

Michael

0 Likes
BiBi_1928986
Valued Contributor

Hello.

According to Infineon datasheet at Digikey for TLE493DA2B6HTSA1, the I2C address is 0x6A/0x6B for write/read.  This does not match the 0x22 nor 0x35 addresses previously mentioned.  This is likely the reason the device is not responding.  And the addresses  for W2B6 are also not matching 0x22 nor 0x35.  So, I'm confused how any of this has been working for you.

I also agree with Motoo.  Power-off then delay then power-on then delay, cycle may get the devices in a better state.

MotooTanaka
Esteemed Contributor

Hi,

I'm just curious, but do we need power on the sensor before the initialization?

I wonder if you modify the code something like below, will it make things better?

    reset();
        // Power Off / Power On the TLE493D
    VDD_sensor_Write(0);
    CyDelay(1) ; // 1ms delay 
    VDD_sensor_Write(1);
    CyDelay(100) ; // 100ms wait sensors' HW intialization
 
    // Now initialize PSoC's I2C interface
    TLE493D_Init(TLE493D_AW2B6_I2C_A1_ADDR);
    CyDelayUs(150); // Small Delay
    TLE493D_Init(TLE493D_AW2B6_I2C_A0_ADDR);

 

In case I'm missing the point, I'm sorry.

moto

 

 

Michael_K
New Contributor II

Hello everyone,

sorry for the double post, but I thought I forgot to hit the submit button and didn't realize the post still needed to be activated.

Thank you so much for the response.

@BiBi_1928986  I know, that the sensor with the ending A0 has the address 6A/6B, but the PSoC Creator use the 7-bit address for the SCB  like the wire.h lib for Arduino. So I use the address 0x35 instead of 0x6A and the address 0x22 instead 0x44.

 

@

With the oscilloscope you can see that the signal is noisy, but I think it has nothing to do with that. My guess is that it has something to do with the interrupts. The interrupts come approx. every 1.1 ms.
Also, I need something to keep the program from hanging. I need a status message back.

In the attachment you can find the source code of the i2c part with the sensor. 

 

 

Best Regards

Michael

0 Likes
MotooTanaka
Esteemed Contributor

Hi,

The order of of configuration is important because also in the user manual it is written that the configuration is done sequentially. I can not supply both sensors with voltage, because otherwise they are addressed by the same address at the same time. So you have to configure one first ant then you switch the second sensor on and configure it.

Oh, I see!

But then, is VDD_Sensor_Write() controls only the second sensor or both?

May be you need to have VDD for each sensors. Or I would connect the first sensor to the VDD of PSoC, and provide VDD for the second sensor from a GPIO so that I have control over how long the program can wait till start up the second sensor.

moto

0 Likes
Michael_K
New Contributor II

Hello Moto,

the setup looks like this.

Michael_K_1-1638197861613.png

 

One sensor is always on and one is switch of for the configuration of the first one.

Best Regards

Michael

MotooTanaka
Esteemed Contributor

Dear Michael-san,

Nice diagram!

And that is exactly one of the methods I was thinking of!

Then I noticed that from your description, the sensor requires 5mA,

and I checked the PSoC 4200 Datasheet, there I could only found the absolute maximum current of +/- 25mA.

So it seems that the pins have enough current capacity.

But then when I checked in the PSoC Creator's component configure dialog,

It seems that an output pin seems to provide up to 4mA, which may not be enough for the sensor.

001-output-config.JPG

Although I'm not quite sure if this is a recommended method, 

but how about using one more pin to provide power to the second sensor?

 

And also, still I would think that the delay after  initialize the first sensor and power up the second sensor should be some what longer then us range, I would put 100ms or so.

 

Best Regards,

30-Nov-2021

Motoo Tanaka

0 Likes