30-13MB86R02 ‘Jade-D’ Hardware Manual V1.6430.7 Setup procedure flowFigure 30-8 shows SPI setup procedure flow.STARTSTATE = SLEEPYesNoSTARTSTATE = SLEEPSTATE =ERROR ?Write SPISCR(SPE set/clear)Write SPICRSTATE =SETUP ?DATAcommunicationNoYesYesNoSTATE =BUSY ?Read SPISR(SIRQ clear)Write SPIDR(TxRx start)STATE =SETUP ?NoYesDATACommunicationstartDeletereceived data?Read SPIDRContinue datacommunication withoutsetting change?DATAcommunicationendYesNoYesNoFigure 30-8 SPI setup flow chart