|
|
View previous topic :: View next topic |
Author |
Message |
Kit Guest
|
how long we have 2 wait to power up PIC aft shutting down it |
Posted: Mon Aug 01, 2005 8:29 pm |
|
|
Hi,
When i turn the power supply off, I have to wait for 4 seconds before start turn on the power supply. I have set the PIN_A1 as a LED. and i monitor the feedback from PIC using rs232. If i turn it on straightly aft turn off, LED wont lit up, and no output to the screen. So I have to wait for 4 seconds. even 2 seconds wont work.
My question is, how to turn on shortly after turn off (4 seconds is taking too long)? if my set-up done wrongly? Do I have to change the NOMCLR to MCLR? change the capacitor? or change the resonator?
I am using PIC16f628A, using 8Mhz Resonator (3 pins). I use a ceramic capacitor (labeled as 104) at the vdd.
My configuration bit is
Code: | #include <16F628A.h>
#use delay(clock=8000000)
#fuses NOWDT,HS, NOBROWNOUT, NOMCLR, NOLVP
#use rs232(baud=9600,xmit=PIN_A4,rcv=PIN_A5)
void main()
{
setup_counters(RTCC_INTERNAL,RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
output_high(PIN_A1);
printf("\r\nSTART!\r\n");
|
|
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Aug 02, 2005 1:18 am |
|
|
I suggest you read the Microchip Application Note AN607, �Power-up Trouble Shooting�.
Four seconds is a long time, very likely there are some capacitors in your circuit keeping the voltage high. First thing that comes to mind is to change NOBROWNOUT to BROWNOUT, this will ensure the processor gets a proper reset on the voltage supply going low. Also add the PUT fuse, it will make starting up a little bit slower but way more stable. |
|
|
Kit Guest
|
|
Posted: Tue Aug 02, 2005 8:11 am |
|
|
Thanks for your reply
The reason i use NoBrownout is because I use the PIC in 3.3V condition, where if I use Brownout, then the chip wont work
I will try to use PUT to see anything changes or not |
|
|
Steve H Guest
|
|
Posted: Tue Aug 02, 2005 9:13 am |
|
|
I've had these problems in the past also that were solved by being more careful with the reset pin MCLR. The usual R/C delay works OK but you have to make sure that this C gets discharged quickly. The usual method of doing this is to put a diode across the R so that the C can discharge quickly when the power supply rail goes low.
A much more reliable way to do this is to use a voltage regulator with a power on reset circuit - tie the power on reset pin to MCLR. Maxim, Analog Devices, TI (perhaps Microchip, but I don't recall) all make these types of chips and they don't cost much more than a regulator itself. I've never had a problem when using one of these.
Here is a schematic showing how to use a D/R/C circuit work well with MCLR
http://www.geocities.com/hagtronics/thermometer.pdf
HTH- Steve H. |
|
|
MikeValencia
Joined: 04 Aug 2004 Posts: 238 Location: Chicago
|
|
Posted: Tue Aug 02, 2005 9:31 am |
|
|
Steve, i once had noise problems causing glitches on MCLR, so I put a resistor and capacitor to quiet it down. I tried putting the diode according to the PIC datasheet's recommended power-up circuit, similiar to yours, and it rendered my ICSP programming unusable.
Do you have any problems with ICD-2 programming of a chip when this diode is in? I took out the diode, and it worked fine.
For anyone else reading, have you guys experienced your ISCP programmability getting disrupted when the diode from MCLR to VDD is placed in?
-Mike |
|
|
Steve H Guest
|
|
Posted: Fri Aug 05, 2005 10:47 am |
|
|
I don't use ICD, so you identified a problem that I haven't yet found. The diode is needed to get the charge out of the cap when the power is turned off or you won't get a good restart. In production circuits I nearly always use a IC reset circuit because it's cheap and I never have problems with them. I think MicroChip has some ICD circuits in app notes that show how to use ICD and reset configurations that work.
Thanks for the heads up.
Steve Hageman |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|