Microcontroller › PIC › PIC16f913 and lcd
- This topic has 3 replies, 2 voices, and was last updated 12 years, 6 months ago by
Arun Sukumaran.
-
AuthorPosts
-
May 20, 2013 at 12:01 pm #2421
Arun Sukumaran
Participanthaiii friends…..
i m a begginer in PIC…. i tried a code in assembly for LCD with PIC 16F913…. the code is giving output to PORTA while i’m checking it with MPSIM… but after dumping it to PIC the LCD shows only 5×7 blocks but not displaying any character…please anybody help me… i post my code here….
list p=16f913 ; list directive to define processor
#include <p16f913.inc>org 0x00
STATUS equ 03h
PORTA equ 05h
PORTC equ 07h
TRISA equ 85h
TRISB equ 86h
TRISC equ 87h
bsf STATUS,05
bcf STATUS,06movlw 07h
movwf CMCON0
clrf ANSEL
clrf PORTA
movlw 0xfc
movwf TRISC
bcf STATUS,05
COUNT1 equ 50h
COUNT2 equ 51h
R1 equ 22h
R2 equ 23h
R3 equ 24h
R4 equ 25h
temp equ 26h
startmovlw 38h
call mask1
movlw 28h
call mask1
movlw 28h
call mask1
movlw 0Ch
call mask1
movlw 06h
call mask1
movlw 80h
call mask1
movlw ‘H’
call mask2
movlw “a”
call mask2
movlw “i”
call mask2here goto here
mask1
movwf temp
movlw 0xf0
movwf R1
movlw 0x0f
movwf R2
movf temp,w
andwf R1,1
swapf R1,1
andwf R2,1
movf R1,w
call cmd
movf R2,w
call cmd
returnmask2
movwf temp
movlw 0xf0
movwf R3
movlw 0x0f
movwf R4
movf temp,w
andwf R3,1
swapf R3,1
andwf R4,1
movf R3,w
call dat
movf R4,w
call dat
return
cmd
movwf PORTA
bcf PORTC,0
bsf PORTC,1
call delay
bcf PORTC,1
returndat
movwf PORTA
bsf PORTC,0
bsf PORTC,1
call delay
bcf PORTC,1
returndelay
movlw d’250′
movwf COUNT2
loop4
movlw d’250′
movwf COUNT1
loop3 decfsz COUNT1,1
goto loop3
decfsz COUNT2,1
goto loop4return
end
May 21, 2013 at 4:45 am #9802Arun Sukumaran
Participantplease anybody help me…..
May 21, 2013 at 6:04 pm #9807AJISH ALFRED
ParticipantHi Arun,
If you are getting black boxes in LCD, that means your LCD is not getting initialized. Most probably the issue is in your circuit connections. Please check the connections for any short cicuit or loose contact or misconnections.
May 22, 2013 at 4:35 am #9809Arun Sukumaran
Participanthi ajish….
i checked it with another hex file(i have only the hex file)…. its working properly….
do you checked my initialisation section in the code…. is there any problem…
-
AuthorPosts
- You must be logged in to reply to this topic.