PDA

View Full Version : Simple doubt PIC16F505



leonel
- 4th December 2006, 16:29
Hi.
I'm using 16F505 and i want to put RC5 as an output. In datasheet says that it has dual purpose RC5/TOCKI.
Even if i put TRISC to use as an output it cannot drive my led. I think TOCKI overwrite my TRISC and i cannot drive my led.

What's happen?

Bruce
- 4th December 2006, 17:21
Clear OPTION_REG bit 5.

leonel
- 4th December 2006, 17:26
yes, but what's the instruction to clear in option_reg<5>
clear ?

Bruce
- 4th December 2006, 17:33
Option_reg.5 = 0

leonel
- 4th December 2006, 17:41
Thank you.

leonel
- 4th December 2006, 17:51
Sorry but another questions concerning PIC16F505.
When i drive my relay it seems my PIC reset's, because it goes to my programs beginning.
I already put my "master clear enable" to internal and external and nothing. What i can do in software without change my hardware.
I already had a similar problem in pic16F872 and i resolved putting a 10uF capacitor near my +5V.
There are other without changemy hardware?

sayzer
- 4th December 2006, 18:02
On software side, you can play with BOD_OFF / BOD_ON,

and also WDT_OFF / WDT_ON


I suggest that you go one by one so you will know which one works for you.


---------------------

leonel
- 4th December 2006, 18:28
I tried but i think it's not working.
But i'll try more... If you remember another way to do it???

Ron Marcus
- 4th December 2006, 19:34
How much current is the relay drawing? Do you have a protection diode across it?

Ron

leonel
- 6th December 2006, 08:33
Yes i have a protection relay diode.
I resolved my problem by hardware, i put a 10uF capacitor between +5V and GND. It's possible to resolve this with software? My doubt continues...
What i dont understand is with PIC16F505 i have reset problems and with PIC16C505 i don't.
I saw datasheets i didn't see anything relevant different.

Maybe PIC16Fxxx is more sensitive to turn on relay than PIC16Cxxx!!???

Archangel
- 7th December 2006, 08:29
On software side, you can play with <font color=green>BOD_OFF</font color>
Hi leonel, check what sayzer said here.
When your relay pulls, in the input voltage drops and the PIC likely reboots due to brown out reset fuse set on, the capacitor helps supply that inrush current and prevents the brown out reset.
JS