• To use the serial communication with interrupt, we have to set ES bit along with the EA bit.
  • Whenever single byte data is sent or received, the serial interrupt is generated and the TI or RI flag of SCON register goes high.
  • Here, the TI or RI flag needs to be cleared explicitly in the interrupt routine (written for the Serial Interrupt).
  • Registers those are used in programming of serial communication with interrupt are as follow:

TMOD

tmod

  • G=0 mean, timer control by software mechanism.
  • G=1 mean, timer control by hardware mechanism.
  • C/T0= 0 mean, timer operation.
  • C/T0= 1 mean, counter operation.

 

 

M1

M0

MODE OF OPERATION

0

0

Mode 0 (13 bit)

0

1

Mode 1 (16bit)

1

0

Mode (8bit auto reload mode )

1

1

Split timer mode

 

 

 

 

TH1 & TL1

 th

 

  • This is each 8 bit register used to load the value up to which timer run.
  • On reaching on this value loaded in TH and TL, timer flag is raised

 

 

SCON

 scon

  • REN=0 mean, receive transmit disable.
  • REN=1 mean, receive transmit enable.
  • TB8 & RB8 are reserved.
  • TI=0 mean, transmission is continue.
  •  TI=1 mean, transmission is completed.
  • RI=0 mean, receiving is continue.
  • RI=1 mean. receiving is completed.

 

 

SM0

SM1

SM2

SERIAL MODE SPECIFIER BIT

0

0

USED IN MULTIPROCESSOR SYSTEM

SERIAL MODE 0

0

1

SERIAL MODE 1 (1 START + 1 STOP + 8 BIT DATA)

1

0

SERIAL MODE 2

1

1

SERIAL MODE 3

 

 

 

 

 

 

 

TCON

 

 tcon 

  • TR1=0 mean, to stop timer 1 .
  • TR1=1 mean, to start timer 1.
  • TR0=0 mean, to start timer 0.
  • TR0=1 mean, to start timer 0.
  • TF1=1 mean overflow condition occur in Timer 1.
  • TF1=0 mean Timer 1 is in running condition.
  • TF0=1 mean overflow condition occur in Timer 0.
  • TF0=0 mean Timer 0 is in running condition.
  • IT1=1 mean interrupt trigger is negative edge sensitive.
  • IT1=0 mean interrupt trigger is positive edge sensitive.
  • IT0=1 mean interrupt trigger is negative edge sensitive.
  • IT0=0 mean interrupt trigger is positive edge sensitive.
  • IE1=1 mean interrupt enable Timer 1.
  • IE1=0 mean interrupt enable Timer 1.
  • IE0=1 mean interrupt enable Timer 0.
  • IE0=0 mean interrupt enable Timer 0.