I would appreciate some help/advice with what seems a very simple problem, however I am just starting out in this branch of the hobby and I’m a raw beginner with buckets to learn!
I wish to read the lower 5 bits of my PIC (16F628) which are connected to 5 simple (0 or 1) sensors and then deliver a conditional result to a PORTA pin with IF…THEN statements. As an example IF PORTB = %11100100 THEN etc etc. This seems OK but I would like to remove the upper 3 bits as they are not required. I can hold these three pins high, for example, so they are always a 1 but it would be nice to ‘isolate’ them out of the logic. Is there a way of doing this, please? I hope that’s clear but effectively I would like to end up with a statement which simply says, for example IF PORTB (or MyVar) = 00100 THEN etc etc
How to do this, please
Many thanks
Adrian
Bookmarks