Can't access PTA2 on FRDM-K64F

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't access PTA2 on FRDM-K64F

Jump to solution
659 Views
ve3id
Contributor III

I took NXP at their word when they said outer row of pins is Arduino compatible and am now paying for it!

I am trying to use an OSEPP-LCD-01 on my FRDM K64F.  I have a developed program that was working on my hand-made LCD module and have changed the pin-outs to connect to the Arduino port configurations.

According to the logic analyser, all is working as planned on 3 of the 4 data bits, and the RS, R/-W and E signals, but Data bit 5, which plugs in to PTA2, is constantly low.

I see that PTA2 is used for JTAG, but surely this is not an issue if I am using the built-in OpenOCD service?

Has anybody tried this?

Thanks in advance,

Nigel

 

SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;				
PORTA->PCR[2] |= 0x0103;	
GPIOA_PDDR |= (0x01 << 2);	
send_lcd_nib(0x7);
.
.
void send_lcd_nib(char lcd_data)						{
GPIOA_PCOR |= (0x04);							
GPIOB_PCOR |= (0x01 <<23);
GPIOC_PCOR |= (0x04);							
GPIOC_PCOR |= (0x80);							 
GPIOC_PSOR |= ((lcd_data & 0x08) );				
GPIOC_PSOR |= ((lcd_data & 0x04) );		
GPIOA_PSOR |= ((lcd_data & 0x04) );	
GPIOB_PSOR |= ((lcd_data & 0x01) <<23);	
e();

return;
}

 

 

0 Kudos
Reply
1 Solution
632 Views
ErichStyger
Specialist I

Hi @ve3id ,

You have to mux the pin as GPIO pin, and I think your muxing is not correct.

Instead of |=, you need an assignment:

PORTA->PCR[2] = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;

Erich

View solution in original post

2 Replies
633 Views
ErichStyger
Specialist I

Hi @ve3id ,

You have to mux the pin as GPIO pin, and I think your muxing is not correct.

Instead of |=, you need an assignment:

PORTA->PCR[2] = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;

Erich

628 Views
ve3id
Contributor III
Erich, you are a scholar and a gentleman! In fact my bits were correct, all I had to do was change it to = instead of |=. Being an original bit-head from the 6800 days I naturally want to write out the bits as I see them! I used the OR'ing because I didn't want to mess with anything that the IDE was doing to PORT A but in the earlry morning light that is of course exactly what I needed to do! Thanks!
0 Kudos
Reply