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.

pic16f84 port A4 problem

Status
Not open for further replies.

shahrol_hisham

Advanced Member level 4
Joined
Aug 1, 2002
Messages
111
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
malaysia
Activity points
869
Hi i have write a program for this mc when i set the ra4 port it only set for a while only after that it reset back. i have used pull up resister but the efect is same can some one help me.
 

you can also check if the watchdog is enabled.... it will reset your micro each time a timeout occurs...
 

Also, have in mind that port A4 is an open collector and it needs a pull-up resistor. Otherwise it cannot drive a load to high levels.
 

Configure several or all pins as digital inputs

bcf STATUS, RP0
bsf STATUS, RP0

movlw 0x06
movwf ADCON1

bcf TRISA, RA4 ; Set RA4 as output
 

bzx said:
movlw 0x06
movwf ADCON1

PIC 16F84 does not have an ADC and register ADCON1 is not implemented ...

best regards
 

Make sure your Timer0 is disabled when you are not using it.
 

I used the timer 0 as real time counter. so it cannot disable. It is posible that timer0 can interrupt the ra4 function ? if yes how can i solve this problem.
 

Hi,

shahrol_hisham said:
I used the timer 0 as real time counter. so it cannot disable. It is posible that timer0 can interrupt the ra4 function ? if yes how can i solve this problem.

Be sure that your TMR0 is set correctly. Re-Check that in the OPTION_REG REGISTER (ADDRESS 81h) Bit 5, TOCS is set to 0 ( Zero ).
If you dont, then the program will reset you bit back to input when tyou set this register back to default.

Good luck.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top