Drier !n"tallation
pySerial #o$ule
Demo on Con"ole
Demo on %&!
Serial Communication
Architecture
FPGA
USB
to
UART
&A('
Connection
&S) Ca*le
Buffer
&S) to &A('
Drier
User
+P%A )oar$ ,aptop
(e-ue"t
(un on multi;plat.orm
100= Python
Ea"y to in"tall
Ea"y to u"e
ySerial !o"ule
Installation
+rom Source
%et the archie 3py"erial;2.y.tar.g>6 .rom
http<??pypi.python.org?pypi?py"erial. &npack it, go to py"erial;2.y
$irectory an$ run<
python setup.py install
&*untu 10.10
ySerial !o"ule
Basic Functions
Serial Cla""
ser = serial.Serial('/dev/ttyUSB0', 9600)
write +unction
ser.rite('!')
ySerial !o"ule
Basic Functions
in1aiting +unction
ser.in"aitin#()
rea$ +unction
ser.read($%%)
ser.read(ser.in"aitin#())
clo"e +unction
ser.&lose()
pySerial AP!
http<??py"erial."ource.orge.net?py"erial@api.html
Demo on Console
GUI Tool Develoment
&"ing PyAt
SPPyAt 'ool
Polling #etho$
A$antage< Ea"y to
Deelop
Di"a$antage"<
(e"ource !ne..iciency
an$ Signal )locking
A
t
E
n
g
i
n
e
Ti #$ Chec%in& for 'ew Data
'imer #etho$
A$antage< (e"ource
E..iciency
Di"a$antage<
Chance o. 'riggering
)u..er 4er.low
4pen Connection
Di"play Data
%et Data
Sen$ Data
8o
Ce"
A
t
E
n
g
i
n
e
i" *u..er emptyB
Ti #$ Chec%in& for 'ew Data
During @@init@@
sel'.lo#(imer = )one
'hrea$ #etho$
A$antage< 8o
)locking Signal
'hrea$ Com*ine$
with (ea$ )locking
Proi$e" (e"ource
E..iciency
ser.3ead(!)
4pen
Connection
(ea$er
Sen$ Data
Clo"e
Connection
1riter
'hrea$"
Ti #$ Chec%in& for 'ew Data
&S);to;Serial Communication
/dev/ttyUSB7
Downloa$ing pySerial
pySerial Documentation
pySerial AP!
,oke Kwan 8g