Serial Port data dumping program

Glenn Dawson glenn at antimatter.net
Mon Sep 5 03:29:32 PDT 2005


At 02:32 AM 9/5/2005, Paul Hamilton wrote:
> > >Here is a dump of the collected data (via minicom):
> > >
> > >#hexdump  minicom.cap
> > >0000000 45ff 49ff 4cff 50ff 53ff 57ff 5aff 57ff
> > >0000010 53ff 50ff 4cff 49ff 45ff 45ff 01ff ff82
> > >0000020 8101 01ff ff80 8202 02ff ff81 8002 03ff
> > >0000030 ff83 8203 03ff ff81 8003 7fff 7fff 7eff
> > >0000040 01ff ff7f 7f02 03ff ff7f ff7f 8001 02ff
> > >0000050 ff80 8003 04ff ff80 ff80 8006 07ff 0080
> > >
> > >Looking at the first row of data, it is only showing two bytes, sync
> > >and servo position.  Rows 020 and 030, shows some servo
> > addresses, but
> > >sometimes, together!  Both the mini-ssc.exe and minicom program are
> > >using 9600 8n1, so why is it showing this?  Is there
> > something I have
> > >missed in the setup of minicom?  Looks like this is a serial buffer
> > >problem.
> >
> > You probably have byte ordering issues.  Does something like this
> > look more reasonable?
> >
> > 0000000 ff45 ff49 ff4c ff50 ff53 ff57 ff5a ff57
> > 0000010 ff53 ff50 ff4c ff49 ff45 ff45 ff01 82ff
> > 0000020 0181 ff01 80ff 0282 ff02 81ff 0280 ff03
> > 0000030 83ff 0382 ff03 81ff 0380 ff7f ff7f ff7e
> > 0000040 ff01 7fff 027f ff03 7fff 7fff 0180 ff02
> > 0000050 80ff 0380 ff04 80ff 80ff 0680 ff07 8000
> >
> > -Glenn
>
>Yes, somewhat better, but still missing bytes here and there, ie. First
>line, all the servo address bytes etc.

The missing bytes might be caused by loading the tx data line with 
two inputs.  I've seen various rs-232 devices that expected signal 
levels that other devices couldn't achieve when driving two 
inputs.  The PC your using could be missing some bytes because the 
signal levels are right at the edge of being acceptable.  That's just 
a guess though, to find out for sure you'd need to look at the levels 
with a scope and see what's really going on.


>Why would the bytes be swapped around?

big endian vs. little endian

Wikipedia has a decent explanation:
http://en.wikipedia.org/wiki/Endianness

-Glenn


>Cheers,
>
>Paul
>
> >
> >
> > >Is there a better program I could use to display the incoming serial
> > >data in hex?
> > >
> > >NOTE:  I only use two wires, signal ground and Tx Data (connected to
> > >the Rx Data).  The servo does respond correctly, so I know
> > the serial
> > >data must be in the correct 3 byte format.
> > >
> > >Looking fwd to your thoughts.
> > >
> > >Cheers,
> > >
> > >Paul Hamilton
> > >
> > >_______________________________________________
> > >freebsd-questions at freebsd.org mailing list
> > >http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > >To unsubscribe, send any mail to
> > >"freebsd-questions-unsubscribe at freebsd.org"
> >
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe at freebsd.org"
> >
> >
>
>_______________________________________________
>freebsd-questions at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list