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

pic16f876 help plzzzzzzzzzzzzzzzzzzzzzzzz

Status
Not open for further replies.

suwaii

Member level 4
Joined
Jan 21, 2006
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,830
I PROGRAMM PIC16F876 BY JDM PROGRAMMER AND I Successful in that

the programme is to make porta and portc have vlue=5f and i connect MCLR/Vpp to +5V and ocs1 & ocs2 to crystal 4MHZ with 2 capacitor 22pf

and Vss(pin#8 &pin#19 to GND and pin#20 to +5V


but i do not get any thing

what is the problem why porta and portc is not have value "5f"

i try to use RC ocsillator R=5k and C=22pf still the same any one tell why and

how can we do that
 

klug

Advanced Member level 1
Joined
Jul 4, 2002
Messages
476
Helped
12
Reputation
24
Reaction score
7
Trophy points
1,298
Activity points
4,382
Try to play with CONFIGURATION WORD in your program/programmer.

You need to set:

HS - for oscillator.
BOR disabled.
WDT - disabled.

Connect your crystal and capacitors. Next, you need to look by oscilloscope to pin 10 (OSCOUT) there must be some oscillation (0.3 - 1.0 V).
 

suwaii

Member level 4
Joined
Jan 21, 2006
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,830
still i do not get any thing ....may be the problem from code can any one tell me what is the problem of the code :

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

LIST p=16f876, R=DEC

#include "p16f876.inc"



org 0

movlw 0x00
movwf TRISB
movwf TRISA
movwf TRISC

movlw 0x0F
movwf PORTA
movwf PORTB
movwf PORTC
circle goto circle

end


i convert this programme to hex using MPASM then i test it by pic16simulator i get

PORTA,PORTB,PORTC =0F

and i use again jdm circuit and ic-prog to programe the pic and i successful in the that but when i test my pic with 4mhz crystal and Vpp/mclr=+5v i do not get any thing pleas help me:D
 

waseem

Full Member level 5
Joined
Apr 13, 2005
Messages
283
Helped
63
Reputation
126
Reaction score
18
Trophy points
1,298
Location
Pakistan
Activity points
3,669
Hi!
Well the problem is obvious, you are not switching the banks.The registers in PIC Microcontrollers are banked try to compile this

LIST p=16f876, R=DEC

#include "p16f876.inc"



org 0x00

bsf STATUS,RP0
MOVLW H'06' ;porta all digital io
MOVWF ADCON1
movlw 0x00
movwf TRISB
movwf TRISA
movwf TRISC
bcf STATUS,RP0
movlw 0x0F
movwf PORTA
movwf PORTB
movwf PORTC
circle goto circle

end

in addition to this also be careful about the fuse settings.
one more point is that porta is also the analog input port therefore it is necessary to configure it for digital input/output by writing to the ACON1 register.

Best of Luck
Regards.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top