I rigged up an Arduino Nano to act as a crude oscilloscope sampling at 24KHz and I got the following trace (zipped excel file included):
smartaudio_debug.zip (146.7 KB)
The first thing I note is that the “high” signal coming from the VTX is only about 1.5V. This is below the standard 2V cutoff for 3.3V logic, but is within the 0.9-3.3V range specified by the SmartAudio spec. Is it possible that my flight controller is simply not recognizing this as a valid signal because the levels are too low? Should I set the “RX pull-up” bit in the serial options?
The shortest high and low intervals are about 0.0208 msec which is what you’d expect from a 4800 baud signal. This signal corresponds to the request_setting() routine so it should consist of 0xAA 0x55 0x03 0x00 0x9F which checks out given that each byte is sent LSB first.
Comparing this to the “get settings” example in https://www.team-blacksheep.com/tbs_smartaudio_rev09.pdf the signal sent from the FC looks good. If we look at the signal coming back from the VTX (and this is easier to see in the spreadsheet charts) we see that it doesn’t match. It looks like it’s using one stop bit instead of two, with that the response is:
AA 55 11 0D 00 00 06 16 E9 07 04 00 0E 17 1B 1D F3 00 00
The first two bytes are fine, the next byte indicates a SmartAudio 2.1 response. The next byte is the length, which matches up with having 5 total power levels (4 plus pit mode), then operation mode (pitmode running, using in-range pitmode), then frequency, then 5 power levels that match up with the advertised ones (in dB its 0/14/23/27/29, in mW it’s 0/25/300/500/800), then a CRC and two bytes of zeros. So as far as I can tell this is a valid response except for the fact that it’s using one stop bit instead of two.
I modified Arduplane to use 1 stop bit (confirmed in the scope trace). The VTX still responded with the same response, but oddly ArduPlane is still reporting an “incoming_bytes_count” of 1 instead of at least the 4 bytes of the header, even though on the scope trace the signal looks okay. So I’m not sure what’s going on there.
Strangely, I still get an “incoming_bytes_count” of 1 even if the VTX is powered off, which seems a little odd.