--
--
--
--
#include <msp430g2553.h>
void calib_clock(void);
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
calib_clock();
P1DIR |= BIT2; // P1.2 to output
P1SEL |= BIT2; // P1.2 to TA0.1
CCR0 = 125-1; // PWM Period 16KHz
CCTL1 = OUTMOD_7; // CCR1 reset/set
CCR1 = 62; // CCR1 PWM duty cycle 50% duty for 16KHz
TACTL = TASSEL_2 + MC_1; // SMCLK, up mode
while(1);
return 0;
}
void calib_clock(void)
{
int i=0;
BCSCTL1 = CALBC1_1MHZ; // Set range
for(i=0xFFFF;i>0;i--); //delay to stabilize
DCOCTL = CALDCO_1MHZ; // SMCLK = DCO = 1MHz
for(i=0xFFFF;i>0;i--); //delay to stabilize
}
with regards
Bharadwaaj RA
--
--
--
Dear Renjith,
Thank you for your reply. I am using a CRO which is working fine when i keep the probes on the calibration 2KHz oscillator built in to it. Am not worried with the deviation from the expected frequency but am worried about the oscillation in the output. I mean its not stable some times its 16.020Khz or 16.010 KHz and varies in between these values.
With regards
Bharadwaaj RAOn Wed, Dec 12, 2012 at 3:33 PM, Renjith Nair <renj...@gmail.com> wrote:
I think you can still go ahead, 10 hz variation in 16khz carrier signal will not make any difference in the final 50Hz. That is what I feel. I am interested to know, how are you measuring the frequency? is it a digital oscilloscope or CRO? or some other device ? Here the deviation is 0.06% I feel there might be some deviation in the result while measuring with a device as well .
Regards,
Renjith--On Wed, Dec 12, 2012 at 3:03 PM, bharadwaj <bhaar...@gmail.com> wrote:
Dear Renjith,
Thanks for your reply. But now am having an issue in just running a normal PWM in a stable way. The code in the previous mail is expected to give 16KHz 50% duty cycle PWM. But there is a little problem somewhere which gives me a slightly varying frequency it varies +/- 10 Hz. Any way thanks for your reply.
With regards
Bharadwaaj RA
--
--
Best Regards,Renjith
--
--
--
--
You received this message because you are subscribed to the Google Groups "Computer Club of India" group.
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi,Iam working on sine wave generator and compile your code but generated wave is not sine wave. Is it require filter? I connected capacitor at the output end but not generated purely again.Please help me.Thanks in advance.Betul
22 Mart 2013 Cuma 08:21:22 UTC+2 tarihinde bhaaradwaaj yazdı:
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubin+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Share your code.
Passion: http://sysplay.in (Playing with Systems)
Thank you for your reply. My Output is only 3.5 V DC. I compile sine code which is share above. Output pin is P1.0 , right? I am looking result using Dewesoft.I don't understand what problem is.3 Ekim 2016 Pazartesi 14:02:21 UTC+3 tarihinde Hari Krishna Malladi yazdı:
Hari Krishna Malladi
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Computer Club of India" group.
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes it requires a filter. Normal rc low pass filter will work.
Hi,Iam working on sine wave generator and compile your code but generated wave is not sine wave. Is it require filter? I connected capacitor at the output end but not generated purely again.Please help me.Thanks in advance.
Betul
22 Mart 2013 Cuma 08:21:22 UTC+2 tarihinde bhaaradwaaj yazdı:
To unsubscribe from this group and stop receiving emails from it, send an email to computerclubin+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Also if u have a oscilloscope output images it will be helpful.
But as the output is DC, i.e. 0 frequency, there is something fundamentally missing in the waveform generation itself.
Is Dewesoft like oscilloscope?
For more options, visit https://groups.google.com/d/optout.