I think I found the problem.
Here it is.
Code:
1st i=240 11110000
PortB 11110000 'an example.
Temp=PORTB 11110000
PORTB=Temp & i 11110000
2nd i=241 11110001
PORTB 11110000
Temp=PORTB 11110000
PORTB=Temp & i 11110000
3rd i=242 11110010
PORTB 11110000
Temp=PORTB 11110000
PORTB=Temp & i 11110000
.
..
...
Etc..
The first time you get i=240 in decimal. Which is 11110000.
Then, whatever you "bitwise AND" it with, you will always get 11110000.
Thus, after 240, you will always have 11110000 because each time loop increments, you assign the previous PORTB value to the temp variable.
-------------------
Last edited by sayzer; - 18th October 2006 at 13:13.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks