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

internal baudrate generator

Hello everyone,
I hope someone can help me out. I'm kind of stuck.
The problem: I have a program which works fine when using a timer to generate the baudrate for the uart. I want to change this to use the internal baudrate generator. I am using the Atmel AT89C51ED2 and have used the code (after my initial try didn't work) from the Armel website.

	EA = 0;
	PCON = 0x10;
	CKCON0 = 0x7F;
	CKCON1= 0X01;
	SCON = 0x50;	// UART IN MODE 1 8-BIT, (REN = 1)

	BDRCON &= 0xEE;	// BRR = 0, SRC = 0
	BDRCON |= 0x0E;	// TBCK=1, RBCK=1, SPD=1
	BRL = 100;			// APPROX ????

        BDRCON |= 0x11;	// BRR = 1
	ES	= 1;
	EA = 1;
What is going wrong:
When simulating the baudrate isn't set in the serial channel window. Of course the serial channel is not working. Can someone tell me what I am doing wrong? Or is it that uVision2 doesn't work with the internal baudrate generator.

Thanks in advance for any input.

Kind regards
John Garrelts

0