For my latest project I can not use the SoftwareSerial Libary to communicate with ODrive from my Arduino,
beacuse of it blocking interrupts and/or messing up timer1.
So my goal is to communicate over HardwareSerial.
I am using Arduino Nano MEGA 328P and with HardwareSerial & odrive_serial = Serial;, I was able to use the ODrive Arduino Libary like shown in the example sketch.
Writing velocitiy commands to the ODrive worked fine, however when I tried to read the bus voltage with odrive.readFloat(); it always returned 0.00!
Investigating that problem I found out that the TX-line (ODrive side) is always high when connected to the Arduino, when I detached it from the Arduino however, I could read the correct response on my Oscilloscope from the ODrive TX pin!
My assumption is that the USB to Serial chip on the Arduino Nano, or maby the 1k resistors are disturbing the signal. (Edit: Probably not…)
When I tried it with Arduino Pro Mini (No onborad USB to Serial chip) and Arduino Leonardo (seperate Serial) it worked fine!
Is there an easy way to fix this problem? Or can it be avoided by adding resistors to the connection?
Thank you for the suggestion!
I have one of those converters lying around, I am going to try it tomorrow!
I was wondering because everyone was using the UART without any conversion. I read that ODrives inputs can handle 5V and the Arduino should read 3.3V as high? Where is my error in reasoning?
For SoftwareSerial it works too?
Communication with an 3.3V USB to serial adapter, this worked.
Afterwards I tried communication with the ESP8266. Same failure. The RX line of the odrive recieves the signal, but the TX line is 4.2V all the time when connected. If I disconnect it and read the signal with my oscilloscope I can read odrives response!
You don’t need a level shifter to connect to an arduino in general.
It sounds to me like the receive pin on your arduino is not the pin you think it is. I.e. it’s likely plugged into the wrong pin.