Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Can give me assembly code for p16f876a display word on lcd?

Status
Not open for further replies.

tee_say

Newbie level 4
Joined
Sep 30, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,482
i try to find assembly code at internet but all cant display the word at lcd. If someone have can send to me see. tq :)
 

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 ....
 

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 ....


Hi

Try here - PIC Tutorial* Three - LCD Modules
 
Initially you learn how to use assembly language compiler for PIC i.e MPLAB IDE. Do familiarize with it by doing small instructions by referring to the data sheet of PIC.
Regards,
Jerin.
 
Reply to the code you have messaged:
First of all when the code is being explained here do refer with the data sheet of the concerned PIC you are using & i would prefer 16F877A.
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 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.
org 0x0000
goto Main
This refers to that the execution of the code starts from the location 0000h location of the internal memory of PIC.
banksel TRISB
movlw 00h
movwf TRISB ;Set all PORTB pins to output
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 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 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.
bsf PORTA,2 ;RS pin on
bsf PORTA,4 ;E pin on
bcf PORTA,3 ;R/W pin off
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).
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 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.
goto Main1
This is provided so as to get continues data on the LCD while data is passed via PORTB.

Refer the following links too.This will help you.
https://ww1.microchip.com/downloads/en/devicedoc/39582b.pdf.
Embedded Systems LCD interfacing.
If any doubt still persists post it in the forum.We'll surely help you mate.

Regards,
Jerin. :)

---------- Post added at 12:23 ---------- Previous post was at 12:22 ----------

Check it out & DO message me........
Regards,
Jerin. :)
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top