AnsweredAssumed Answered

LPUART KL17 and target reset

Question asked by Ben Griffiths on Aug 24, 2017
Latest reply on Aug 29, 2017 by Ben Griffiths

i'm usign a 32-pin QFN part I'm trying to change the LPUART1 from using PTE0 (TX) and PTE1 (RX) to using PTC3 (RX) and PTC4 (TX) (and re-allocating PTE0 & PTE1 as GPIO lines).

 

When I change the code, my target devices keeps resetting. I'm fairly certain it's a software issue rather than a hardware issue. When I change which lines I'm using for the LPUART is there anything else I need to change? (Or am I doing anything daft in my code)

 

Old Code Which Works

  PORT_SetPinMux(PORTC, PIN3_IDX, kPORT_MuxAsGpio);
  PORTC->PCR[3] = ((PORTC->PCR[3] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );
  PORT_SetPinMux(PORTC, PIN4_IDX, kPORT_MuxAsGpio);
  PORTC->PCR[4] = ((PORTC->PCR[4] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );

 

  PORT_SetPinMux(PORTE, PIN0_IDX, kPORT_MuxAlt3);
  PORTE->PCR[0] = ((PORTE->PCR[0] &
      (~(PORT_PCR_PE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_PE(PCR_PE_ENABLED)
  );
  PORT_SetPinMux(PORTE, PIN1_IDX, kPORT_MuxAlt3);

 

New Code which causes target to keep resetting

  // Pin 1 - PTE0
  PORT_SetPinMux(PORTE, PIN0_IDX, kPORT_MuxAsGpio);
  PORTE->PCR[0] = ((PORTE->PCR[0] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );

 

  // Pin 2 - PTE1
  PORT_SetPinMux(PORTE, PIN1_IDX, kPORT_MuxAsGpio); 
  PORTE->PCR[1] = ((PORTE->PCR[1] &
      (~(PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_SRE(PCR_SRE_SLOW)
  );

 

  // Pin 24 - PTC3
  PORT_SetPinMux(PORTC, PIN3_IDX, kPORT_MuxAlt3);

 

  // Pin 25 - PTC4
  PORT_SetPinMux(PORTC, PIN4_IDX, kPORT_MuxAlt3);
  PORTC->PCR[4] = ((PORTC->PCR[4] &
      (~(PORT_PCR_PE_MASK | PORT_PCR_ISF_MASK)))
      | PORT_PCR_PE(PCR_PE_ENABLED)
  );

Outcomes