Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[PIC] LED blinking for 1 second on 16F84A NOT WORKING

Status
Not open for further replies.

dannyelloko20

Newbie level 5
Joined
Mar 25, 2015
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
65
HI everyone, Im trying to make my LED's blink but i dont know what the problem is with my code. This is what I have:

Code:
		#include <GENERAL.H> (my library)
; ================	EQUATES  =========================================

 COUNTER1    EQU   0x20
 COUNTER2    EQU   0x21
 COUNTER3    EQU   0x22
		
; =======================================================================				

		__CONFIG	0X3FF2		
		ORG			0X0000	
		GOTO		START
		ORG			0X0004		
		RETFIE

START   CLRW
    	BSF    STATUS, RP0			;	
		CLRF   TRISB				
		BCF    STATUS, RP0

LOOP1    MOVLW  0xFF
         MOVWF  PORTB
         CALL   DELAY
         CLRF   PORTB
         CALL   DELAY
         GOTO   LOOP1
		 		
DELAY    CLRF   COUNTER1
         CLRF   COUNTER2
         MOVLW  D'26'
         MOVWF  COUNTER3

LOOP2    DECFSZ COUNTER1,1
         GOTO   LOOP2
         DECFSZ COUNTER2,1
         GOTO   LOOP2
         DECFSZ COUNTER3,1
         GOTO   LOOP2  
         RETURN
  
END
Can you please help me find the problem?
Thanks!
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,077
Helped
4,055
Reputation
8,110
Reaction score
3,970
Trophy points
113
Activity points
119,292
Hi,

No error description, no help...

Just a part of code, and you want us to find out what controller you use, what clock frequency, what schematic you use...

We need a crystal ball!

Klaus
 

Easyrider83

Advanced Member level 5
Joined
Oct 11, 2011
Messages
1,608
Helped
373
Reputation
746
Reaction score
361
Trophy points
1,363
Location
Tallinn, Estonia
Activity points
8,577
Should work. Possible some schematic issue. Crystal malfunction/capacitors wrong value. No idea. I can't explain why he using assembler with 20 years old microcontrolller. May be he just a history lover?
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
Trophy points
1,393
Activity points
0
Zip and post the complete MPLAB project files for testing. WDT enabled ? CONFIG bits set in IDE ? MCLR enabled in IDE ? If yes, you have 10k pullup on MCLR pin ?
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top