I am creating a general Sabertooth API for faster development with the Arduino boards. I have developed the simple serial mode support and it works great however, I’m having issues getting packets successfully sent to the Sabertooth (ST) (V1.03) reliably. I have gotten it to work but its like 1 out of 10 times - when it works it continues to for that power cycle. The packet serial provides the full functionality of the ST and better resolution on speed so I’m real keen on getting this fixed. Already logged a good number of hours on this.
I believe these problems relate to ST attempting to set the baud based on the first character sent to it which must be 170 (dec). It either sets it incorrectly or not at all. Maybe the issue is:
- The Arduino board toggles the output of the tx pin at startup confusing the Sabertooth
- Hooking motor power on the ST causes the ST to reset - forgetting the baud - sparks are heard when ST is hooked up.
- The Arduino software serial code is off a bit timing wise and the first byte gets garbled.
This causes me to know more detail than what was provided in the documentation.
So here are some questions that the answers might help me track down the problem. I appreciate any insight.
- The status led is lit when 5V OR the motor supply power is hooked up. Do both need to be disconnected to “clear” the determined baud.
- What happens if some byte other than 170 is sent first (or partial bits)? Then a 170 byte is sent - will the ST figure out the baud? Or how sensitive is this baud detection logic anyway?
- Do the status leds give a clue when the baud is successfully received?
- I haven’t looked at the softwareserial code yet to determine if a stop bit is confirmed to being sent. The simple serial, also 8N1, works so I assume the code is set for 8N1. Is the stop bit required to set the baud correctly?
Anyway - any thoughts on the matter would be appreciated. Additionally, if anyone has some thoughts on such a API on the Arduino board let me know.
Thanks in advance,
Galileo
Have you tried other baud rates? I have only connected to mine at 38400. It was just the speed I tried first and it worked fine.
I power my processor from the 5 volt regulator built in. Are you trying to put 5V into it? This is an output line. Input power is ONLY from the main 12 volt battery. I may not have understood from your posting. That might cause problems.
When I turn on main power (12 volt) the green LED on the Sabertooth glows brightly for a second or so. It then dims somewhat but stays on. According to instructions this is because it does not detect R/C input. I’m sending serial packets so this is correct. No other LEDs light.
Here is a link to some playing I did a while back. Maybe it will help you:
kronosrobotics.com/forums/viewtopic.php?t=742
Wow, yea I was trying to power the, what I thought was, the logic voltage in from my Arduino. That was a hell of a newbie mistake that could have cost me my $35 Arduino board - no wonder it rebooted when I hooked it up to the 5V. I remove that and retest everything.
I tried the lowest baud for testing (2400) which is more forgiving timing wise since I’m using a Software bit banger for serial out. Will bump it to 9600 later. The API I doing supports what Sabertooth supports.
Will post update. Nice tank via the link BTW.
Galileo
Everything works at all bauds.
Thanks for the light bulb. I read several times that folks used the Sabertooth for its 5V supply but never realized that meant there was no 5V logic in.
Thanks again,
Galileo
No problem, glad it is working. Post up some pictures when you get it running. BTW, that Sabertooth is practically bullet proof.
I did realize a very specific requirement that through me off and may be of help in the off chance someone might have this same problem. So I’ll simply document it here.
Setting up the serial port pin on the uP after the Sabertooth (in packet mode) has booted and stabilized may cause problems and prevent communication with the controller. This was probably due to software serial code setting the tx serial pin for output and setting it to HIGH while the Saber was waiting for the auto bauding char. This confused my Saber (I delayed 3 secs after startup before configuring the serial port ).
I set the serial port up immediately after reset and it works.