Shop OBEX P1 Docs P2 Docs Learn Events
Long delay using the built-in counters — Parallax Forums

Long delay using the built-in counters

DDSDDS Posts: 16
edited 2009-05-07 23:55 in Propeller 1
Is it possible to configure a cog to provide a long delay (longer than 54 seconds) using the cot's counters?

What I had in mind was routing the output of counter A· (in NCO/PWM single ended mode) into counter B as counter B's clock (instead of counter b being clocked by the system clock).

I don't want to dedicate an entire cog to the job if the counters can perform the job ( and more accurately than using SPIN.)

Thanks,

Don

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-07 23:33
    You can do that. CTRA will have to output to a pin, which CTRB uses as an input in edge mode. You won't be able to output CTRB to a pin, though. But you can read PHSB to get how many CTRA edges were counted.

    -Phil
  • DDSDDS Posts: 16
    edited 2009-05-07 23:55
    I discovered that trick last night but dismissed it because it used a cog to retreive the accumulator.

    Thinking about it now, I can retreive and set the output bit inside the cog's spin looping code.

    This would give me a long delay without much overhead.

    Thanks,

    Don
Sign In or Register to comment.