- This topic has 3 replies, 2 voices, and was last updated 11 years, 11 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › PIC16f913 and lcd
haiii 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,06
movlw 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
start
movlw 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 mask2
here 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
return
mask2
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
return
dat
movwf PORTA
bsf PORTC,0
bsf PORTC,1
call delay
bcf PORTC,1
return
delay
movlw d’250′
movwf COUNT2
loop4
movlw d’250′
movwf COUNT1
loop3 decfsz COUNT1,1
goto loop3
decfsz COUNT2,1
goto loop4
return
end
please anybody help me…..
Hi 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.
hi 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…