nandrei
Newbie level 4
Hello,
I'm trying to make sort of a pocket calculator using pic16f84a. Right now i got to the stage of using buttons (ra0 --- ra3) and trying to output to PORTB. Later i will use a display
I want to bit-check every pins ra3, ra2, ra1 in this order so that pressing ra3+ra1 = 5 (an operand for my addition) so i want to rotate right PIN_I with every loop :
basic ideea of the code:
PIN_I equ 0Eh
....
begining movlw 0x04
movwf PIN_I
...
btfsc PORTA, PIN_I ; <<<<<<<<<<<<< compiled and simulated the value of PIN_I doesn't change ; with every loop (in gpsim i get a constant)
rrf PIN_I, 1
btfss STATUS, 0
....
goto begining
the compiler gives me this warning
keyboard_leds.asm:63:Warning [202] Argument out of range. Least significant bits used.
(whitch shouldn't bother me, i think, because PIN_I has values 4, 2 or 1)
full source code is attatched.
Thanks, Andrei
Added after 50 seconds:
i can't upload as attatchment, here is the source code
**broken link removed**
I'm trying to make sort of a pocket calculator using pic16f84a. Right now i got to the stage of using buttons (ra0 --- ra3) and trying to output to PORTB. Later i will use a display
I want to bit-check every pins ra3, ra2, ra1 in this order so that pressing ra3+ra1 = 5 (an operand for my addition) so i want to rotate right PIN_I with every loop :
basic ideea of the code:
PIN_I equ 0Eh
....
begining movlw 0x04
movwf PIN_I
...
btfsc PORTA, PIN_I ; <<<<<<<<<<<<< compiled and simulated the value of PIN_I doesn't change ; with every loop (in gpsim i get a constant)
rrf PIN_I, 1
btfss STATUS, 0
....
goto begining
the compiler gives me this warning
keyboard_leds.asm:63:Warning [202] Argument out of range. Least significant bits used.
(whitch shouldn't bother me, i think, because PIN_I has values 4, 2 or 1)
full source code is attatched.
Thanks, Andrei
Added after 50 seconds:
i can't upload as attatchment, here is the source code
**broken link removed**