SPI1 not moving to Port-E on MCF51QE128 - SOPT2:SPI1PS bit not working

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

SPI1 not moving to Port-E on MCF51QE128 - SOPT2:SPI1PS bit not working

Jump to solution
1,446 Views
jmullen_condose
Contributor III

My project uses an MCF51QE128CLH (64 pin). Port B is already used for some ADC pins and I am adding an SD card to SPI1 via free Port-E pins. Ref Manual says these pins are mux'd to PTE pins via SOPT2 register bit.

I have set SOPT2 register to:
SPI1PS bits[ 3:3 ] = 0 SPSCLK1=PTE0;MOSI1=PTE1;MISO1=PTE2;SS1=PTE3

Yet it still sends SPI control to the PTB pins. I have changed the SPI1PS bit to '1' and same, control goes to PTB pins - either setting of this bit and the SPI remains sending data to Port B pins. 

I change this bit manually in the generated Cpu.c and recompile, no luck at all.

/* Common initialization of the write once registers */
/* SOPT1: COPE=1,COPT=1,STOPE=0,WAITE=1,??=0,RSTOPE=0,BKGDPE=1,RSTPE=0 */
setReg8(SOPT1, 0xD2U);
/* SOPT2: COPCLKS=0,??=0,??=0,??=0,SPI1PS=0,ACIC2=0,IIC1PS=0,ACIC1=0 */
setReg8(SOPT2, 0x00U);

 

Is there a bug with the MCF51QE128CLH (64 pin) that prevents these pins from muxing? Or must I do something else in order to get the SPI over to Port E pins

 

 

0 Kudos
Reply
1 Solution
1,433 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi use

/* SOPT2: COPCLKS=0,??=0,??=0,??=0,SPI1PS=1,ACIC2=0,IIC1PS=0,ACIC1=0 */
setReg8(SOPT2, 0x08U);

 

If you are using PE  you can change the pins on this option

 

Snag_7af1c0f1.png

I hope this will help you

Have a good day.

 

View solution in original post

0 Kudos
Reply
2 Replies
1,434 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi use

/* SOPT2: COPCLKS=0,??=0,??=0,??=0,SPI1PS=1,ACIC2=0,IIC1PS=0,ACIC1=0 */
setReg8(SOPT2, 0x08U);

 

If you are using PE  you can change the pins on this option

 

Snag_7af1c0f1.png

I hope this will help you

Have a good day.

 

0 Kudos
Reply
1,426 Views
jmullen_condose
Contributor III

Thank you for confirming this!  I disabled the component, then PE would let me change to PortE, re-enabled, and that did it! Thank you again!

0 Kudos
Reply