Did you read the tutorial I linked? That goes over banksel and LED flashing...hello guys..i am now stuck after the following-
#INCLUDE <P16f684.INC>
__config _MCLRE_ON & _PWRTE_OFF & _WDT_OFF & _INTOSC & _CPD_OFF & _IESO_OFF & _CP_OFF & _BOD_OFF & _FCMEN_OFF
; ORG 0x000 ; processor reset
Initialise
bcf STATUS, RP0 ; activate BANK 0
clrf PORTA ; initialize PORT A
clrf PORTC ; initialize PORT C
movlw 0x07
movwf CMCON0 ; comparators OFF
bsf STATUS, RP0 ; change to BANK 1
how will i make my LED ON? should i create a delay?
and there is an instruction called Banksel? i dont know how to use it...please help me out!
banksel selects the bank to use.. If you look at the memory organization of the PIC you are using, you'll notice this on page 10:
Notice there are two banks, and, for instance, TRISA is in bank 1, occupying the same address as PORTA in bank 0, 0x05. In order to set the direction of PORTA, the TRISA must be initialized to the proper state. So, you'd switch to bank 1, modify TRISA to your desired I/O configuration, and the switch back to bank 0 for PORTA I/O.
Attachments
-
24.7 KB Views: 76