It needs & and after needs |
Thanks everyone for the response.
Well sayzer gave me the kick-start!
What I was needed was to keep the upper bits while setting or reseting the lower according to the counter in the for - next loop. This is done first by clearing the lower bits, then OR-ing with the new value. I was too tired to see it immediatly. But, thanks for the try...
The new code should look like this:
for i=240 to 250
temp=portb
temp=temp & $F0
temp=temp|i
portb=temp
pause 1000
next i
Thanks again,
Ioannis