Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Best practice for accurate square wave generation?

$
0
0

I have a MSP430F2619 HT CPU with an external 10Mhz clock. Using CCS.

I want to output the most accurate square wave as possible onto P.4.0/TB0. My output signal range will be in between 0 - 3 KHz.

I have Timer A in use reading the frequncy of square waves coming in. I will later scale that input frequency read from Timer A in software (linearize a rotar) then output a scaled freq onto P.4.0.  I am reading frequency very accurately from my input (< .01 % error) so I would like to be able to acheive similar accuracy on my output ... (.1% or lower is OK).

I only mention the input capture as this means I only have the B timer remaining for my pulse out.

My requirements are that I need the output to be continuous without any "glitching" of the pulse out when I change to a new freq. Basically I keep the output running always then change the square wave freq output "on the fly". My output should be as near to 50/50 duty cycle as possible. Of course latency from calculating my output freq is expected, so I know lag on the output freq change will occur.

I understand that PWM is usually for modulating, but if I just setup to PWM with 50/50 out and only change the PWM period "on the fly"is this OK ... or should I just set up the B timer and not enable PWM?  Changing PWM period on the fly looked like an easy "cheat", but I need the most accurate output as possible.

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>