Hi,all:
TIMER module of MC9S12XEP100 has a same function with Enhanced Capture Timer(ECT) in Input Capture and Output Compare(IOC). However external pins of TIMER (Port P[0:7]) are not in reset condition when act as IOC, as the reference manual says “a possible rerouting under software control” (please see MC9S12XEP100 Reference Manual,Table 1-8. Peripheral - Port Routing Options). Here my problem. I am so confused how can achieve my target in Code Warrior, maybe by setting some registers. Any sample routine in C is welcomed.
Solved! Go to Solution.
S12XE has two 8channel timers, TIM (port R) and ECT (port T). Also there's an 8channel PWM module (port P).
S12XE has several routing registers, which allow changing destination pins of particular peripheral modules.
MODRR allows rerouting CAN0, CAN4, SPI0, SPI1, SPI2 modules.
PTRRR allows rerouting TIM pins. Each PTRRR bit corresponds to TIM channel. PTRRRx=0 (reset default routing) makes TIMx routed to PTRx pin, PTRRRx=1 makes TIMx routed to PTPx pin.
PTLRR allows rerouting SCI4/5/6/7 modules
PTFRR allows rerouting SCI3, IIC0, and CS0/1/2/3
ECT pins are not rerouteable, only TIM pins can be routed to port P or to port R.
Table 1-8 Peripheral - Port Routing Options in S12XE reference manual doesn't include any option for ECT, only for TIM (port R / port P)
In Table 1-9 Pin-Out Summary (ECT) IOCx function is available only for port T. TIMIOCx function again is available for port R and port P.
So if you have HW done with timer pins at port P, then you need to use TIM timer.
Default routing of TIM module is port R (see Figure 1-1. MC9S12XE-Family Block Diagram in RM – page 32). However this port is available only in 208 MAPBGA Package.
Please use Port R Routing Register (PTRRR) to reroute TIM channels to port P (see section 2.3.92 Port R Routing Register (PTRRR) in RM - page 176).
Please check also Table 2-2. Pin Functions and Priorities in RM (page 95). PWM and SPIs has higher priority than TIM channels.
S12XE has two 8channel timers, TIM (port R) and ECT (port T). Also there's an 8channel PWM module (port P).
S12XE has several routing registers, which allow changing destination pins of particular peripheral modules.
MODRR allows rerouting CAN0, CAN4, SPI0, SPI1, SPI2 modules.
PTRRR allows rerouting TIM pins. Each PTRRR bit corresponds to TIM channel. PTRRRx=0 (reset default routing) makes TIMx routed to PTRx pin, PTRRRx=1 makes TIMx routed to PTPx pin.
PTLRR allows rerouting SCI4/5/6/7 modules
PTFRR allows rerouting SCI3, IIC0, and CS0/1/2/3
ECT pins are not rerouteable, only TIM pins can be routed to port P or to port R.
Table 1-8 Peripheral - Port Routing Options in S12XE reference manual doesn't include any option for ECT, only for TIM (port R / port P)
In Table 1-9 Pin-Out Summary (ECT) IOCx function is available only for port T. TIMIOCx function again is available for port R and port P.
So if you have HW done with timer pins at port P, then you need to use TIM timer.
Thank you very much. I've successfully achieved my goal with your kind help.:smileylaugh: