I want an example code for SPI_Slave in KEA-128? If you can say me just the register settings it will be great.
Hi VIGNESH BALAJI,
Please download the FRDM-KEA quick start package from this website:
http://www.nxp.com/assets/downloads/data/en/board-support-packages/FRDM-KEA-QSP.zip
Then you can find the SPI slave code from folder:
FRDM-KEA-QSP\Quick Start Package v5\SDK Drivers and Code Example Projects\FRDM-KEAZ128\Driver Test SW for KEAZ128\Driver Test SW for KEAZ128\FRDM_KEA128_SPI_Slave
The driver is nearly just control the register, it is not difficult to understand.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
Please give me a register level example code.I have written a code.Caan you cross check it and Let me know?
SIM_PINSEL0 |= SIM_PINSEL_SPI0PS_MASK; /* Selected PTE0,PTE1,PTE2 & PTE3 ******/
SIM_SCGC |= SIM_SCGC_SPI0_MASK; /* Clock enabled to SPI0 ***************/
SPI0_C1 |= SPI_C1_SPE_MASK /* Enable SPI **************************/
| SPI_C1_MSTR_MASK /* SPI as Master ***********************/
| SPI_C1_CPHA_MASK; /* CPHA = 1 ****************************/
SPI0_BR = 0x10; /* Set baud rate ***********************/ // 5 Mhz
SPI0_C2 &= ~SPI_C2_MODFEN_MASK; /* Disable MODFEN **********************/\
int main(void){
Clk_Init();
SPI_init();
for(;;) {
SPI_read();
}
return 0;
}
Hi VIGNESH BALAJI,
I have modified your code, please refer to your anther post:
Checking SPI Transmit and receive in KEA-128 using TRK-KEA128
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------