-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble connecting to Arduino Nano & ESP32 #26
Comments
Hi @jyl087, I did the following steps and tried to reproduce your issue:
I could unfortunately not reproduce your error. For me it runs without interruption. I am using TLE5012B E1000 Kit 2Go, so maybe the issue is related to the Nano clone. Can you test with another controller? |
Hello, question, so you are using the bare chip with an Arduino Nano or a brake out board or is this a different setup? Or is it a XMC2Go kit where you simply wire the pins to an Arduino Nano? |
Hello all. I appreciate your quick replies! As noted in the original ticket, the breakout board is this: The Nano clone is this: When you said you tried to reproduce, it looks like you weren't using a Nano but an Infineon eval board, right? So it could be a problem with Nano, clone or not, right? I.e. a "genuine Nano" wouldn't make things better? |
Hi @jyl087,
@OlafFilies will get back to you regarding ESP32.
Correct, I tested with an Arduino-compatible Infineon eval board.
hmm, depends:
|
Hello, you can try this very new port of the TLx5012B repo which includes many bug fixes and an EPS32 port. As this is still code in progress and review it may not work but you can give it a try. |
@OlafFilies - THANK YOU! It seems to work. No more issues with the console interacting with the SPI interface. |
@OlafFilies , Since you mentioned the ESP32, I decided to give it a try. I have this ESP-WROOM-32 dev board: https://www.amazon.com/gp/product/B0CGQV7P9K/ And that is how I wired up the TLE5012B. Further, I took power and ground from the Vin / Gnd on the ESP32 board. I verified that there was 4.7V on the Vin pin. However, I'm getting a checkError: 1 during startup. Please let me know if there's anything you'd like me to try to get this library working with the ESP32. Thanks! Also, please let me know you want me to re-file this as a new ISSUE since it no longer matches the title of the old issue (or I suppose I could change the title of this issue). |
Hello, for a quick answer, as the TLx5012Bs all use 3wire, you have to connect MISO/MOSI together and as far as I remember you need a resistor between them which is bigger than the usual 470 Ohm. I think it was 1 MOhm . |
@OlafFilies thanks for the additional info. Just to be clear, the 1M resistor goes between the TLE5012 and the MISO/MOSI pins which are shorted together right? |
Right :-) |
Hello @OlafFilies I tried a quick test with the 1MΩ resistor on the data line and unfortunately it still says checkError = 1 during setup. I verified that the TLE is getting 4.7V (not quite 5) but I think that should be ok. At least for now, the Nano seems to be working reliably, so I'll stick with that. I'm happy to test the ESP32 if you have any new software to try in the future. |
Hello, thanks I appreciate that you test this. May have a look into the manual of the TLE5012. There you can find under 3.7 and 3.8 two pictures how the sensor can be connected, it is the SSC push-pull or SSC open-drain configuration and as far as I remember the ESP only works with the open-drain config. That means two 100 Ohm resistors between DATA and MISO/MOSI and a 1kOhm resistor to GND. I think you can leave the 100 Ohm resistors out and only use the 1kOhm (maybe it was only 1kOhm not 1MOhm). Anyway it was a little more tricky than for other MCUs which work in the push-pull configuration. If this is not working, I have to test how that and of course I have to rewrite the documentation for that which will be done in the next weeks. |
hello @OlafFilies , unfortunately, the breakout board I'm using for the sensor already has a 470 Ω soldered in place and I don't want to modify it. I did, however, try to hook it up in the open drain mode using a 4.7k pullup and a 470Ω on the MISO/MOSI pins as well just to see if that would work. I was thinking to try to maintain the 1:10 pulldown ratio. I downloaded the sample angle reading code, but unfortunately it still gives a checkError 1. Was I supposed to modify the code in some way or does the library take care of initializing the ESP32 correctly? By the way, I couldn't find it in the documentation, but is there a recommended airgap between the sensor and the magnet? The kit I bought doesn't really specify anything about the strength of the magnet, but it is 6mm in diameter. |
Hello, yes there is a recommended gap, but the sensor is very insensitive against that, and also quiet robust, Switching cables during runtime does not really matter, also inserting or removing resistors are normally not a problem. You try the PCB you mentioned here https://www.amazon.com/dp/B0C4ZR57G9/ ? |
Hello @OlafFilies, I've started getting [1] error code during boot, which according to the documentation is a SYSTEM_ERROR. I've checked the voltage to the sensor: 5.03V. Could the sensor have somehow gone bad? Is there anything else I can check? Note, this is after the chip was working with no other changes. And, I'm connecting through the Arduino Nano, which was working. |
Hello, you run the Sensor with 5V !? it should run only with 3.3V. It can withstand 5V, but it gets hot and yes you can destroy it. Give the Sensor one hour and than restart with 3.3V. |
Thanks for the reply! I wasn't aware about the 3.3V. It does seem to run around 33C. I will see about changing the supply voltage. |
I just checked the datasheet, and in Table 4, it says that the Supply Voltage should be between 3 and 5.5 with typ = 5.0. Is this information incorrect? Unfortunately I don't have an unused source of 3.3V handy, so I would prefer to keep it at 5V if possible. |
Hello, running the sensor on 3.3V is better for the life time and temperature drift. These sensor are rather stable you hotplug them, remove the magnet, using to strong magnets, use the onchip ADCs for other date and many more fancy this, but all of that will affect the sensitivity and life time, so better avoid that. Therefor if you can run with 3.3V than prefer that instead of using 5V, also it will run on 5V. |
Ok, good to know! I guess I'll have to check that the Arduino can communicate using 3.3V signals without further modification. |
Describe the bug
I'm trying to interface the TLE5012B E1000 to an Arduino Nano and am having a hard time making it work reliably. The sensor is wired to the Nano D11,D12 (data), D13 (sck), and D10(ss). I am able to compile and run the sample "readAngleTest.ino" program and it seems to work reliably.
However, I am trying to change the code so that every 50mS I want the Arduino to just print the angle and the temperature: nothing else. But when I reduce the amount of output that gets printed, it seems like the program freezes and the data that I get is all zeros.
Here is the code from the readAngleTest.ino sketch:
Serial.print("Temperature:"); Serial.print(t); Serial.print("°C\tangle:"); Serial.print(d); Serial.print("°\trange:"); Serial.print(r); Serial.print("\tspeed:"); Serial.print(s); Serial.print("\t Revolution:");Serial.println(b);
If you get rid of all the English words and just print the numbers with commas as separators, the program stops working! There seems to be some interaction between the USB Serial line and the SPI interface. Or maybe some other explanation for why this is happening?
And even more strange, if I simply print more garbage characters, like this:
Serial.print("The quick brown fox jumps over the lazy dog");
It starts working again! It's really the strangest thing that the amount of characters printed to the console is affecting the TLE chip.
One more thing is that sometimes if I unplug the whole board and reboot it, it will start working again. Is there some way to reset the TLE5012 from the Arduino?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The requested data to be printed to the USB console
Screenshots
If applicable, add screenshots to help explain your problem.
Software (please complete the following information):
Hardware (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: