Shop OBEX P1 Docs P2 Docs Learn Events
Propeller counters control — Parallax Forums

Propeller counters control

octaloctal Posts: 67
edited 2010-12-28 02:23 in Propeller 1
Hello,
I'm trying to learn how the COG counters work to generate a square signal. I got them to work, but the main pb for me now is how can I force the start state of a signal?

I mean if I want a 10KHz signal (for example), I'm able to setup the counters to generate such signal, but how can I ask the propeller to start the signal with a High level each time I trigger my counters?

Regards

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2010-12-28 01:54
    octal wrote: »
    I mean if I want a 10KHz signal (for example), I'm able to setup the counters to generate such signal, but how can I ask the propeller to start the signal with a High level each time I trigger my counters?

    For example, when using the NCO mode you simply preset phsx to e.g. NEGX ($8000_0000) which means that bit 31 (the NCO output) is initially high and frqx accumulation continues from there (by default the counter registers are cleared).

    Just for clarification, what do you mean by "trigger my counters"? Normally you set them up and forget about them. Or does it simply mean you "start" them?
  • octaloctal Posts: 67
    edited 2010-12-28 02:23
    Thank you very much for this answer. I tought the PHSX will be cleared each time the counters are started.
    kuroneko wrote: »
    Just for clarification, what do you mean by "trigger my counters"? Normally you set them up and forget about them. Or does it simply mean you "start" them?

    I mean starting them :)

    regards
Sign In or Register to comment.