• AVR Freaks

ZCD -> Timer Gate -> Greater Than Comparison

Author
acharnley
Super Member
  • Total Posts : 274
  • Reward points : 0
  • Joined: 2016/05/01 06:51:28
  • Location: 0
  • Status: offline
2019/05/22 03:19:25 (permalink)
0

ZCD -> Timer Gate -> Greater Than Comparison

Hi,

I have a gated timer configured to pulse count using the ZCD. Currently I'm using the timer pulse gate interrupt to calculate the frequency (I haven't tested the calc yet so ignore that part if wrong). 

Ultimately a greater than comparison is made and the output fed (or set in software) into a CLC.

My question is whether it's possible to use the CCP in compare mode and/or some wizardry to perform this operation in hardware.  Key is the frequency being measured, it's only between 10 and 20Hz, therefore it's unlikely the CCP will capture in +/- 1 steps.

Chip is a PIC1615323 (no SMT).

Regards, 

Andrew

Attached Image(s)

#1

2 Replies Related Threads

    acharnley
    Super Member
    • Total Posts : 274
    • Reward points : 0
    • Joined: 2016/05/01 06:51:28
    • Location: 0
    • Status: offline
    Re: ZCD -> Timer Gate -> Greater Than Comparison 2019/05/22 03:42:27 (permalink)
    0
    Better code attached, so trying to shift the 194U into a hardware based comparison.

    Attached Image(s)

    #2
    acharnley
    Super Member
    • Total Posts : 274
    • Reward points : 0
    • Joined: 2016/05/01 06:51:28
    • Location: 0
    • Status: offline
    Re: ZCD -> Timer Gate -> Greater Than Comparison 2019/05/27 13:27:26 (permalink)
    0
    bump ^
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5