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

Timer and serial port

I am doing a project and want to use both the serial port at 2400bps and timer 0 for timing ticking.

for the serial: my setting is that:
TMOD=0x20;
TH1=-13;
TL1=1;
SCON=0x50;


for the timer:

TMOD=0x01;
TH0=(65536-5000)/256;
TL0=(65536-5000)%256;
IE=0x82;
TR0=1;

the problem is i find the TMOD need to set in both code.

How can i make two timer work seperately and work without collide? I find my system not work and the timer0 suddenly reset.



pls help

Parents Reply Children
No data