Auxilary TM Output Using UART2/Serial2

I'll preface by saying that I'm not a C++ developer.  There are multiple references to APM2/2.5 support for UART2 on the forum.  Most references don't seem to come to conclusion.  I think we have quite a bit of flexibility on how to utilize the HW assets (great stuff).  In my case I wanted to utilize custom TM and an external data recorder in addition to and OSD.

Previously I had followed the Wiki instructions on routing serial3 to the board edge connector.  This also works, but doesn't allow the OSD and tailored stream to be used at the same time.  On my last flight I disabled the GCS writes and used this method to collect TM.  Worked great. 

On the flight before that one I tailored log.pde to write custom data to flash.  Again, worked great.

Utilizing UART2/Serial2 is also easy.  I did not change the jumper.  The mods for arduplane were this simple:

Arduplane.pde

FastSerialPort1(Serial1);       // GPS port
FastSerialPort2(Serial2);       // Aux TM port; LDG

System.pde

  gcs3.init(&Serial3);

#endif
  Serial2.begin(map_baudrate(g.serial3_baud, SERIAL3_BAUD), 128, SERIAL_BUFSIZE); // LDG

Log.pde (note this is just test code, but you get the idea)

    DataFlash.WriteLong(log_Ground_Course);    

    DataFlash.WriteByte(END_BYTE);

    Serial2.printf_P(PSTR("GPS "));  Serial2.printf_P(PSTR(" ")); 

    Serial2.print(millis()/1000., DEC);

    Serial2.printf_P(PSTR("\n"));

My board edge TM port came alive and started sending data at the Serial3 rate.  Hope this post is useful to someone.

Regards,

Larry D. Grater

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi, I don't quite get it, where is Serial3 declared?

    Regards

    Soren

  • Thank you! I was looking for something just like this. Going to give this a whirl for writing out GPS data to an onboard computer, hopefully it works out.

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @_JonMyer: 🚨Attention DeepRacer's including #UndergroundDeepRacer🚨 Check our our LIVE stream that including @IAM_dbro Take a few moments…
Wednesday
DIY Drones via Twitter
RT @MarvelmindMaxim: Extreme precision for 60 swarming robots. #marvelmind #autonomousrobotics #robotics #swarmrobotics #rtls #ips #indoor…
Aug 3
DIY Drones via Twitter
RT @MarvelmindMaxim: Precise (±2cm) tracking for racing boats and autonomous boats. Works outdoor and indoor. #autonomous #AutonomousVehic…
Aug 3
DIY Drones via Twitter
RT @MarvelmindMaxim: Helping PixHawk folks to fly autonomous quadcopters using PX4 and ArduPilot. https://marvelmind.com/drones/ Equally suitab…
Aug 3
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars @donkey_car virtual AI car race is starting in 15 minutes! Watch it live on Twitch https://www.twitch.tv/mossmann3333 htt…
Aug 1
DIY Robocars via Twitter
RT @chr1sa: Don't miss our monthly @DIYRobocars @donkey_car virtual AI car race tomorrow at 10:00am PT live on Twitch. Head-to-head racing…
Jul 31
DIY Robocars via Twitter
RT @sparkfun: Our completed tutorial on building an @NVIDIA Jetson Nano-powered @Sphero RVR gets your bot up and running via teleoperation…
Jul 30
DIY Robocars via Twitter
RT @SmallpixelCar: Freeway test https://t.co/4V5tV9lhIP
Jul 29
DIY Robocars via Twitter
Very small autonomous cars racing, thanks to an overhead camera: https://control.ee.ethz.ch/research/team-projects/autonomous-rc-car-racing.html
Jul 29
DIY Robocars via Twitter
Jul 29
DIY Robocars via Twitter
Jul 29
DIY Robocars via Twitter
RT @chr1sa: Don't miss our virtual AI car race this Saturday! Real developers + virtual cars =🏎️🏎️🏎️ Head-to-head battles with thrills, sp…
Jul 28
DIY Robocars via Twitter
Jul 27
DIY Robocars via Twitter
RT @usashirou1: Jetson nano by Isaac Kaya #jetson https://t.co/Mu1N0CyQkN
Jul 23
DIY Robocars via Twitter
RT @GPUsolution: JetRacer mady by Iflytek company #JetsonNANO #Nvidia https://t.co/MimTymIwge
Jul 23
DIY Robocars via Twitter
RT @openmvcam: I love this: Mega or Mini? Image Classification on the 1MB OpenMV Cam H7 by Ish Ot Jr. in OpenMV, Edge Impulse, Internet of…
Jul 23
More…