How to configure Pin Control Register?

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

How to configure Pin Control Register?

1,160 Views
yadhukrishnanvm
Contributor III

Hi,

 I am Yadu, I am doing bit banging code for SPI to access a SPI FLASH. I am doing it in K60N. There is W25Q64FV spi flash. I am doing bit banging code in processor expert driver suit and link it to IAR. I want to use the pins PTE0,PTE1,PTE2 & PTE3. The SPI1 pins are multiplexed with these pin. Please tell me how to select the SPI1 function pins (i.e, SIN,SOUT,SCK,CS) using PCR register . I am using the BitIO components as the SPI pins.

I have found in BitIoLdd1.c 

/* Configure pin as output */
/* GPIOE_PDDR: PDD|=1 */
GPIOE_PDDR |= GPIO_PDDR_PDD(0x01);
/* Set initialization value */
/* GPIOE_PDOR: PDO&=~1 */
GPIOE_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x01));
/* Initialization of Port Control register */
/* PORTE_PCR0: ISF=0,MUX=1 */
PORTE_PCR0 = (uint32_t)((PORTE_PCR0 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));

I want to select the SPI1 function pins. Please help me, What changes I have to do for my situation

I have attached a picture of the pins.

0 Kudos
0 Replies