12.07.2015 Views

SuperH (SH) 64-Bit RISC Series SH-5 System Architecture, Volume ...

SuperH (SH) 64-Bit RISC Series SH-5 System Architecture, Volume ...

SuperH (SH) 64-Bit RISC Series SH-5 System Architecture, Volume ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PRELIMINARY DATA250 OperationSerial Data Reception:Figure 35 and Figure 36 show a sample flowchart for serial reception. Use thefollowing procedure for serial data reception after enabling the SCIF for reception.NoNoStart of receptionRead ER, DR, BRK flags inSCFSR2 and ORERflag in SCLSR2ER or DR or BRK or ORER= 1?NoRead RDF flag in SCFSR2RDF = 1?YesRead receive data inSCFRDR2, and clear RDFflag in SCFSR2 to 0All data received?YesClear RE bit in SCSCR2 to 0D R A FTEnd of receptionYesError handlingFigure 35: Sample serial reception flowchart (1)1. Receive error handling andbreak detection: Read the DR,ER, and BRK flags inSCFSR2, and the ORER flagin SCLSR2, to identify anyerror, perform the appropriateerror handling, then clear theDR, ER, BRK, and ORERflags to 0. In the case of aframing error, a break can alsobe detected by reading thevalue of the RxD2 pin.2. SCIF status check and receivedata read : Read SCFSR2 andcheck that RDF = 1, then readthe receive data in SCFRDR2,read 1 from the RDF flag, andthen clear the RDF flag to 0.The transition of the RDF flagfrom 0 to 1 can also beidentified by an RXI interrupt.3. Serial reception continuationprocedure: To continue serialreception, read at least thereceive trigger set number ofreceive data bytes fromSCFRDR2, read 1 from theRDF flag, then clear the RDFflag to 0. The number ofreceive data bytes inSCFRDR2 can be ascertainedby reading the lower bits ofSCFDR2.<strong>SuperH</strong>, Inc.<strong>SH</strong>-5 <strong>System</strong> <strong>Architecture</strong>, <strong>Volume</strong> 1: <strong>System</strong> 05-SA-10001 v1.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!