Discussion in "PIC Microcontroller Discussion" started by    pappuneelam    May 1, 2011.
Tue May 10 2011, 12:41 pm
#11
Mr. Ajay,

All instructions (like 0Fh,0Eh,C0h..) are working. Wrongly, I put one 'Delay' in between the Instruction subroutines. Its now functioning all in Simulator. Let me burn my code in PIC16F876A.

Thanks a LOT !!!!!!!!

PappuNeelam


; *********** Clear the screen **************
Sc_Clear
movlw 00h
movwf PORTC
call Command_control
;call Delay1
movlw 01h
movwf PORTC
call Command_control
return
Tue May 10 2011, 01:21 pm
#12
nice job..
Wed May 11 2011, 11:46 am
#13
Hallo!

My code is working fine in the simulator. but, when i burnt the same in the PIC16F876A, I`m not getting any display in 16x2 LCD.

Only the Solid block.
Attach herewith my schematic diagram. Please help, if there is any fault in my connection.

PappuNeelam
Thu May 12 2011, 04:57 pm
#14
@ pappuneelam
solid blocks means that lcd is not configuring properly
see lcd connections once again
and insert 250 ms delay in power start up
also change the contrast pin if u not see any thing on lcd
Tue May 17 2011, 10:05 pm
#15
Hallo !

I tried with 50mS powerup delay before initialisation. But, having no display. I tied the control pin 3 to 10k variable resistor.

I am in doublt whether my PIC is Ok or 4Mhz crystal is Ok ?

How to debug the hardware to detect any hardware fault.

PappuNeelam
Wed May 18 2011, 12:49 am
#16
@ pappuneelam
make a simple led blinking program to test ur pic
toggle any port and see is pic is doing or not
also disable watch dog timer
Wed May 18 2011, 09:14 pm
#17
did you connect some resistor in the LCD contrast pin?
Mon May 23 2011, 09:43 pm
#18
I have attached 10K variable resistor in Contrast Pin 3.
Mon May 23 2011, 09:49 pm
#19
I tried with this program to blink a LED, but has a constant light on LED with the connection from RB0 pin.
I also used new 4Mhz crystal [KDS make]. Is my PIC16F876A is a damaged one ?
; LED Blink in PIC16F876A
; Crystal used : 4Mhz
;-------------------------------

; Declaration and Configuration of the processor
PROCESSOR PIC16F876A
#include <P16F876A.inc>
		
__CONFIG H'39B1'; set the configuration word

;******* Macros & Constants ******
BANK0 	macro 
Bcf STATUS,RP0 ;Select memory bank 0 
Endm
BANK1 	macro 
Bsf STATUS,RP0 ;Select memory bank 1
Endm
		 
COUNT1  equ 20h  	;counter1 for delay loop
COUNT2  equ 21h  	;counter2 for delay loop
COUNT3	equ	22h		;counter3 for delay loop

;***********

ORG 	00h
goto	Main
Main
BANK1
movlw	00h
movwf	TRISA	; set PortA to output mode
movlw	00h
movwf	TRISB	; set PortB to output mode
movlw	00h
movwf	TRISC	; set PortC to output mode
BANK0

call Delay
bsf PORTB,RB0
call Delay
bcf PORTB,RB0

goto Main

;********* Delay subroutine :3 Sec *********
Delay
movlw	0Fh
movwf	COUNT3
loop1   decfsz	COUNT1,1; decrease 1 from 255
	goto	loop1    
	decfsz	COUNT2,1	 
	goto	loop1 
	decfsz	COUNT3,1	 
	goto	loop1      
	return
end



Tue May 24 2011, 11:11 am
#20
@ pappuneelam
use Proteus for easy debugging
then run it on hardware

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am