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

2 very simple questions on the pic..

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







2 very simple questions on the pic..
PostPosted: Fri May 01, 2009 2:33 am     Reply with quote

hi

i have 2 simple questions on the pic16f690 that came with pickit2.
hope you can help

1. what code i can use to short between 2 pins of the chip??
i need to short 2 pins without using any FET transistor. grounding them?

2. how can i eliminate a pwm function for a while and then turn it on again?
what are the 2 operations to start and stop pwm (after the i define the
code of the frequency and the duty) ? i need the line to start and stop
it.

thanks Smile)
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Fri May 01, 2009 5:49 am     Reply with quote

They may not be that simple to answer.

1. This all depends, you cannot "short" the 2 pins but you may be able to emulate a short. If they are digital and one pin is driven by the external hardware and you just need the other pin to match then read the first pin and output the level to the second pin.

If it is indeed a short you need so either side can drive the line then you have a problem.

2. This again depends on what state you want the PWM pin to be in when it is in the stopped state. The simple option is to either set the duty to full on of full off. The other option is to change the configuration for the pin from pwm to IO.

Is this homework or required for a school/university project you are working on ? It looks like it might be.

If you are upfront about it then you may get more help.
rikky
Guest







PostPosted: Sat May 02, 2009 11:26 pm     Reply with quote

My goal was to short between 2 external points, don't care how, just need to short them (to turn off a regulator for control).

This is a project in university, its not a simple one but I found my self deal with this simple question.


Do you know any good book that contains all the CCS C operations? To download for free ??
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

PostPosted: Sun May 03, 2009 2:08 am     Reply with quote

>>Do you know any good book that contains all the CCS C operations? To download for free ??
You can get the CCS Compiler Manual: go to http://ccsinfo.com/downloads.php and scroll to "Current Compiler Manuals"
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Tue May 05, 2009 2:10 am     Reply with quote

Use a relay, the pic can turn it on and off which will produce your short.
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Tue May 05, 2009 5:45 am     Reply with quote

rikky wrote:
My goal was to short between 2 external points, don't care how, just need to short them (to turn off a regulator for control).

Can you elaborate the short between 2 pins. Is it a simple switch action or something else.

If this is a switch action and things have to be electricaly seperated, then use relay. If electrical seperation is not necessary then you could use Mosfet. Wink

PWM duty can be turned to 0 so there would be no outgoing pulse. Or you could change pin function from output to input, that would be another way.
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