Issues with Timer Module, Pulse Accumulator B set to Event Counter Mode - MC9S12DP256B

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

Issues with Timer Module, Pulse Accumulator B set to Event Counter Mode - MC9S12DP256B

1,285 Views
admin
Specialist II
Hello,

I am using MC9S12DP256B. I am trying to get Pulse Accumulator A and Pulse Accumulator B working in Event Counter Mode for both A and B. I have function Generator connected to ICO0 and ICO7. Timer Registers are all default except: PACTL = 40h and PBCTL = 40h. Pulse Accumulator A works fine with this setup but Pulse Accumulator B is not counting pulses. I am not sure what I am doing wrong.

 

Also I am using Code Warrior, with what command would I be able to read PACN3 and PACN2 in one clock cycle.

 

Thanks for all the help and Happy New Year everybody.

Ulan



Labels (1)
0 Kudos
1 Reply

358 Views
kef
Specialist I
Pulse accumulators A and B are not the same. PACTL register has edge and mode select bits, while PBCTL doesn't have edge select bits. Active edge for accumulator B is selected the same as input capture edge for channel 0. So you should also set up TCTL4 register. According to ECT_16B8C Block User Guide V01.06, pulse accumulator B (like pulse accumulator A) is also independent from timer enable bit (TEN).
 
I don't know why do you want to access PACN3 and PACN2 in the same cycle. Pulse accumulator B uses concatenated 16bits register PACN1:smileytongue:ACN0.
Try writing help and hit enter in CW command window. DW command seems to be what you need.
0 Kudos