hi,
I would advise you,as my previous posting, [ as nigel also recommends], keep to ascii for your serial data transmission. If you use hex/bin, trying to find a problem can drive you crazy. 'Is it the PIC or is it the 'high level' software'
If you use ascii, you can send your serial data into a simple terminal program, like Procomm etc,, and see instantly see your output data in plain text.
Further to my earlier post, you should also consider what you are going to output in the event of a failure of a corrupted sensor input to the PIC.
Example: say a bit line fails on a input switch and it converts say to a value
greater than '9'. I would suggest that you discuss this with the end user.
In my radio telemetry systems, where a received digit becomes corrupted, the serial output becomes 'V ??.??<crlf> .
The PC program is written to recognise this pattern.
If you decide to output 'V 00.00<crlf>' for a corrupt parameter, this could
be misinterpreted a actual value and the wrong action taken.
Regards
EricG
From a previous post it was suggested that you 'string' output your parameters then a <crlf>, a possible problem with this method, is based upon the update rate of the individual parameters in the string.
example: suppose you are sampling a voltage once every second and say temperature every 10 seconds, it would mean sending
the same temperature parameter 10 times, assuming a fixed length data string is being transmitted.
I appreciate that the program in the receiving PC could do a parameter 'ID' locate for each parameter in a variable length string.
Personally I would prefix each data parameter with its own ID character and terminate each parameter with a crlf.