Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2977 > unrolled thread

Re: Do UART require data structure/format for serial communication?

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2011-04-11 13:57 +0200
Last post2011-04-13 21:49 -0700
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Do UART require data structure/format for serial communication? Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-04-11 13:57 +0200
    Re: Do UART require data structure/format for serial communication? John Nagle <nagle@animats.com> - 2011-04-11 11:13 -0700
      Re: Do UART require data structure/format for serial communication? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-04-13 21:49 -0700

#2977 — Re: Do UART require data structure/format for serial communication?

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2011-04-11 13:57 +0200
SubjectRe: Do UART require data structure/format for serial communication?
Message-ID<mailman.213.1302523106.9059.python-list@python.org>
VGNU Linux wrote:
> Hi All,
> I have two chips one understands Python and the other embedded C.I 
> have connected both chips using UART serial communication channel, 
> however I have no idea how data communication must be achieved between 
> this 2 chips. As for example send using C chip string "Hello Python" 
> which python chip easily understands and replies back a string "Hi C". 
> I am pretty new to embedded systems can anybody help me understand 
> data communication using UART.
> Thank in advance.
>
> VGNU
have a look at http://pyserial.sourceforge.net/

Most of the time, people write a CLI running on the chip. Commands 
(strings) are sent to the CLI through the UART, the interpreter then 
calls the appropriate function.


JM

[toc] | [next] | [standalone]


#2988

FromJohn Nagle <nagle@animats.com>
Date2011-04-11 11:13 -0700
Message-ID<4da344c6$0$10522$742ec2ed@news.sonic.net>
In reply to#2977
On 4/11/2011 4:57 AM, Jean-Michel Pichavant wrote:
> VGNU Linux wrote:
>> Hi All,
>> I have two chips one understands Python and the other embedded C.I
>> have connected both chips using UART serial communication channel,
>> however I have no idea how data communication must be achieved between
>> this 2 chips. As for example send using C chip string "Hello Python"
>> which python chip easily understands and replies back a string "Hi C".
>> I am pretty new to embedded systems can anybody help me understand
>> data communication using UART.
>> Thank in advance.

     What do you want to do?

     There are many serial protocols.  At the low end, you can
send text. At the high end, you can send TCP over PPP.
The Arduno crowd has some protocols of their own.  See
"http://www.arduino.cc/en/Reference/Libraries".

     Any useful protocol must be able to deal with errors
on the link, either end restarting, and the other end failing
to respond.  All those things happen frequently with serial
ports.

     What do you want to do?

					John Nagle

[toc] | [prev] | [next] | [standalone]


#3173

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2011-04-13 21:49 -0700
Message-ID<mailman.346.1302756603.9059.python-list@python.org>
In reply to#2988
On Wed, 13 Apr 2011 14:24:17 +0530, VGNU Linux <vgnulinux@gmail.com>
declaimed the following in gmane.comp.python.general:

> Actually I am trying to data communication between these 2 chips, but facing
> troubles in deciding a protocol to do the same.
> Do UART have any default protocols? For the moment I am trying to do it with
> Strings but not sure if that's the right solution.

	The only absolute protocol is that UARTs use a start bit, some
preconfigured number of data bits, with or without a parity bit, and
some defined stop bit (1, 1.5, 2 bit times) [the infamous 8N1 -- 8-bit
word size, No parity, 1 stop bit]. Even handling transmission start/stop
may be moved into software level (ie; a pair of control CHARACTERS is
used to permit/inhibit transmission <ctrl-q> and <ctrl-s> I believe).
Oh, and bit rate...

	All they do is take a parallel input and convert them to a serial
stream.

	It IS common for them to accept additional pins between them for
permit/inhibit -- RTS/CTS and/or DSR/DTR (or something like that).

	Anything else is purely by agreement in the software using the UART
for communication.

	For example -- does the receiving device want JUST a <cr> to
terminate a command (for example), or does it need BOTH <cr><lf> to be
sent. And if it needs both, will PySerial convert <cr> to <cr><lf> (I'd
hope not, as it would make sending binary data rather difficult)
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web