gastonanthony
New Member
HI, the code that I wrote is to make the PORTB count from 0 to 255, and after that, to make the PORTA count from 0 to 31, and back to incrementing PORTB 255 and so on. but it didn't work that way while i'm simulating it on mplab, after incrementing portb to 255, and PORTA TO 31, it continued incrementing porta from 0-31-0-31... and never escaped the loop. Can someone please try to simulate it on their mplab and see for them selves what's happening, and maybe give a possible explanation
Code:
PROCESSOR 16F84a
#include "P16f84a.inc"
start
bsf STATUS,5
movlw 00h
movwf TRISA
movwf TRISB
bcf STATUS,5
movlw 00h
movwf PORTA
movwf PORTB
count
incfsz PORTB
goto count
countt
incfsz PORTA
goto countt
goto start
end