Infineon / TLV493D-A1B6-3DMagnetic-Sensor

Library for the TLV493D-A1B6 3D magnetic sensor for Arduino.
MIT License
39 stars 27 forks source link

TLV493D-A1B6 MS2GO incorrect macro names #18

Closed sfeutrier closed 1 year ago

sfeutrier commented 4 years ago

In version 3.2 of the board :

See infineon document : https://www.infineon.com/dgdl/Infineon-Infineon-3DMS2GO_TLv493D-A1B6-UM-v01_02-EN-UM-v01-UserManual-v01_02-EN.pdf?fileId=5546d462525dbac40152ac4ca1d318c2

9Volts9er commented 3 years ago

You are right, for this board the names are not correct. I wanted to see, if the naming is switched also for the XMC2Go-Board, which is clearly the base of design for this 3D2Go-Kit. But there the document is extremly confusing about the LEDs: Link If you have a look in chapter 2, figure 2 the naming of P1.1 as LED2 is absolutely fine. But one page further, chapter 2.3, table 2, they are saying that P1.0 is LED2 and P1.1 is LED1.

Actually, I would not refer to the official documents, but to the Arduino Wiki: Link. Then you just need to know that P1.0 is now connected to the Sensor VDD and that's it.

To control P0.12 (the other LED on the board) you need to add one line in the pins_arduino.h of the XMC2Go in your local copy of XMC-for-Arduino. Like this:

const XMC_PORT_PIN_t mapping_port_pin[] =
{
    /* 0  */    {XMC_GPIO_PORT0 , 6},   // SPI-MISO                         P0.6
       ...                  ...               ...                            ...
       ...                  ...               ...                            ...
       ...                  ...               ...                            ...
    /* 17  */   {XMC_GPIO_PORT2 , 2}    // DEBUG_RX                         P2.2 (INPUT ONLY)
    /* 18  */   {XMC_GPIO_PORT0 , 12}   // LED_3                            P0.12 (just for 3D 2Go Kit)
};

Here is the link to the online version of that file: Link

Then you should be able to control this LED as Arduino pin 18: pinMode(18, OUTPUT); digitalWrite(18, HIGH);