Shop OBEX P1 Docs P2 Docs Learn Events
serialport communication — Parallax Forums

serialport communication

TAMILTAMIL Posts: 11
edited 2008-09-26 05:29 in Propeller 1
Hello all,
Here I have attached my work on serial port communication.
idea is to send bytes to propeller and store it in the memory. then read the same data and send it back to pc. i was using BS2 previously thts y i tried using same functions here.

is my approach right?

CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
byte x
byte y
OBJ
BS2 : "BS2_Functions" ' Create BS2 Object

PUB Start
BS2.start (31,30) ' Initialize BS2 Object timing, Rx and Tx pins for DEBUG
x := BS2.SHIFTIN (31, 6, BS2#MSBPOST, 8)
BS2.Write(0, x,1)
y := BS2.Read_HighMem(0, 1)
BS2.SHIFTOUT(30,6,y,BS2#LSBFIRST,8)

Post Edited (TAMIL) : 9/25/2008 9:58:26 PM GMT

Comments

  • LeonLeon Posts: 7,620
    edited 2008-09-25 21:56
    Why don't you use the serial port code in the Obex?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-26 05:29
    Take a look at Monitor.spin in your Tool's home directory, it does exactly what you want.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.