Goodday to you all;
I started with programming of a pic for 2 days now;
And have a question about assembly, i have a PIC 16F887a on a EASYPIC7 (development) board.
I try to read the buttons on PORTB and direct them to PORTC.
So i tought i do:
movlw PORTB ; mov value of PORTB to "W file" (depents on which switches are pressed)
;and direcly after that
movwf PORTC ; mov value of "W file" to PORTC and should light up the led's
But no luck,
Can this work (and did i setup the PIC wrong) or can this not work and if so why not ?
movlwplaces a literal value in WREG. This means that the value is a constant, determined at assembly time.movlw PORTBplaces the low byte of the address of PORTB in WREG, not the value of PORTB. To get the value, you need to use themovfinstruction.