Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplexSerial and Zigbee - errors — Parallax Forums

FullDuplexSerial and Zigbee - errors

robotmikerobotmike Posts: 2
edited 2007-07-26 18:19 in Propeller 1
I'm a newbee to the propeller, and I'm missing something here.

Problem: I'm using the FullDuplexSerial lib to connect a Propeller to a Maxtream Zigbee chip via serial. Data is being corrupted.
Some characters always make correctly, like 'Z's, while others don't, like 'A's. The character that fail just have some bits added.

As a reality check I connected the Propeller to a a PC (via a level converter, using HyperTerm) and the characters were corrupted.


The following code is intended to output the upper case alphabet.

-
Any help would be greatly appreciated.





{{ SerialTest.spin }}

CON

  PINRX = 3
  PINTX = 4
  Delay = 1_000_000  
  
OBJ
  Ser   :       "FullDuplexSerial"
  
PUB Main | Temp
                                     
  Ser.Start(PINRX,PINTX,$0,9600)                        'PUB start(rxpin, txpin, mode, baudrate) : okay
  waitcnt(Delay + cnt)
  
  Temp := 65
  
  repeat  
    Ser.tx(Temp)
    Temp++
    waitcnt(Delay + cnt)
  while Temp < 91 

  Ser.stop


Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-26 00:07
    You're running the Propeller off the internal default (RCFast) clock which is not accurate enough to do serial I/O. If you have a crystal or resonator hooked up (like on any of the development boards), you need to specify the crystal mode with constant definitions in the CON section of your program. Look at the descriptions of _XINFREQ, _CLKMODE, and _CLKFREQ in the Propeller Manual. You need to specify _CLKMODE and either _CLKFREQ or _XINFREQ in your program.
  • robotmikerobotmike Posts: 2
    edited 2007-07-26 18:19
    smilewinkgrin.gif

    Yes - it works - thanks
Sign In or Register to comment.