Shop OBEX P1 Docs P2 Docs Learn Events
clkfreq timing ? — Parallax Forums

clkfreq timing ?

$WMc%$WMc% Posts: 1,884
edited 2010-01-02 04:36 in Propeller 1
Hello all

·I'm following the SIRCS,Propeller style article in the Jan.2010 issue of Nuts&Volts by Jon Williams. The sircs start bit "as stated" is 2.4ms and the statement "· START_BIT := clkfreq / 1_000_000 * 1_920· " is used.
My·question is how does this equal 2.4ms ?

I've looked at the· clkfreq·explanation on pg.175 of the Prop.Manuel, But I seem to be missing something.

Thanks in advance for any info/help on this topic.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA

Post Edited ($WMc%) : 1/1/2010 6:58:43 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-01 19:13
    CLKFREQ is the number of system clock ticks in one second, so CLKFREQ / 1_000_000 is the number of clock ticks in 1us. If you multiply this by 1_920, you'd get the number of clock ticks in 1.92ms.

    In the code archives for the article (downloadable from Parallax's Nuts and Volts webpage), the constants look like "CLKFREQ / 1_000_000 * 2400". Where did you get the 1_920 value?
  • $WMc%$WMc% Posts: 1,884
    edited 2010-01-01 19:38
    Thanks Mr. Green

    · 2400 sounds more like it.

    Heres the code I downloaded from the Prop.Obj.Exc.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-01 23:02
    It looks like Jon is allowing for +-20% error in pulse width. 1920us is 80% of the nominal start pulse width of 2400us.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-01-02 04:36
    Mr.Green

    Now I really understand the 1920 value. I hadn't thought of a short start bit. I see he did the same thing with "ONE_BIT".
    I'll add this 80% of value to the REM code so I'll remember later.

    Thanks again

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
Sign In or Register to comment.