Pic12F617 PWM not working
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Pic12F617 PWM not working
Hi I am trying to use Pwm on a pic12F617
The Program works in Flowcode but not on real hardware.
Bit banging works but when I try to use PWM it seems the chip is dead.
When Programming with Pic kit 2 it gives an error message. It comes on for such a short time that I can only read the first words:
It says something about configuration.
I have attached the program.
Best Regards:
Uli
The Program works in Flowcode but not on real hardware.
Bit banging works but when I try to use PWM it seems the chip is dead.
When Programming with Pic kit 2 it gives an error message. It comes on for such a short time that I can only read the first words:
It says something about configuration.
I have attached the program.
Best Regards:
Uli
- Attachments
-
- Soft on off switch..fcf
- (23.03 KiB) Downloaded 409 times
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
First of all I want to ask you have you noticed the following Benj post about minor correction of bugs...
http://www.matrixmultimedia.com/mmforum ... 46&t=10669
If you already did that...please let me know..By this time I am having a look at your code..
Enamul
First of all I want to ask you have you noticed the following Benj post about minor correction of bugs...
http://www.matrixmultimedia.com/mmforum ... 46&t=10669
If you already did that...please let me know..By this time I am having a look at your code..
Enamul
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Pic12F617 PWM not working
Hi Uli,
One reason why your PWM is not working is because you have got timer0 to interrupt on: T0CKI
You should change the interrupt properties to interrupt on internal clock.
Another reason is none of of your configurations have be set (hence your error message).
Take a look here:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936
Martin
One reason why your PWM is not working is because you have got timer0 to interrupt on: T0CKI
You should change the interrupt properties to interrupt on internal clock.
Another reason is none of of your configurations have be set (hence your error message).
Take a look here:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936
Martin
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Pic12F617 PWM not working
Try attached version.
If hardware does not work, its always a good idea to set up a 1Hz flasher.
I.e
Do:
A0=1
Delay 500ms
A0=0
Delay 500ms
Loop while 1
If hardware does not work, its always a good idea to set up a 1Hz flasher.
I.e
Do:
A0=1
Delay 500ms
A0=0
Delay 500ms
Loop while 1
- Attachments
-
- Soft on off switch with config set..fcf
- (23.07 KiB) Downloaded 377 times
Martin
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
First of all thanks to Martin.. I don't need to look at the program as Boss already noticed that.
I have attached here some of the bit to make it meaningful as some of variable initialization missing..and also as Martin said set config..
Although I think if Uli can say what is your circuit goal we can help you more.
Enamul
First of all thanks to Martin.. I don't need to look at the program as Boss already noticed that.
I have attached here some of the bit to make it meaningful as some of variable initialization missing..and also as Martin said set config..
Although I think if Uli can say what is your circuit goal we can help you more.
Enamul
- Attachments
-
- PWM_617.fcf
- (19.64 KiB) Downloaded 363 times
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Hi to all,
Thanks for your Quick replies.
I was a bit ignorant.
In Flowcode 5 initially I could not find the Chip Settings because it is in a different place than on Flowcode 4 so I assumed there are no settings for this chip.
Now I found where it is and put the settings in.
I can also see that I did not set the Interrupt correctly.
Thanks for your help after reading Martins reply it only took five minutes to get everything running.
Of course the code I submitted is incomplete.
What I want to make is a smart spotlight relay for my car.
The PWM is to switch the spotlights slowly. Also I want to add an ADC to measure the supply voltage when the engine is off and the voltage is below a certain threshold it will turn off the spotlights automatically. Then a buzzer should sound to warn me to turn the lights off.
I have a piezo buzzer that is rated at 3 volts max voltage is 30 volt. It has no driver circuit and needs bit banging.
Can this buzzer be used or do I need to get one that is rated at 5 Volt?
Best Regards:
Uli
Thanks for your Quick replies.
I was a bit ignorant.
In Flowcode 5 initially I could not find the Chip Settings because it is in a different place than on Flowcode 4 so I assumed there are no settings for this chip.
Now I found where it is and put the settings in.
I can also see that I did not set the Interrupt correctly.
Thanks for your help after reading Martins reply it only took five minutes to get everything running.
Of course the code I submitted is incomplete.
What I want to make is a smart spotlight relay for my car.
The PWM is to switch the spotlights slowly. Also I want to add an ADC to measure the supply voltage when the engine is off and the voltage is below a certain threshold it will turn off the spotlights automatically. Then a buzzer should sound to warn me to turn the lights off.
I have a piezo buzzer that is rated at 3 volts max voltage is 30 volt. It has no driver circuit and needs bit banging.
Can this buzzer be used or do I need to get one that is rated at 5 Volt?
Best Regards:
Uli
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Pic12F617 PWM not working
Gald your up and running now
As for piezo driver, you could try here:
http://www.matrixmultimedia.com/mmforum ... 30&#p24726
Martin
As for piezo driver, you could try here:
http://www.matrixmultimedia.com/mmforum ... 30&#p24726
Martin
Martin
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi Uli,
I have completely modified your code to suit your requirement you have said..
As you have to send 2-5 KHz pulse to buzzer drive circuit to make an alert..I have used TMR0 timer to produce 3.9KHz pulse in RA1which can be used to drive buzzer..
If you want to change freq, you have to change the pre-scaler rate in TMR0 properties...In this mode it also checks voltage; if voltage increases higher than threshold it jumps to light control mode..
RA1>10Kohm>Base of BC547..Emitter>GND..+5V to (+ve) end of buzzer..(-ve) end of buzzer to collector..
Hope this will help
Enamul
I have completely modified your code to suit your requirement you have said..
I have divided the program into two sections where one part deals with PWM to switch the spotlights slowly...I put here 1ms delay but you can change that to make switching speed fast or slow..The PWM is to switch the spotlights slowly.
In this mode what you need just to check whether voltage drop below a threshold..here as you use 800 adc value. I keep that but you can customize according to your requirement. SO if voltage drops below that voltage the PWM module will be disabled which turns off the lights immediately.. But you also want buzzer to run to make you alert when this even occurs..Also I want to add an ADC to measure the supply voltage when the engine is off and the voltage is below a certain threshold it will turn off the spotlights automatically.
I have tested voltage every 1 s but you can change that by changing Count1 value...If voltage drops the sequence jumps to buzzer drive mode..Then a buzzer should sound to warn me to turn the lights off.
As you have to send 2-5 KHz pulse to buzzer drive circuit to make an alert..I have used TMR0 timer to produce 3.9KHz pulse in RA1which can be used to drive buzzer..
If you want to change freq, you have to change the pre-scaler rate in TMR0 properties...In this mode it also checks voltage; if voltage increases higher than threshold it jumps to light control mode..
As the max voltage is 30 volt you can drive it easily by 5V...You can't use direct drive from PIC as it can pose current rating problem..you have to use transistor to drive the buzzer..I have a piezo buzzer that is rated at 3 volts max voltage is 30 volt. It has no driver circuit and needs bit banging.
Can this buzzer be used or do I need to get one that is rated at 5 Volt?
RA1>10Kohm>Base of BC547..Emitter>GND..+5V to (+ve) end of buzzer..(-ve) end of buzzer to collector..
Hope this will help
Enamul
- Attachments
-
- NEW_PWM_617.fcf
- (20.41 KiB) Downloaded 373 times
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Thanks Enamul.
I did not expect you to finish the code for me that is very kind of you.
I am still trying to understand the code.
What does this calculation mean "Flip=Not Flip"
Does it toggle flip between "1" and "0" ?
Does a piezo sounder have a polarity?
I can not see what pin is what polarity.
I do net have a BC547 only a BC 337 or 2N7000
Which one would you recommend?
Best Regards:
Uli
I did not expect you to finish the code for me that is very kind of you.
I am still trying to understand the code.
What does this calculation mean "Flip=Not Flip"
Does it toggle flip between "1" and "0" ?
Does a piezo sounder have a polarity?
I can not see what pin is what polarity.
I do net have a BC547 only a BC 337 or 2N7000
Which one would you recommend?
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
As I have sent this data to GPIO1 bit..so when Flip = 0...GPIO1 = 0 and when NOT Flip...then GPIO1 = 1
So, you catch rightly just toggling the bit.
http://4x4icon.com/crossfire/lock_buzzer/index.htm
If you look at the pins of the buzzer you will find that not both the pins of the buzzer at same length...one is large(+ve) and other is small(-ve)..which signifies the polarity (at least those I have seen in IPS, UPS). Some of the buzzer are also non-polar..you can use any either polarity..
http://www.sdr-cube.com/construction/pi ... /piezo.JPG
Please feel free to ask me if you stack any where..
Enamul
You can see in main pg I have initialized Flip = 0...so NOT Flip makes Flip = 0xFFWhat does this calculation mean "Flip=Not Flip"
Does it toggle flip between "1" and "0" ?
As I have sent this data to GPIO1 bit..so when Flip = 0...GPIO1 = 0 and when NOT Flip...then GPIO1 = 1
So, you catch rightly just toggling the bit.
You can in the link buzzer symbol shown +ve and -Ve.Does a piezo sounder have a polarity? I can not see what pin is what polarity.
http://4x4icon.com/crossfire/lock_buzzer/index.htm
If you look at the pins of the buzzer you will find that not both the pins of the buzzer at same length...one is large(+ve) and other is small(-ve)..which signifies the polarity (at least those I have seen in IPS, UPS). Some of the buzzer are also non-polar..you can use any either polarity..
http://www.sdr-cube.com/construction/pi ... /piezo.JPG
BC 337 should be fine as the Ic max is 800 mA according to datasheet..http://www.fairchildsemi.com/ds/BC/BC337.pdfI do net have a BC547 only a BC 337 or 2N7000. Which one would you recommend?
Please feel free to ask me if you stack any where..
Enamul
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Pic12F617 PWM not working
Hi Uli,
Flowchart that drives piezo element like this one:
http://uk.rs-online.com/web/p/buzzers-sounders/6221584/
They are non polarized!
That's important since the polarity is rapidly changing so you get 10Vpk to pk from a microcontroller that's connected to a 5V supply!
10V pk to pk at its resonant frequency is enough to make the piezo element sound quiet loud, so don't get too close at first just in case.
It's important to get the hardware to run at resonant frequency of piezo element
In the example from link given its 1.2KHz
Flowchart is not designed to run the type of pizeo buzzer (or sounder) that is connected directly to a DC supply.
Martin
Flowchart that drives piezo element like this one:
http://uk.rs-online.com/web/p/buzzers-sounders/6221584/
They are non polarized!
That's important since the polarity is rapidly changing so you get 10Vpk to pk from a microcontroller that's connected to a 5V supply!
10V pk to pk at its resonant frequency is enough to make the piezo element sound quiet loud, so don't get too close at first just in case.
It's important to get the hardware to run at resonant frequency of piezo element
In the example from link given its 1.2KHz
Flowchart is not designed to run the type of pizeo buzzer (or sounder) that is connected directly to a DC supply.
Martin
Martin
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Why would you get 10 V peak?
Do you have to change the Polarity on those devices?
Or you just give pulses?
Why is the bc337 preferred over the mosfet? It is only a 17mm on board sounder from TDK I guess it uses less than 20 ma.
Best Regards:
Uli
Do you have to change the Polarity on those devices?
Or you just give pulses?
Why is the bc337 preferred over the mosfet? It is only a 17mm on board sounder from TDK I guess it uses less than 20 ma.
Best Regards:
Uli
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Pic12F617 PWM not working
This will explain how:Creative25 wrote:Why would you get 10 V peak?
http://www.matrixmultimedia.com/mmforum ... 86&#p24786
Idon't believe you have to change Polarity. Pulses should be fine. but if running a 5V volume will be quiter.Creative25 wrote: Do you have to change the Polarity on those devices?
Or you just give pulses?
I would also recommend placing a resistor say 1K8 in series with o/p and piezo element.
I dont see why is necessary to use bippolar transistor over FET, so long as FET is N channel, logic type enhancement mode MOSFET.Creative25 wrote: Why is the bc337 preferred over the mosfet? It is only a 17mm on board sounder from TDK I guess it uses less than 20 ma.
FETs are used particularly useful for higher current driving, or when low current drain from power source e.g battery is required, so long as switching frequency is low.
If using just a piezo element just like in above link, then a transistor is not necessary at all!
Martin
Martin
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
I have never said that BJT is better than FET as everybody knows that FET is high current and energy efficient device due to construction.. But for simple buzzer drive I said BJT should be fine..Even though if you want to use FET it's better.
Even though it's your choice what amount of sound you want which depends on p-p voltage I think...
So for higher voltage FET is definite to use..It's upto you now
Enamul
I have never said that BJT is better than FET as everybody knows that FET is high current and energy efficient device due to construction.. But for simple buzzer drive I said BJT should be fine..Even though if you want to use FET it's better.
If you want to drive the buzzer that Martin mentioned (as I don't know which one you have or you going to buy) you need a driving circuit which will produce less than 30 V p-p signal...but from PIC using my program you will get 0 to 5 v pp signal.. you can use BJT or FET to drive the buzzer..to make 12V p-p which I think enough to drive the buzzer..I dont see why is necessary to use bippolar transistor over FET, so long as FET is N channel, logic type enhancement mode MOSFET.Creative25 wrote: Why is the bc337 preferred over the mosfet? It is only a 17mm on board sounder from TDK I guess it uses less than 20 ma.
FETs are used particularly useful for higher current driving, or when low current drain from power source e.g battery is required, so long as switching frequency is low.
Even though it's your choice what amount of sound you want which depends on p-p voltage I think...
So for higher voltage FET is definite to use..It's upto you now
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Ok I tried the transistor cirquit.
But I can only hear the sound when I put the buzzer on my ear. Barely can be heard.
So something is wrong. I heard some people put a resistor between the to connections of the sounder.
But I can nowhere find what value resistor I should use.
It is a TDK PS1740P02E frequency 4 Mhz.
Also I would like to make the controller to run faster.
But If I try to use osccon 0x70; it gives an error message. Does this chip use different commands to set the frequency of the internal oscillator?
Best Regards:
Uli
But I can only hear the sound when I put the buzzer on my ear. Barely can be heard.
So something is wrong. I heard some people put a resistor between the to connections of the sounder.
But I can nowhere find what value resistor I should use.
It is a TDK PS1740P02E frequency 4 Mhz.
Also I would like to make the controller to run faster.
But If I try to use osccon 0x70; it gives an error message. Does this chip use different commands to set the frequency of the internal oscillator?
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi Uli,
http://www.tdk.co.jp/tefe02/ef532_ps.pdf
Enamul
So what was the peak-to-peak voltage for the buzzer you used?But I can only hear the sound when I put the buzzer on my ear. Barely can be heard.
you can put 1Kohm resistor...according to the data sheet last pageI heard some people put a resistor between the to connections of the sounder.
http://www.tdk.co.jp/tefe02/ef532_ps.pdf
I guess you want to mean 4KHz..so that could be a problem as the driving frequency was not 4KHz...I will post another program whose frequency will be close to 4Khz..It is a TDK PS1740P02E frequency 4 Mhz.
This is because, there is no OSCCON register in PIC 12f617...you have to configure clock through configuration option..Also I would like to make the controller to run faster.
But If I try to use osccon 0x70; it gives an error message. Does this chip use different commands to set the frequency of the internal oscillator?
Enamul
- Attachments
-
- 12f617.jpg (83.38 KiB) Viewed 17823 times
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Thanks,
I have looked at the datasheet several times, but only the section of the buzzer that I am using so that is why I did not see it.
I had changed the oscillator Option just like you suggested, but on the output pin I still get the same frequency on the output pin.
I drive it at 5 volt.
Could it be that it got damaged by applying ac voltage or by statics?
But then on the other hand when I disconnect the power supply the sound goes louder for a split of a second.
Best Regards:
Uli
I have looked at the datasheet several times, but only the section of the buzzer that I am using so that is why I did not see it.
I had changed the oscillator Option just like you suggested, but on the output pin I still get the same frequency on the output pin.
I drive it at 5 volt.
Could it be that it got damaged by applying ac voltage or by statics?
But then on the other hand when I disconnect the power supply the sound goes louder for a split of a second.
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
I didn't post the changed frequency yet..Do you have any oscilloscope to check the output frequency?
Have you tried to increase voltage to 12V? Have you applied ac voltage on it? What was the Vp-p of the AC?..I don't think it damaged by static..
Enamul
I have just shown there how to set internal clock..although in c code I have noticed a problem in setting 8MHz..I will sort out that..so which clock frequency you are looking for 4 MHz or 8MHz?I had changed the oscillator Option just like you suggested, but on the output pin I still get the same frequency on the output pin.
I didn't post the changed frequency yet..Do you have any oscilloscope to check the output frequency?
I drive it at 5 volt.
Could it be that it got damaged by applying ac voltage or by statics?
Have you tried to increase voltage to 12V? Have you applied ac voltage on it? What was the Vp-p of the AC?..I don't think it damaged by static..
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
Thanks for the reply.
I replaced the sounder with a new one of the same type.
And it makes a reasonable sound. So ether it was faulty, or there was a bad soldering.
I only have a digital multimeter that can check frequency.
There is no need for a new code since an oscillator speed of 8MHZ will give an Interrupt speed of 7812.5Hz which will give an Oscillation speed of 3906.25
Which is close enough according to the data sheet. If I don't get right with the Oscillator, I can still change to 12 Volt.
So now I am getting to the fun part, to play with sound pulsing and all the settings for speed of turning on and off.
Question:
Does a bulb with one meter of wire count as an inductive load. Would it be advisable to add a freewheeling diode?
I am not sure if I want it since it also will make a short if the circuit will be connected in the wrong way around, therefore the diode would need a higher current rating than the fuse on the supply so the fuse will blow first.
Best Regards:
Uli
Thanks for the reply.
I replaced the sounder with a new one of the same type.
And it makes a reasonable sound. So ether it was faulty, or there was a bad soldering.
I only have a digital multimeter that can check frequency.
There is no need for a new code since an oscillator speed of 8MHZ will give an Interrupt speed of 7812.5Hz which will give an Oscillation speed of 3906.25
Which is close enough according to the data sheet. If I don't get right with the Oscillator, I can still change to 12 Volt.
So now I am getting to the fun part, to play with sound pulsing and all the settings for speed of turning on and off.
Question:
Does a bulb with one meter of wire count as an inductive load. Would it be advisable to add a freewheeling diode?
I am not sure if I want it since it also will make a short if the circuit will be connected in the wrong way around, therefore the diode would need a higher current rating than the fuse on the supply so the fuse will blow first.
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
HI,
You are right about interrupt frequency...
What kind of bulb is that?
Enamul
You are right about interrupt frequency...
What kind of bulb is that?
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
Hi Enamul.
Thanks for the reply.
It is two 12V 55 watt bulbs.
Wire length from the fet to the bulb is about one meter.
Do i need a freewheel diode?
Best Regards:
Uli
Thanks for the reply.
It is two 12V 55 watt bulbs.
Wire length from the fet to the bulb is about one meter.
Do i need a freewheel diode?
Best Regards:
Uli
Last edited by Creative25 on Mon Jul 23, 2012 12:53 pm, edited 1 time in total.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
Did you get the following code in c code?
Here 0x3dd4 means 11110111010100 where the 7th bit should be high for 8 MHz..
I found it wrong in my last code but seems fine now..
Enamul
Did you get the following code in c code?
Code: Select all
//Configuration data
#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3dd4
#endif
#ifdef HI_TECH_C
__CONFIG(0x3dd4);
#endif
I found it wrong in my last code but seems fine now..
Enamul
-
- Posts: 323
- Joined: Tue Sep 06, 2011 2:54 am
- Has thanked: 166 times
- Been thanked: 26 times
- Contact:
Re: Pic12F617 PWM not working
No I only saw it now.
Where do I put it?
In a c code icon in the beginning of the program?
Best Regards:
Uli
Where do I put it?
In a c code icon in the beginning of the program?
Best Regards:
Uli
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
To save from reverse voltage, you can always add one 3A diode. You can connect +ve terminal of battery to Anode of diode and cathode of diode to rest of the circuit..so that if anyone connect right only then power supplies to the circuit otherwise not.
Enamul
Resistive bulb will not be considered as inductive load even though it is used with long wire. So I don't think you need free-wheeling diode but you can use one if you want.Does a bulb with one meter of wire count as an inductive load. Would it be advisable to add a freewheeling diode?
To save from reverse voltage, you can always add one 3A diode. You can connect +ve terminal of battery to Anode of diode and cathode of diode to rest of the circuit..so that if anyone connect right only then power supplies to the circuit otherwise not.
Enamul
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Pic12F617 PWM not working
Hi,
No..If you go to build tab and then click "compile to C" and then click "view C"..you will be able to see the generated c code of your flow chart..in that C code in 64th line you will get that. Check that please.
Enamul
No..If you go to build tab and then click "compile to C" and then click "view C"..you will be able to see the generated c code of your flow chart..in that C code in 64th line you will get that. Check that please.
Enamul