Shop OBEX P1 Docs P2 Docs Learn Events
Serial Data Garbled — Parallax Forums

Serial Data Garbled

masterme120masterme120 Posts: 1
edited 2011-06-04 10:26 in Propeller 1
I assembled a basic Propellor circuit on a breadboard. Simple test programs work when loaded into RAM or the EEPROM, but when I try to use the FullDuplexSerial object, instead of outputting the string I give it ("Hello, world!"), it always outputs the same sequence of bytes:
"30 B7 EE DC 87 77 77 6E 03 62 CF 9F 47 EF DC 87 EE C1 FE"
Any advice would be greatly appreciated.
Here's my program for reference:
CON

  _XINFREQ = 20_000_000
  _CLKMODE = XTAL2 + PLL4X

  rxPin  = 31
  txPin  = 30
  baud   = 300

OBJ
  fdx   :       "FullDuplexSerial"                      'serial driver

PUB main

  fdx.start(31,30,0,baud)                               'start serial driver

  fdx.str(string("Hello, world!"))

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-06-04 08:44
    It's probably
    CON
    
      _XINFREQ = 20_000_000
      _CLKMODE = XTAL2 + PLL4X
    

    I use... but I have the standard 5Mhz external clock.
    CON
      _clkmode = xtal1 + pll16x     
      _xinfreq = 5_000_000
    

    Do you have a 20Mhz external clock?

    Maybe.. a high speed clock? Connections? See page 68 in the propeller manual.
    CON
    
      _XINFREQ = 20_000_000
      _CLKMODE = XTAL3 + PLL4X
    
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-04 09:18
    What serial terminal are you using?

    Many of those numbers should be ASCII characters. $77 is "w".

    It looks like Mike G. has found the main problem.

    Welcome to the forums!

    Duane
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-06-04 09:19
    You can't use a PLL mode with a 20 MHz crystal or a 20 MHz external clock. The VCO will just oscillate at its open-loop frequency, which will foul up your baud rate and output garbage. Keep your crystal/input frequency between 4 MHz and 10 MHz.

    -Phil
  • Mike GMike G Posts: 2,702
    edited 2011-06-04 09:46
    Phil, I kinda' figured it had something to do with the 20MHz clock but I could not find a spec.
    You can't use a PLL mode with a 20 MHz crystal or a 20 MHz external clock
    Is this information published somewhere?
  • PublisonPublison Posts: 12,366
    edited 2011-06-04 10:26
    Mike,

    Page 26 of the Propeller Data Sheet specs xtal from 4-8 Mhz, although 10 Mhz has been used and is deemed acceptable.

    14.xxx has been used, but I would think 20 Mhz is out of the realm of the PLL.
    Mike G wrote: »
    Phil, I kinda' figured it had something to do with the 20MHz clock but I could not find a spec.

    Is this information published somewhere?
Sign In or Register to comment.