Shop OBEX P1 Docs P2 Docs Learn Events
Serial comms with RCFast — Parallax Forums

Serial comms with RCFast

crgwbrcrgwbr Posts: 614
edited 2007-03-26 19:46 in Propeller 1
I'm using a propeller to communicate with a Python app I wrote for the computer. Everything was going fine (I was using a 5 mhz crystal), then my crystal went bad (I think I hit it with my soldering iron). Anyway, I switched to RCFast mode so I wouldn't have replace the crystal right away, and the Serial Com seemed to stop working. Is there something about the FullDuplexSerial routines that won't work with RCFast?

Thanks,
Craig

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life

Comments

  • CJCJ Posts: 470
    edited 2007-03-26 13:22
    the RC modes are not accurate or stable enough for async serial

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax Forums - If you're ready to learn, we're ready to help.
  • crgwbrcrgwbr Posts: 614
    edited 2007-03-26 13:35
    Thanks CJ. Guess I'll have to replace it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • Jeff MartinJeff Martin Posts: 755
    edited 2007-03-26 19:06
    CJ's on the right track,

    To be more specific (for what it's worth):

    It really depends on what baud rate you are trying to use and the actual speed of the RC oscillator...·the main thing is that the clock frequency value (the value returned by issuing the Spin CLKFREQ command), or reading location 0 (long) in Main RAM, is written by the application with the "ideal" value of 12,000,000 Hz... but the IRC is actually·running anywhere from 8 MHz to 20 MHz... I've found it to be typically in the 13.4 MHz area.

    For a given temperature/voltage, the IRC is fairly stable (though likely different from chip to chip)... ·but it's the fact that the FullDuplex object thinks its running at 12 MHz, when it is actually 13+ Mhz (typically), that's preventing it from timing async serial properly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Jeff Martin

    · Sr. Software Engineer
    · Parallax, Inc.
  • CJCJ Posts: 470
    edited 2007-03-26 19:24
    so you could probably get away with lower baud rates, by using a simple calibration routine,

    maybe a calibration byte sent to the prop at a specified baud rate to get its attention and so it can set its CLKFREQ "register" close enough to work for a packet or two, could be quite useable especially with some sort of checksum for the packet

    just a thought stemming from Jeff's post about the relative stability of the RC clock

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax Forums - If you're ready to learn, we're ready to help.
  • T ChapT Chap Posts: 4,223
    edited 2007-03-26 19:46
    Mike was discussing an auto calibrate method very recently. I don't remember the thread.
Sign In or Register to comment.