Display Diagnotic Values from PIC UART

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.
Post Reply
jay_dee
Posts: 236
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 96 times
Been thanked: 65 times

Display Diagnotic Values from PIC UART

Post by jay_dee »

Hi, This program uses AppDeveloper to display Names and Values sent over a Serial COM link.
This is usful for Custom microcontroller devices in the field or being debugged, having the program send out internal values can be very helpful.
During testing and a 57K baud serial link, I'm getting a reliable update of around 60 values. It works well in Simulation and Deployed.

The Microcontroller just needs to send a specific diagnostic string, the AD App will then decode and display the info, into one of three columns.
The view below is the test data being pumped out by the test PIC.
RecieveDiagnositicValues_V7.fcsx
(68.47 KiB) Downloaded 4 times
The RxDiag box reports the actual strings recieved.
The Error log reports if the Parse macro find an error in the recieved string or no data is received (Waiting).
Tick the Properties box and you can change the COM Port, Refresh the List or Change the Baud rate. (Thanks Ben! )
Diag.JPG
Diag.JPG (182.67 KiB) Viewed 39 times
Also attached is the testing FC writen for a PIC18F. This contains the Diagnostic Send Macro "Diag_TxtINT"
The macro is deliberatly simple as I dont want to tie the PIC up processing lots of data. (As my previous VT100 version did)
This macro could be used by any Microcontroller with a UART output, Obvioulsy the UART output needs to go to a UART-to-USB-COM converter like a FTDI

The Macro's parameters are
Function: 1=Send both Name and Value. 2=Send Value Only
Line: Set the Console Line to Write too. (2-20)
Column: Set Which Console (Column) to write to. (1,2,3)
Name: The Name to Print (15 Characters Max)
Value: An Integer Value to print.

It builds a string with a start character of ~ and terminating character of $.

The PIC's FC looks way more complex as its producing lots of data to test the limits of the 'RecieveDiagnosticValues' AD
But really all that is needed to send Diagnosic data is the single macro "Diag_TxtINT"
PIC18F_SendDiagnostic_V6.fcfx
(30.71 KiB) Downloaded 5 times
Anyway, I got loads of help sorting out various issues and I thought it worth sharing.
Its not perfect but working well in a few of my field projects. J.

Post Reply