This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Tx not happening!!!

I m using MSC1210. It receives data on UART0.
SCON=0x50--> Serial mode 1(Asynchronous full-duplex).
However, in simulation, only RI(receive interrupt) happens, TI never gets set.
As per the code TI should get set:

SBUF='@';  //These 3 lines are not setting TI bit
SBUF=0x0D;
SBUF=0x0A;

//copying the string into array
for(z=1;z<=4;z++)
{
while(SCON0==0x50){}
init_arr[z]=SBUF;
SCON0=0x50;
}

P0=0x00;
//comparing the string
if (init_arr[1]=='I' && init_arr[2]=='4' && init_arr[3]==' ' && init_arr[4]=='A')
P0=0x0F9;
else
P0=0x0C0;


Please tell me if i m wrong and why it wouldnt work as intended.

Parents
  • "TI never gets set"

    How do you know?
    You don't specifically test the TI bit anywhere in the code shown.

    Can't you test the TI and RI bits directly?

    Does this chip require you to specify both receive and transmit UART clocks?
    If so, have you done it?

    "SCON=0x50--> Serial mode 1(Asynchronous full-duplex)."

    But in the code, you are reading & writing SCON0
    Are you sure that they are the same on this chip?

Reply
  • "TI never gets set"

    How do you know?
    You don't specifically test the TI bit anywhere in the code shown.

    Can't you test the TI and RI bits directly?

    Does this chip require you to specify both receive and transmit UART clocks?
    If so, have you done it?

    "SCON=0x50--> Serial mode 1(Asynchronous full-duplex)."

    But in the code, you are reading & writing SCON0
    Are you sure that they are the same on this chip?

Children
No data