
Enhanced Time Processing Unit (eTPU2)
MPC5644A Microcontroller Reference Manual, Rev. 6
994
Freescale Semiconductor
#define TCRCLK_FILTER_INTEGRATOR 0x00800000 //TCRCLK filter in Integrator mode
#define TCRCLK_FILTER_DIV2CLOCK 0x00000000 //TCRCLK filter uses system clock divided by 2
#define TCRCLK_FILTER_CHANNELCLOCK 0x00400000 //TCRCLK filter uses channel clock
#define TCR2_RISE 0x00100000 //TCR2 inc rising edge
#define TCR2_FALL 0x00200000 //TCR2 inc falling edge
#define TCR2_RISEFALL 0x00300000 //TCR2 inc ris and fall
#define TCR2_GATEDDIV8 0x00000000 //TCRCLK gates system clock/8
#define TCR1CLK_SOURCE_DIV2 0x00000000 //TCR1 source system clock/2
#define TRC1CLK_SOURCE_TCRCLK 0x00040000 //TCR1 source is TCRCLK pin
#define CHANNEL_FILTER_TWOSAMPLEMODE 0x00000000 //Filter:two sample mode
#define CHANNEL_FILTER_THREESAMPLEMODE 0x00008000 //Filter:three sample mode
#define CHANNEL_FILTER_CONTMODE 0x0000C000 //Filter:continuous mode
//ETPU_ECR fields - Engine Configuration Register
#define FILTER_PRESCALER_CLOCK_DIV4 0x00010000 //System clock/4
//ETPU_CxCR fields - Channelx Configuration Register
#define CHANNEL_INT_ENABLE 0x80000000 //Channel Interrupt enable
#define CHANNEL_DATA_TRANSF_REQ_ENABLE 0x40000000 //Channel data transfer req. enable
#define CHANNEL_PRIORITY_DISABLE 0x00000000 //Channel disable
#define CHANNEL_PRIORITY_LOW 0x10000000 //Low priority channel
#define CHANNEL_PRIORITY_MIDDLE 0x20000000 //Middle priority channel
#define CHANNEL_PRIORITY_HIGH 0x30000000 //High priority channel
//DATA_UART - SPRAM
#define CLEAR_TDRE 0x007FFFFF //TDRE must be zero to signal new valid
//data to be transmitted
void init_etpu( ){
volatile int temp;
//Initialize eTPU module configuration register(ETPU_MCR)
ETPU_MCR = 0x00070000; //SCMSIZE is 16K(7 2K blocks)
//Initialize eTPU time base configuration register(ETPU_TBCR)
ETPU_TBCR_1 = (TCR1CLK_SOURCE_DIV2 | CHANNEL_FILTER_TWOSAMPLEMODE | TCR1_PRESCALER(8));
//Initialize eTPU engine configuration register(ETPU_ECR)
ETPU_ECR_1 = (ENTRY_TABLE_BASE(0x1F) | FILTER_PRESCALER_CLOCK_DIV4);
//Write to the channel configuration Registers(ETPU_CxCR) to choose the
//function to be performed by the channel and its parameter base address.Standard entry table
//is selected.
ETPU_C0CR_1 = (CHANNEL_INT_ENABLE | CHANNEL_FUNCTION(15) | CHANNEL_PARAM_BASE_ADDR(0x00));
ETPU_C1CR_1 = (CHANNEL_INT_ENABLE | CHANNEL_FUNCTION(15) | CHANNEL_PARAM_BASE_ADDR(0x02));
//Write to the channel status control registers(ETPU_CxSCR) to choose
//variations within the function flow.
ETPU_C0SCR_1 = (FUNCTION_MODE(0)); // no parity for transmitter
ETPU_C1SCR_1 = (FUNCTION_MODE(0)); // no parity for receiver
//write to spram for parameter initialization of each configured
//channel
MATCH_RATE_TX = MATCH_RATE_TRANS(0x412); //setup match rate for transmitter
Содержание MPC5644A
Страница 2: ...MPC5644A Microcontroller Reference Manual Rev 6 2 Freescale Semiconductor...
Страница 24: ...MPC5644A Microcontroller Reference Manual Rev 6 24 Freescale Semiconductor...
Страница 26: ...MPC5644A Microcontroller Reference Manual Rev 6 26 Freescale Semiconductor...
Страница 52: ...Introduction MPC5644A Microcontroller Reference Manual Rev 6 52 Freescale Semiconductor...
Страница 56: ...Memory Map MPC5644A Microcontroller Reference Manual Rev 6 56 Freescale Semiconductor...
Страница 130: ...Device Performance Optimization MPC5644A Microcontroller Reference Manual Rev 6 130 Freescale Semiconductor...
Страница 204: ...Multi Layer AHB Crossbar Switch XBAR MPC5644A Microcontroller Reference Manual Rev 6 204 Freescale Semiconductor...
Страница 212: ...Peripheral Bridge PBRIDGE MPC5644A Microcontroller Reference Manual Rev 6 212 Freescale Semiconductor...
Страница 558: ...System Integration Unit SIU MPC5644A Microcontroller Reference Manual Rev 6 558 Freescale Semiconductor...
Страница 582: ...Frequency modulated phase locked loop FMPLL MPC5644A Microcontroller Reference Manual Rev 6 582 Freescale Semiconductor...
Страница 766: ...Enhanced Time Processing Unit eTPU2 MPC5644A Microcontroller Reference Manual Rev 6 766 Freescale Semiconductor...
Страница 1228: ...Decimation Filter MPC5644A Microcontroller Reference Manual Rev 6 1228 Freescale Semiconductor...
Страница 1236: ...System Information Module and Trim SIM MPC5644A Microcontroller Reference Manual Rev 6 1236 Freescale Semiconductor...
Страница 1250: ...Cyclic Redundancy Checker CRC Unit MPC5644A Microcontroller Reference Manual Rev 6 1250 Freescale Semiconductor...
Страница 1336: ...Deserial Serial Peripheral Interface DSPI MPC5644A Microcontroller Reference Manual Rev 6 1336 Freescale Semiconductor...
Страница 1388: ...Enhanced Serial Communication Interface ESCI MPC5644A Microcontroller Reference Manual Rev 6 1388 Freescale Semiconductor...
Страница 1440: ...FlexCAN Module MPC5644A Microcontroller Reference Manual Rev 6 1440 Freescale Semiconductor...
Страница 1624: ...FlexRay Communication Controller FlexRay MPC5644A Microcontroller Reference Manual Rev 6 1624 Freescale Semiconductor...
Страница 1670: ...JTAG Controller JTAGC MPC5644A Microcontroller Reference Manual Rev 6 1670 Freescale Semiconductor...
Страница 1692: ...Nexus Port Controller NPC MPC5644A Microcontroller Reference Manual Rev 6 1692 Freescale Semiconductor...
Страница 1701: ...Development Trigger Semaphore DTS MPC5644A Microcontroller Reference Manual Rev 6 Freescale Semiconductor 1701...
Страница 1702: ...Development Trigger Semaphore DTS MPC5644A Microcontroller Reference Manual Rev 6 1702 Freescale Semiconductor...