Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Positive edge trigger for LPM_COUNTER reset pin

Hi,

I want to reset the LPM_COUNTER on positive edge of an input pin.

For example when the input signal rises to logic ‘1’, I want the counter to reset to zero and start counting, and don’t stuck at reset state while the input signal is still logic ’1’.

I'm not sure if i should design an custom counter or i can use the LPM_COUNTER with some additional logic combination attached to the reset input.

I'm kind of new in this area.

Please give me some suggestions.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi,

    I want to reset the LPM_COUNTER on positive edge of an input pin.

    For example when the input signal rises to logic ‘1’, I want the counter to reset to zero and start counting, and don’t stuck at reset state while the input signal is still logic ’1’.

    I'm not sure if i should design an custom counter or i can use the LPM_COUNTER with some additional logic combination attached to the reset input.

    I'm kind of new in this area.

    Please give me some suggestions.

    --- Quote End ---

    depends on what you mean by edge

    try this:

    clocked process

    reset_d <= reset;

    ...

    reset_final <= reset and not reset_d;

    would give you one pulse of reset (one clock period)