masking a bit in select statement

If you have a simple question and just want an answer.
babazaroni
Experienced Member
Posts: 94
Joined: Sun Feb 10, 2013 4:47 am

masking a bit in select statement

Post by babazaroni »

I'm using select and pinsneq to synchronize with a bit on a 4bit port.  The problem is that another bit on that port at a much higher frequency is causing jitter, as the code needs to check to see if it was our intended bit that caused the event.

Is there a way to mask off the offending bit, so it won't cause an event?  Or maybe there is a better way, other than a hardware change?

 

Here is some code showing what I am doing.

        for (;;){

               select {
                   case p_synch when pinsneq(state_old) :> state_new:

                            if (state_new & 2)

                                   return;  // we are synchronized

                            break;

              }

       }


 

Guest

Post by Guest »

It is not possible to mask some bits of a multibit port in select statement. You need to compare the old value with the latest value to see if there is any chaneg in the data each time the event occurs by masking the high frequency bit.