Hi all,
Im verry close to finishing my project. But now I have some trouble to get things working.
I have made a little board with two transistor that drive a LED and FAN.
LED simulates the night/day cycle and I control it with a PWM signal the same for the FAN.
The PWM signal is:
frequency: 46.875 KHz
and a period time of 21.3 uSec.
The transistor(s) can handle this switching frequency, but thats not my problem.
When I connect this all to port C this is where CCP1/2 is located on my LCD the time shows as follow 45:85 45/25/165
when I enter a new time and date nothing changes.
When I disconect the tranistors on port C the Time shows correct. I dont know if this is a timing issue (sound like it does) I dont know.
Maybe some one can take a look at it for me.
Regards Jordy
PWM and RTC DS1307 going haywire????
Moderator: Benj
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
PWM and RTC DS1307 going haywire????
- Attachments
-
- Aquarium Controller Version 011-a00 PIC18F4455A.fcf
- (182.68 KiB) Downloaded 255 times
the will to learn, should not be stopped by any price
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: PWM and RTC DS1307 going haywire????
Guys, quick update,
situation:
My FAN was turned on with PWM Dcycle @ 1023 (100%) display going crazy.
I was going to bed so I turned the FAN of with Dcycle @ 0 (0%) display shows normal time and date value, my LED (PWM) regulates fine.
Seems to me like abracadabra whats going on...?
Hope somebody has any ideas ?
Regards Jordy
situation:
My FAN was turned on with PWM Dcycle @ 1023 (100%) display going crazy.
I was going to bed so I turned the FAN of with Dcycle @ 0 (0%) display shows normal time and date value, my LED (PWM) regulates fine.
Seems to me like abracadabra whats going on...?
Hope somebody has any ideas ?
Regards Jordy
the will to learn, should not be stopped by any price
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PWM and RTC DS1307 going haywire????
Hello,
If the program runs fine without the PWM outputs connected then I would assume there is something fundamentally wrong with your circuit. The PWM is just an output so the chip does not know if anything is connected to it or not. This means that something is going wrong when you connect up your port C outputs.
Do you have base resistors on your transistors?
Do you have a fairly large capacitor across your power rails to ensure the motor is not eating all of the available current and browning out the microcontroller? Similarly do you have decoupling 100nF caps on your supply rails?
If the program runs fine without the PWM outputs connected then I would assume there is something fundamentally wrong with your circuit. The PWM is just an output so the chip does not know if anything is connected to it or not. This means that something is going wrong when you connect up your port C outputs.
Do you have base resistors on your transistors?
Do you have a fairly large capacitor across your power rails to ensure the motor is not eating all of the available current and browning out the microcontroller? Similarly do you have decoupling 100nF caps on your supply rails?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: PWM and RTC DS1307 going haywire????
Hi Ben thanks for you reply,
When the fan Turned on the voltage droped below the tricker point of the PICs brownout.
So I fixed it whit a cap and some resistors.
It works fine now.
Regards Jordy
When the fan Turned on the voltage droped below the tricker point of the PICs brownout.
So I fixed it whit a cap and some resistors.
It works fine now.
Regards Jordy
the will to learn, should not be stopped by any price