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.

urgent please help....I couldn't light up some LEDs

Status
Not open for further replies.

ali shaheen

Junior Member level 1
Joined
Aug 29, 2010
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
pakistan, karachi
Activity points
1,419
hello

i had made the JDM programmer by my self:),I got the schematic of that from the below given link.



I am using MPLAB for programming and PICpgm for burning the PIC18f452 microcontroller.

i am using 10mhz crystal osc with 22pf of parallel capacitors...a 5v power supply driven from a 9v battery and then lm7805....my basic code for only flashing the led from portB is given below

Code:
[SIZE="2"];;SIMPLE led FLASHER
;;USING BIT SET AND BIT CLEAR ((BSF,,BCF)...
#INCLUDE<P18F452.INC>
ORG 100H


V1 EQU 25H;
V2 EQU 35H;
R2 EQU 15H;
R3 EQU 20H;
R4 EQU 22H;

LOOP 
CLRF TRISB;
BSF PORTB,0;
CALL DELAY;
BSF PORTB,1;
CALL DELAY;
BSF PORTB,2;
CALL DELAY;
BSF PORTB,3;
CALL DELAY;
BSF PORTB,4;
CALL DELAY;
BSF PORTB,5;
CALL DELAY;
BSF PORTB,6;
CALL DELAY;
BCF PORTB,5
CALL DELAY;
BCF PORTB,4
CALL DELAY;
BCF PORTB,3
CALL DELAY;
BCF PORTB,2
CALL DELAY;
BCF PORTB,1
CALL DELAY;
BCF PORTB,0
CALL DELAY;

GOTO LOOP;
DELAY
;DELAY 20*100*250*5*400ns=1,000,000,000 ns = 1,000,000 us = 1s
MOVLW D'20';
MOVWF R4;
BACK MOVLW D'100';
MOVWF R3
AGAIN MOVLW D'250'
MOVWF R2
THERE NOP
NOP
DECF R2,F
BNZ THERE 
DECF R3,F
BNZ AGAIN
DECF R4,F
BNZ BACK
RETURN


END [/SIZE]
the problem I am getting is that the LEDs are not flashing as i want them to...instead they are not turning on either..:confused:.from any of the ports....in configuration bits i had disabled watchdog timer,used HS osc type,.

please let me know what is the problem with it...either its the programmer or the code.......plaese please help me......am really in a hell lot of trouble.:(

best regards
ali shaheen

---------- Post added at 01:46 ---------- Previous post was at 01:45 ----------

**broken link removed**

---------- Post added at 01:51 ---------- Previous post was at 01:46 ----------

**broken link removed**
this is the link of the JDM programmer
 

Have you checked the polarity of the LEDs?
 
Last edited:

yes i had double checked it but , there is no voltage at the defined output pins
please if you can would you please send me a simple led flasher code and schematics...it wld be so helpful for me.
thnx
best regards
ali shaheen
 

You can debug the program by modifying your code.
1) Firstly, did you configure the pins as outputs. This is really important. Because the same pins will be used as both outputs and inputs. So you need to configure the pins as outputs. So that they can source current. And taking care of active high and active low signals.
2) Instead of lighting a series of LEDs, just try to output a logic high on one of the output pin. And measure the output voltage, it should be 5V. If the output voltage is 5V, then for sure you flash the LED with logic high and logic low outputs at a particular frequency.

Hope this helps.

-sv
 

the problem was this that i was not selecting the related banks of the regiters i.e sfr and general purpose register......now it worked fine .....thnx to everybody..... *** BLESS YOU ALL.................

regards
ali shaheen
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top