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

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…