 
					
				
		
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)
  );
解決済! 解決策の投稿を見る。
 
					
				
		
I've resolved this issue, there has a define hidden deep within my code that I hadn't changed.
 
					
				
		
I've resolved this issue, there has a define hidden deep within my code that I hadn't changed.
 
					
				
		
 kerryzhou
		
			kerryzhou
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Ben Griffiths,
Please tell me the full name of your KL17, because KL17 have two different silicon type:up 128K flash and below 64K flash.
Different KL17 silicon type is different.
So, please tell me the part number at first, I am afraid you are using the wrong reference manual, then control the wrong register or pin.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
