I'm not sure where the problem is, clearly either B2 or B4 are not being cleared when they should be or there is something wrong with my peek to portb or my masking of B2.
Well it's seems fine to me.. let's say PORTB=%11111011
PORTB & with 2 give 2
PORTB & with 1 give 1
You could still do something much simple. Something like
Code:
Start:
'
'
PEEK PORTB, B2
B2=B2 & 3
If B2=1 then Beep
If B2=2 then Beep
GoTo Start
and sorry... but we don't see any snip of 'beep ' routine, no Symbol declaration, PIC#, schematic etc etc.
It could be a simple hardware problem too. No pull-down resistor on your Buttons, no pull-up on MCLR (or not disabled).. and so On.
Give us more details.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks