Shop OBEX P1 Docs P2 Docs Learn Events
Doubts on CTRA — Parallax Forums

Doubts on CTRA

hal2000hal2000 Posts: 66
edited 2009-02-23 20:53 in Propeller 1
Hello all
I have a doubt on CTRA
I would like to generate a 5kHz signal on pin 20 and simultaneously
counting the pulses that result in a period of time.
Is it possible to use as CTRA oscillator, and PHSA to count the cycles?
Do I need to use PHSB? confused.gif

Described in the manual, but I do not have enough English to understand
using CTRA
Thank you.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Did the curiosity kill the cat?
......................................

Comments

  • hal2000hal2000 Posts: 66
    edited 2009-02-23 11:18
    Watch this Object

    http://obex.parallax.com/objects/52/





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Did the curiosity kill the cat?
    ......................................
  • hal2000hal2000 Posts: 66
    edited 2009-02-23 14:00
    Maybe CTRA is% 01011
    Is this cycle oscillator and counter with the same CTRA?

    Pin := 5
    DirA[noparse][[/noparse]Pin] := In
    CTRA := 0
    CTRA := (%01011 << 26 ) | (%001 << 23) | (0 << 9) | (Pin)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Did the curiosity kill the cat?
    ......................................
  • AribaAriba Posts: 2,690
    edited 2009-02-23 15:51
    If counter A produces a frequency, phsa is already in use, together with frqa (frqa is added to phsa every cycle, and bit31 of phsa is the output frequency). So you can't use the same counter to count pulses. This would need a totally different counter mode anyway.

    Andy
  • hal2000hal2000 Posts: 66
    edited 2009-02-23 20:53
    OK

    CTRA used also oscillator
    CTRB a count

    Thanks!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Did the curiosity kill the cat?
    ......................................
Sign In or Register to comment.