Re: RS-232 Digital thermometer - interface and driver

From: Keith (keith_rhodes_at_yahoo.com)
Date: 05/13/04


Date: 13 May 2004 01:31:09 -0700

floyd@barrow.com (Floyd L. Davidson) wrote in message news:<87vfj1ocss.fld@barrow.com>...
> keith_rhodes@yahoo.com (Keith) wrote:
> >floyd@barrow.com (Floyd L. Davidson) wrote in message news:<874qqmoxg8.fld@barrow.com>...
> >> Jeff Breitner <usenet@rudn.com> wrote:
> >> >Hactar wrote:
> >> >
> >> >>>> If it is truly bi-directional, then the tip of the jack is
> >> >>>> either tx data or rx data, the ring is the opposite of the
> >> >>>> tip and the sleeve is ground.
> >>
> >
> >It must be di-directional; the data *** says I send commands to the
> >meter to change modes, switch on the backlight, etc. and I get back a
> >45 byte packet containing the levels read from the probes and
> >calibrated by the meter...
>
> That does not relate the above statement regarding the signal leads.

OK, I misunderstood. I was under the impression that "bi-directional"
meant that data was flowing both computer->peripheral and
peripheral->computer.

>
> If you have single ended leads and a common ground, you can send and
> receive with 3 wires. If you have balanced leads, it would require
> 4 wires.
>
> >
> >Er, I've not got it working yet ;-) I just bought the jack plug to fit
> >to the cable I'm making up.
> >
> >No time to try it tonight, nor tomorrow.
> >
> >Maybe this weekend, if I'm lucky, I'll try things like echo K >>
> >/dev/thermometer to see if I get back the model number.
>
> It should be connected to one of the serial ports. Hence you will
> do
>
> echo -n "K" > /dev/ttyS0
>

Right. Since I don't know yet what the device file is, I was using the
example /dev/thermometer which will be a sybolic link to whatever the
"real" device file is. Like using /dev/modem which is a link to
/dev/ttyS0 or whatever...

> The -n will prevent echo from also sending a newline. You might
> be using /dev/ttyS1 instead, so make sure which port you have.
> I didn't look up the K command, but initially you'll just want
> to see the meter do something which indicates it got a command,
> so any command that would visibly change the LCD would do the
> trick.
>

Good idea. Something like "switch on the backlight", or "toggle
Celsius/Fahrenheit mode" would do that.

> And actually, rather than just echo, I'd suggest either using
> kermit, minicom, or seyon. Those are "modem" programs, and with
> each you will be able to see data coming back. If you put the
> modem program into a debug mode where it prints *all* received
> data as hex, you can then actually decipher what the response is
> too. But the big advantage of a modem program for initial
> testing is that you can change the serial port configuration
> easily.
>

Thanks for the ideas. I'll have a look at what I've got available. I
think that at least minicom and gkermit should be there.

> Once you get that working, all you need to do is write a simple
> C program to send commands and display results... ;-)

Or a simple C program that can be invoked as a command, so that I can
use it in a bash script :-)

Keith.