Renesas Asynchronous SH7145F Bedienungsanleitung Seite 18

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 20
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 17
SH7145 Group
SCI Break Detection
REJ06B0384-0100Z/Rev.1.00 September 2004 Page 18 of 20
/***********************************************************************************************/
/* Function : err */
/* Operation : error judging(SCI0) */
/* Asynchronous Receive Mode */
/***********************************************************************************************/
void err(void)
{
if(P_SCI0.SSR_0.BIT.ORER == 1){ /* Overrun error */
P_SCI0.SSR_0.BIT.ORER = 0; /* Clear ORER flag */
}
if(P_SCI0.SSR_0.BIT.FER == 1){ /* Framing error */
if(P_PORTA.PADRL.BIT.PA0DR == 0){
P_CMT.CMSTR.BIT.STR = 1; /* CMT0 count start */
while(T_count != 0); /* Wait until T_count = 0 */
if(Rd_count == 3){ /* Break detect (Rd_count==3) */
P_SCI0.SCR_0.BIT.RE = 0; /* RE=0,receive disable */
}
}
P_SCI0.SSR_0.BIT.FER = 0; /* Clear FER flag */
}
if(P_SCI0.SSR_0.BIT.PER == 1){ /* Parity error */
P_SCI0.SSR_0.BIT.PER = 0; /* Clear PER flag */
}
}
/***********************************************************************************************/
/* Interruption Program */
/***********************************************************************************************/
/***********************************************************************************************/
/* CMT0 Interruption Program */
/***********************************************************************************************/
#pragma interrupt(cmt_int)
void cmt_int(void)
{
P_CMT.CMCSR_0.BIT.CMF = 0; /* Clear CMF flag */
/* Read RxD-pin level */
if(P_PORTA.PADRL.BIT.PA0DR == 0){ /* RxD-pin level is low */
Rd_count++; /* Count */
}
T_count--; /* Count interrupt times */
/* Judging interrupt times */
if(T_count == 0){ /* 3 times interrupt */
P_CMT.CMSTR.BIT.STR = 0; /* CMT_0 count stop */
}
}
/***********************************************************************************************/
/* Other Interruption Program */
/***********************************************************************************************/
#pragma interrupt(dummy_f)
void dummy_f(void)
{
/* Other Interrupt */
}
Seitenansicht 17
1 2 ... 13 14 15 16 17 18 19 20

Kommentare zu diesen Handbüchern

Keine Kommentare