Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
byte x = 0;
for( ; x < 99; x++ )
{
if( button )
{
break;
}
delay_ms(100);
}
Agent 009 said:10x Kybert 4 ur prompt response, but:
Language: assembly, for PIC
Input: any bit from port A
HI, what is this start movf count,portb ???Agent 009 said:Yes Nigel... This post was just for a friend, not me... Anyway, thanks!
He tried, after initialization:
movlw 0x00
movwf count
start movf count,portb
call delay
btfsc porta,3 ; if porta bit 3 is the input switch
goto stop
INCFSZ count
goto start
stop goto stop
end
where delay is a convenient delay... Would this work?
Agent 009 said:Nigel, I cld b my browser, but tutorial 10.1, which I need, is not showing up!!!
Jay.slovak said:And you program counts from 0-255, not from 0-99, You need to add COMWF instruction to limit number od cycles. (I don't know if there is one for 16F though..)
Main
call Delay255
call Delay255
call Delay255
call Delay255
incf ones, f
movf ones, w ;test first digit
sublw 0x0A
btfss STATUS, Z
goto Main
clrf ones
incf tens, f
movf tens, w ;test second digit
sublw 0x0A
btfss STATUS, Z
goto Main
clrf tens
goto Main ;loop for ever
[quote]
It simply increments two GPR's called 'ones' and 'tens', and loops back to zero after 99 - the actual displaying is done by the interrupt driven multiplexing routine.[/quote]
nisrine said:if we wanna use the pic16F84 instead, what shall we do with the interrupt register :
PIR1, TMR2IF, T2CON, PIE1
nisrine said::'( do u have a program written that fits the 16F84?