Shop OBEX P1 Docs P2 Docs Learn Events
PPDB + sendSerialData to PC via rs232 — Parallax Forums

PPDB + sendSerialData to PC via rs232

nomadnomad Posts: 276
edited 2010-04-17 03:35 in Propeller 1
hi
i want sent "dummyDatas to the RS232-Port to an LinuxLaptop.
but the reader of laptop are hanging ??
and in the moment i don't no, which system makes the
trouble:
please let me know whether my code is correct:

thanks for help, hints and tips
regards nomad


  name: serialsend_xx.spin
  dd. 15.04.2010

  should do:
  
  1) only send dummyDatas

16.04. - 1.online versuche
         - compile on ppdb: OK
         - run ppdb       : ???
         - run laptop     : nok bleibt bei reader stehen  

**************************************************************************
}

CON
  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

  Rx   = 27    ''29    ''31            '                 
  Tx   = 30            '                                  
  baud = 9600

   
OBJ                                              
   Serial : "Extended_FDSerial"
                  
VAR
  LONG myInput     ' SerialInput
  
{*************************************************************************}
PUB Main

   Serial.Start(Rx,Tx,0,baud)   

   repeat

      dummyDatas

      ' or this stuff
      ' Serial.str(String("$"))
      ' Serial.dec(111)
      ' Serial.str(String(":"))
      waitcnt(clkfreq / 10 + cnt)  

{                     
      myInput := Serial.rxDec       ' receive bigNumbers as ServoCommands
      waitcnt(clkfreq / 10 + cnt)

      IF myInput == 1
         QUIT

      IF myInput == 10
         dummyDatas

      IF myInput > 10
         Serial.dec(myinput)             '' so ok with abfrage
         waitcnt(clkfreq / 10 + cnt) 
      
        'Serial.dec(myinput)             '' so ok no abfrage
        'waitcnt(clkfreq / 10 + cnt)  
}        
                
PUB dummyDatas            ' dummyDatas are values from Compass & 7x Pings
  Serial.str(String("$"))
  Serial.dec(111)
  Serial.str(String(":"))
  Serial.dec(222)
  Serial.str(String(":"))
  Serial.dec(333)
  Serial.str(String(":"))
  Serial.dec(444)
  Serial.str(String(":"))
  Serial.dec(555)
  Serial.str(String(":"))
  Serial.dec(666)
  Serial.str(String(":"))
  Serial.dec(777)
  Serial.str(String(":"))
  Serial.SetDelimiter(13)
  waitcnt(clkfreq / 10 + cnt)          


Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2010-04-16 13:37
    Hello Nomad,

    I tested your code on my PPDB and my WInodws Notebook.
    This is working. So your code can be excluded as the source of the bug.

    Now you have to narrow down the problem. Do you have two computers?
    If yes try to send and receive between these two computers. If you link them direcly you have to use a null-modem-cable where pin2---pin3 and pin3---pin2 are connected crossover

    If this is working you can exclude the laptop-com-port

    of what kind of equipment did you build the serial connection? What are the parts that you use and how are they wired with each other?

    best regards

    Stefan

    Post Edited (StefanL38) : 4/16/2010 9:53:16 PM GMT
  • nomadnomad Posts: 276
    edited 2010-04-17 03:35
    hi stefanL38,
    thanks for your answer,
    i think to this is a problem with my linux-laptop
    ( i think, eventualy a timing problem)
    when i transmit only number (no strings) its running verry good.
    aka: linux send < 123 > to the ppdb then ppdb receive this data and sendback < 123 >
    its ok - also i think the rs232-connection is ok

    but now, i know that the propeller-spin-code is OK
    the cabling should be ok.
    thanks for your help
    regards nomad
Sign In or Register to comment.