Bonjour, j'ai essayé de compter les fronts montants à partir de la broche ND_PFI_3 sur laquelle j'ai injecté un signal TTL, mais je ne sais pas comment spécifier sur quelle période je souhaite compter.
Mon programme de comptage est le suivant :
GPCTR_Control (1, ND_COUNTER_1, ND_RESET);
//Selects the application for which you use the general-purpose counter.
GPCTR_Set_Application(1, ND_COUNTER_1,ND_SIMPLE_EVENT_CNT);
GPCTR_Change_Parameter(1, ND_COUNTER_1, ND_SOURCE, ND_PFI_3);
GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_SOURCE_POLARITY,
ND_LOW_TO_HIGH);
GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_INITIAL_COUNT, 0);
GPCTR_Control(1,ND_COUNTER_1, ND_PROGRAM);
GPCTR_Watch(1,ND_COUNTER_1, ND_COUNT, &compteur);
printf("le compteur compte %d \n",compteur);
GPCTR_Control (1, ND_COUNTER_1, ND_RESET);
Merci si on pouvait m'aider, surtout me dire quelle fonction utiliser pour préciser la période de comptage d'un simple signal carré.
je pense qu'il faudtrait que j'utilise les fonctions
GPCTR_Change_Parameter (1, ND_COUNTER_0, ND_GATE, ND_IN_START_TRIGGER);
et
GPCTR_Change_Parameter (1, ND_COUNTER_0, ND_GATE, ND_IN_STOP_TRIGGER);
mais je ne sais pas comment configuer les start et stop , car quand j'essaie ils me disent "invalid action"......
Merci par avance.