CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Switching off the PIC16F84A?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

Switching off the PIC16F84A?
PostPosted: Fri Dec 09, 2005 5:28 am     Reply with quote

Hi

I have 2 PICs connected and what I would like to do is to set a pin H and activate the 2nd PIC. Then I would like to set the pin L and deactivate the 2nd PIC.

I have tried to do this by connecting the pin to the MCLR of the 2nd PIC. What I find is that PIC 2 does its own thing. Sometimes it just switches on when there is a general power up and the pin is on L. Other times it works fine. Then when my pin goes L (on the MCLR of pic #2) nothing happens- the 2nd pic keeps on functioning (LED's do not switch off).

Can someone please help me?

Thank you in advance.
a.
Ttelmah
Guest







PostPosted: Fri Dec 09, 2005 5:52 am     Reply with quote

The only way to physically turn the chip 'off', would be to disable it's supply (MOSFET feeding the supply rail, controlled by the other PIC). However you could get almost the same effect, by putting the chip to sleep in the right way. Basically connect your signal to the interrupt input. Then when the interrupt is seen, have the PIC invert the interrupt 'level' to which it will respond, clear the interrupt flag, turn off all the peripheral pins, and execute a sleep instruction. This will then stop the oscillator, and the chip will be asleep. When the pin changes again, the interrupt flag will be set, the chip will wake up, and you would then need to reset all the lines to the state they were in before you went to sleep, and carry on in the main program.

Best Wishes
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Fri Dec 09, 2005 6:17 am     Reply with quote

Hi Ttelmah

I have been trying to use the 4066 quad bilateral switch. Where Pic #1 controls the on/ off of 4066.
This does not seem to work either.

I have a RS232 line comming out of pic #2. Can this line somehow power pic #2?

This problem is really tough for me!

Thank you
a.
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Fri Dec 09, 2005 6:20 am     Reply with quote

Also what exaclty does MCLR actually do?

If I drive MCLR low will this switch off the chip?

a.
Ttelmah
Guest







PostPosted: Fri Dec 09, 2005 9:19 am     Reply with quote

First of all, a 4066, has a relatively high 'on' resistance. A lot is going to depend on what load is on your PIC, but whan it starts, if it has an oscillator present, the load is going to be noticeable. Also you talk about driving LED's, and this implies significant current. Better to use something with rather more drive capability (even a PIC's output itself, is better than this...).
The behaviour of MCLR depends on what PIC is involved. Generally, the oscillator stops, and outputs may change to inputs, but I have found that on many PICs, they will stay driven, until MCLR releases.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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