SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK;
SIM_SCGC6 |= SIM_SCGC6_TPM1_MASK;
SIM_SOPT2 |= SIM_SOPT2_TPMSRC(1);
PORTB_PCR7 = ( 0 | PORT_PCR_MUX(2));
TPM1_MOD = 1999;
TPM1_C0SC = (TPM_CnSC_MSB_MASK | TPM_CnSC_ELSA_MASK);
TPM1_C0V = 20;
TPM1_SC = TPM_SC_CMOD(1) | TPM_SC_PS(0);
这是初始化代码,为什么用示波器量,没有波形 |