
Jonoveve
-
Content Count
5 -
Joined
-
Last visited
Posts posted by Jonoveve
-
-
Hello.
I have a quartz oscillator with fo=1.6 MHz and I have changed it features and now it band width is around 20 kHz. For this, i need to a good precision.
I am using the board msp430fr6989.
My code is the next:
#include <CounterLib_t.h> Counter<CL_TimerB0> MyCounter; //pin P2.0 void setup() { MyCounter.start(CL_Div2); // 2 pulses Serial.begin(9600); } void loop() { MyCounter.reset(); delay(1000); Serial.print((MyCounter.read()+32767.5*23)*2+32800); //32765.5 = 65535/2 **CL_Div2** //(MyCounter.read()+...)*2 **CL_Div2** //32800 manual calibrate Serial.println(" Hz"); Serial.println(cont); delay(1000); }
With this code i get:
- From frequency generator: F=1.58 MHz -> Measure with the board: F=1579589 Hz -> Error: 0.026%
- From frequency generator: F=1.6 MHz -> Measure with the board: F=1600093 Hz -> Error: 0.0058%
- From frequency generator: F=1.62 MHz -> Measure with the board: F=1620377 Hz -> Error: 0.023%
The total BW is 127000 Hz
- From 1,542 MHz with error=0.077% to 1,669 MHz with error=0,074
For my proyect is a good precision.
I put images like a sample.
-
Hello.
I need to measure a frequency from output VCO with a Timer, this frequency is between 1 MHz and 2 MHz.
Whit my other board i don't have any problem because i can use de library ''CounterLib'' for MSP430 with Energia.
Can i use any library for TivaC for use like a ''CounterLib'' with Energia?
Best Regard.
P.C.
-
You can use analogResolution() to set the PWM resolution. Note that this is tied with the analogFrequency() by default it is set to ~490 Hz (F_CPU/490).
This means that for the MSP430FR6989 running at 16 Mhz the max you can count up to is 16 MHz/490 = 32653 which is your max resolution.
e.g.
#define PWM_PIN 11 #define PWM_FREQ 490 // the default #define PWM_RES (F_CPU / PWM_FREQ) void setup() { /* set the PWM frequency */ analogFrequency(PWM_FREQ); /* set the PWM resolution */ analogResolution(PWM_RES); /* 490 Hz / 50% duty cycle on pin 11 */ analogWrite(11, PWM_RES/2); } void loop()
Thanks you very much. it was what i want.
-
Hello.
I am trying to change the output PWM resolution in my board for feed a VCO .
With enegia i can use 8 bits resolution but in the datasheet i can see that the output PWM resolution is 16 bits.
I have read this Topic http://forum.43oh.com/topic/5765-analogwrite-precision-question/ they use PWMWrite(Pin,Steps,duty cycle,Frequency) but, with msp430 it does not work.
There are any solution to increase the resolution of PWM output for msp430 like in Tiva C?
Best Regards.
P.C.
MSP430F550x based frequency meter
in General
Posted
Hello
I am working whit msp432 and trying to measure frequency like you, but i have problem with the result, i can't measure more than 32888 Hz and i don't know the problem.
Would it be possible a little help? someone can see the problem?
My code is a Energia sketch:
If i get to measure frequency before that your replies, i will share the code with everyone.
I will be working.
Thank you for all.