Madhura Bhandigani

SPI MC9S12GA240 communication with 25AA512 EEPROM

Discussion created by Madhura Bhandigani on Oct 6, 2018
Latest reply on Oct 9, 2018 by Madhura Bhandigani

I am working on SPI Protocol on Mc9S12GA240  controller, trying to interface with SEEPROM-25AA512.

 

I have set the bits like: In 1) SPICR1: SPI system enable bit, SPI in master mode, CPOL and CPHA both set to low,

                                                         Data transferred to MSB first.

                                          2) SPICR2: 8-bit transfer width, SPI clock operates normally in wait mode.

                                          3) SPIBR: Bus clock is 20MHz, Baud rate divisor=2048, Baud rate is set to 9.77kbit/s.

Program is being stucked in  while( SPI1SR_SPIF == 0 ). 

Please let me know where I am missing. Thanks in advance

Outcomes