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

timer1 mode2 baud rate

Hi,

Here is my little problem:

I use a Phillips 87lpc767 controler to generate a code on his TXD pin at 1200 bauds.
my cystal frequency is 8MHz;
My problem: TXD gives 40.000 bits/s !

 
//Timer configuration:					
PCON |= 0x80; //(SMOD1 = 1)
		
TMOD = 0x20; // Timer #1 in autoreload 8 bit mode
TH1 = 0xDD; // calculated on keil site with Fcpu = 8.00 MHz (XTAL) and SMOD1 checked

TL1=TH1;
TR1 = 1; // Turn on Timer 1

//To test the speed:
void timer1_ISR (void) interrupt 3
{
TXD ^= 0x01;
}

//in main, for timer1 interrupt:
ET1 = 1;
EA = 1;
.

I'm sure I'm not far from the solution but...
Thanks a lot for any advice and sorry for my English.

Arnaud Stoumont

Parents Reply Children
No data