FPM(Frequency Pulse Measurement) Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FPM(Frequency Pulse Measurement) Problem

527 Views
youngguekim
Contributor III

I am using etpu_FPM to get a freq for 4 channel

 

with AN2859SW,  I can use a function < fs_etpu_fpm_get_freq >

but i came to get a wrong freq at first time. when There is no input.

 

For example, I want to put freq values into variable "FREQ "

although I initialize variable "FREQ " at first time, but then. variable "FREQ " is full of unusual value (When No input)

but if input is nomal, variable "FREQ " come to be full of nomal values

 

I think it is problem about initialization of ram

 

Here is My code.. Thank you. <fs_etpu_fpm_get_freq(), fs_etpu_init() > are same as AN2859SW

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

uint16_t FREQ;

 

fs_etpu_init( my_etpu_config, (uint32_t *)etpu_code, sizeof(etpu_code),

                (uint32_t *)etpu_globals, sizeof(etpu_globals));

 

err_code = fs_etpu_fpm_init (16,/* engine: A; channel: 16 */
                               FS_ETPU_PRIORITY_MIDDLE,/* priority: Middle */
                               FS_ETPU_FPM_CONTINUOUS,/* mode: FS_ETPU_FPM_SINGLE_SHOT */
                               FS_ETPU_FPM_RISING_EDGE,/* edge: FS_ETPU_FPM_RISING_EDGE */
                               FS_ETPU_TCR1,/* timebase: TCR1 */
                               1200000);/* window_size: 1200000 */

  if (err_code != 0)

return (16 + 1);

 

 

FREQ = fs_etpu_fpm_get_freq(16, 150000000);

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Labels (1)
0 Kudos
Reply
0 Replies