5213 EVB GPT Pulse accumulator in gated time mode ¿?

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

5213 EVB GPT Pulse accumulator in gated time mode ¿?

2,233 Views
Yukino
Contributor I
Hi, i'm using the 5213EVB. My question is about the pulse accumulator in gated time mode. I already configured the correct registers for that use but my counter (PACNT) never runs eventhoug that is enabled...??:smileysad:
I tried using the PACLK but didn't work, then tried with prescaler CLK....but it's useless.
I put the input signal in channel 3...
 
any ideas someone please?:smileywink:
 
bye:smileytongue:
Labels (1)
0 Kudos
2 Replies

280 Views
SimonMarsden_de
Contributor II
Hi

In Gated Time mode, the pulse accumulator will increment once for each clock while the pulse accumulator input pin is being driven to the programmed level.

However, the input pin is shared with other modules (e.g. the PWM). One possibility is that the input signal is not reaching the GPT because you don't have the pin assignment information set up correctly.

Have you checked that you are programming the correct value into the Port TA pin assignment register, e.g.

    /* Pin assignments for port TA
           Pin TA3 : General purpose timer GPT3
           Pin TA2 : General purpose timer GPT2
           Pin TA1 : General purpose timer GPT1
           Pin TA0 : General purpose timer GPT0
    */
    MCF_GPIO_DDRTA = 0;
    MCF_GPIO_PTAPAR = MCF_GPIO_PTAPAR_PTAPAR3(0x1) |
                      MCF_GPIO_PTAPAR_PTAPAR2(0x1) |
                      MCF_GPIO_PTAPAR_PTAPAR1(0x1) |
                      MCF_GPIO_PTAPAR_PTAPAR0(0x1);


Just a thought. Hope it helps.


Simon
0 Kudos

280 Views
Yukino
Contributor I
Thanks for help Simon! but i'm afraid that is not the problem, because I only want to configure channel 3 so I have:
MCF_GPIO_PTAPAR |= 0x40 ;     (as you told me :smileywink: using channel 3's primary function ). MCF_GPIO_DDRTA &= ~MCF_GPIO_DDRTA_DDRTA3;
 
 And the counter is still stopped...
 
I have configured the PAIF (Pulse Accumulator Input Flag) to use Interruptions and that do works!. So, I assume that the input signal is correctly configured...
 
I think that the problem may be the clock...
 
Which one is correct to use:
 
    -MCF_GPTA_GTPACTL_CLK_GPTPR; (Using the prescaler clock)
or -MCF_GPTA_GTPACTL_CLK_PACLK;   ??
 
(but I've tried both..:smileysad: )....
 
or I need an external clock???
 
Thnx, bye!
 
 
 
0 Kudos