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.
Thanks you Jerin .... But i need is PIC microcontroller and the proccessor is P16F876A ... i need a example in assembly language and not in C language, but the way i am newbie to learn the PIC microcontroller for my Final Year Project ....
This step is given to include the library details of the PIC you are using.It can be 16F877A instead of 876A. The second line is the settings provided to the configuration register in the PIC which is same to all PIC.The _data_ denotes the different bits of the configuration register which is a 16 bit register.list p=16f876a ; list directive to define processor
#include <p16f876a.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
;************************************************* ******************
This refers to that the execution of the code starts from the location 0000h location of the internal memory of PIC.org 0x0000
goto Main
It is done so as to configure PORTB of the PIC as input. Giving the value '0' to the TRIS register of corresponding ports make the port work as output & by giving the value '1' to the TRIS register of corresponding ports make the port work as input.banksel TRISB
movlw 00h
movwf TRISB ;Set all PORTB pins to output
This step is provided so as to initialize PORTA channel 1 as DIGITAL channel & the rest of the channel as ANALOG channel(PORTA has ADC functionality).The next step is same as that of PORT initialization.banksel TRISA
bsf ADCON1,1 ;Port A is digital I/O
bsf ADCON1,2 ;...
movlw 01h
movwf TRISA ;pin 0 is input, the rest is output
This step is done so initialize the LCD module whose data pins(D0-D7) are connected to PORTB & command(control) pins are connected to PORTA.(Refer 16*2 LCD module interfacing with PIC).bsf PORTA,2 ;RS pin on
bsf PORTA,4 ;E pin on
bcf PORTA,3 ;R/W pin off
This part of the code outs the value 'A' out in the LCD via PORTB.The next lines are provided so as to initialize back the LCD module.movlw 41h
movwf PORTB ;"A" character
bcf PORTA,4 ;E pin off
bcf PORTA,2 ;RS pin off
bsf PORTA,3 ;R/W pin on
This is provided so as to get continues data on the LCD while data is passed via PORTB.goto Main1