View previous topic :: View next topic |
Author |
Message |
rikky_japp Guest
|
2 very simple questions on the pic.. |
Posted: Fri May 01, 2009 2:33 am |
|
|
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 ) |
|
|
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Fri May 01, 2009 5:49 am |
|
|
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
|
|
Posted: Sat May 02, 2009 11:26 pm |
|
|
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
|
|
Posted: Sun May 03, 2009 2:08 am |
|
|
>>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
|
|
Posted: Tue May 05, 2009 2:10 am |
|
|
Use a relay, the pic can turn it on and off which will produce your short. |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Tue May 05, 2009 5:45 am |
|
|
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.
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. |
|
|
|