AnsweredAssumed Answered

Can't get UART out on KL25

Question asked by Joel Brinton on Jun 10, 2013
Latest reply on Jun 19, 2013 by Joel Brinton

Hello,

 

I can't seem to figure out what I've forgotten on my UART0 TX to pin A2 configuration:

 





// set Radio Synchronous RX (pin A2)



PORTA_PCR2 = PORT_PCR_DSE_MASK | PORT_PCR_MUX(0x2); // UART0_TX



  /* UART0_C2: TE=0,RE=0 */
  UART0_C2 &= (uint8_t)~(uint8_t)((UART0_C2_TE_MASK | UART0_C2_RE_MASK));                                   
  /* UART0_BDL: SBR=0x3C */
  UART0_BDL = UART0_BDL_SBR(0x3C);                                   
  /* UART0_BDH: LBKDIE=0,RXEDGIE=0,SBNS=0,SBR=0 */
  UART0_BDH = UART0_BDH_SBR(0x00);                                   
  /* UART0_MA1: MA=0 */
  UART0_MA1 = UART0_MA1_MA(0x00);                                   
  /* UART0_MA2: MA=0 */
  UART0_MA2 = UART0_MA2_MA(0x00);                                   
  /* UART0_C4: MAEN1=0,MAEN2=0,M10=0,OSR=0x1F */
  UART0_C4 = UART0_C4_OSR(0x1F);                                   
  /* UART0_C1: LOOPS=0,DOZEEN=0,RSRC=0,M=0,WAKE=0,ILT=0,PE=0,PT=0 */
  UART0_C1 = 0x00U;                                   
  /* UART0_S1: IDLE=1,OR=1,NF=1,FE=1,PF=1 */
  UART0_S1 |= UART0_S1_IDLE_MASK |
              UART0_S1_OR_MASK |
              UART0_S1_NF_MASK |
              UART0_S1_FE_MASK |
              UART0_S1_PF_MASK;       
  /* UART0_S2: LBKDIF=1,RXEDGIF=1,MSBF=0,RXINV=0,RWUID=0,BRK13=0,LBKDE=0,RAF=0 */
  UART0_S2 = (UART0_S2_LBKDIF_MASK | UART0_S2_RXEDGIF_MASK);                                   
      (void) UART0_D;                  /* Dummy read of the UART0_D register to clear flags */
  /* UART0_C5: TDMAE=0,??=0,RDMAE=0,??=0,??=0,??=0,BOTHEDGE=0,RESYNCDIS=0 */
  UART0_C5 = 0x00U;                                   
  /* UART0_C3: R8T9=0,R9T8=0,TXDIR=0,TXINV=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
  UART0_C3 = 0x00U;                                   
  /* UART0_C2: TIE=0,TCIE=0,RIE=0,ILIE=0,TE=1,RE=0,RWU=0,SBK=0 */
  UART0_C2 = UART0_C2_TE_MASK;

 

 

I've enabled the UART0 clock gate and the UART0_S1_TDRE and UART0_S1_TC flags seem to be doing their thing when I write to UART0_D... Just don't see any data out on pin A2... I've gone through the Processor Expert code and read the datasheet but alas I'm missing something.

 

Thank you for any help you can provide.

 

Kind Regards,

Joel

Outcomes