Shop OBEX P1 Docs P2 Docs Learn Events
Full Duplex 7 / 8 data bits — Parallax Forums

Full Duplex 7 / 8 data bits

PatrickSPatrickS Posts: 2
edited 2006-12-24 17:57 in Propeller 1
Hi all,

I am new here, playing around with a propeller chip since a few days.
I connected a GPS which sends data with 4800baud, no parity, 8 data bits, no control bit and one stop bit.
I tried to forward this data with full duplex object from P0 to P30 but receive only strange characters in hyperterminal.
If I use P31 instead of P0 and tye in characters - I have the same.
Do I change the 8 databits to 7 for the last test, then I get the same character back I typed in before.
Has this something to do with those different modes? I tried 0, 1 and 3 but still do no get what I expect.

Kind regards
Patrick

See below the code I am using:
CON
  
  Out = %1

VAR
  
   long  s
   Byte Pin16 , rcvd, Pin17, ins
OBJ
  ser   :   "FullDuplexSerial"

PUB start
  Pin16 := 16
  DirA[noparse][[/noparse]Pin16]:=Out
  OutA[noparse][[/noparse]Pin16] := 0 '!OutA[noparse][[/noparse]Pin16]
  Pin17:=17                             
  DirA[noparse][[/noparse]Pin17] := Out
  OutA[noparse][[/noparse]Pin17] := 0
  s := 0
  ser.start(31,30,0,4800) '31 incoming PIN, 30 Outgoing PIN   
  repeat
  
   ins := ser.rx
   if ins
      s++
      if ins == $09  'if TAB is pressed
        s:=0
        OutA[noparse][[/noparse]Pin16] := !OutA[noparse][[/noparse]Pin16]
        OutA[noparse][[/noparse]Pin16] := !OutA[noparse][[/noparse]Pin16]
  
        'OutA[noparse][[/noparse]Pin17] := !OutA[noparse][[/noparse]Pin17]
      ser.tx(ins)
   if s == 1
      'ser.tx(ins)
      OutA[noparse][[/noparse]Pin17] := !OutA[noparse][[/noparse]Pin17]
      'OutA[noparse][[/noparse]Pin17] := !OutA[noparse][[/noparse]Pin17]
      s :=0
  
   '  DirA[noparse][[/noparse]16]:=Out
  

Comments

  • PatrickSPatrickS Posts: 2
    edited 2006-12-24 15:32
    Hi all,

    I still did not suceed - can anyone tell me if he has connected such a device (4800,8,N,1) and looped/shifted this data through the propeller?
    I do not understand the assembler code if there is a restriction to a certain number of bytes.

    PS: The GPS is connected directly to the propeller, for communication to my PC I am using a MAX232.

    Nice Christmas and kind regards,

    Patrick
  • rokickirokicki Posts: 1,000
    edited 2006-12-24 16:16
    Sure, I've made the serial device work with echo. I'm really not sure
    what you're trying to do with all that code, though. If you tell us more
    about your setup, maybe we can help some more.
  • tdustdus Posts: 6
    edited 2006-12-24 17:57
    Hi Patrick,

    try with this mode settings: ser.start(31,30,%0010,4800) '31 incoming PIN, 30 Outgoing PIN

    mode bit 0 = invert rx
    mode bit 1 = invert tx
    mode bit 2 = open-drain/source tx
    mode bit 3 = ignore tx echo on rx

    Uwe
Sign In or Register to comment.