Shop OBEX P1 Docs P2 Docs Learn Events
Serial speed problems — Parallax Forums

Serial speed problems

juropjurop Posts: 43
edited 2013-05-07 14:39 in Propeller 1
Hi all,

it's two days I'm trying to understand what's going on with serial transmission speed on my side... I already tested and studied many fast objects since I'd like to transfer data from the Prop to PC at the fastest speed possible with my setup. The project is built around a PropUSB board, so the communication with the PC is done via the onboard FT232R uart to USB converter.
Fact is that I had success in communicating with the PC @ 1,5Mbaud rate, but the real transfer speed looks always 'capped' as if it was @ 115_200 or slightly more.
I am reading data from an SD card via FSRW - I already tested speeds and the bottleneck is in the last step, transfer to PC, not in SD card reading. Already tried reinstalling FTDI drivers, different buffer dimensions, different PC side programs... A snippet, just to say what I'm doing, is
CON
  _clkmode = XTAL1 + PLL16X
  _xinfreq = 5_000_000
  
  do = 15                       'SD PINS
  clk = 16
  di = 17
  cs = 18
  
  TERM_TX_PIN = 30
  TERM_RX_PIN = 31


  BAUD1X = 115_200
  BAUD2X = 230_400
  BAUD4X = 460_800
  BAUD8X = 921_600
  BAUD15 = 1_500_000
  
  CR = 13
  LF = 10
  
OBJ
  sd : "fsrw"
  pcOut : "TxSerial"
  pcIn : "RxSerial"


VAR
  long fnamePtr
  byte rdBuf[128] 
  
PUB main | r, r1, c


  pcIn.init (TERM_RX_PIN, BAUD8X)
  pcOut.init (TERM_TX_PIN, BAUD8X)
  
  r1 := \sd.mount_explicit(do, clk, di, cs)
  if r1 < 0
    r := r1
    abort (r)
  
  fnamePtr := string("TEST.BIN")
  sd.popen(fnamePtr, "r")
  
  pcOut.str(fnamePtr)
  pcOut.str(string(CR,LF))
  
  waitcnt(cnt+clkfreq/10)


    ' test code for read timing
  repeat while ((r := sd.pread(@rdBuf, 64)) > 0)
    c := 0
    repeat r
      pcOut.tx(byte[@rdBuf + c++])


Commenting the pcOut.tx(byte...) line, the time for reading the file is about 2,75 secs while the transfer happens in a time ranging from 52secs @ 115_200 to 46 secs @ 1_500_000. Any clue on what's possibly going on?
Sign In or Register to comment.