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

  • I've tried several things to find the cause of the problem and am near enough sure that uVision2 (my version) doesn't support the internal baudrate generator. I have downloaded a piece of software from the Atmel site (even had a uVision project file) and even this didn't work.
    I am currently working with :

    IDE-Version:
    µVision2 V2.31
    Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2002

    C Compiler: C51.exe V7.01
    Assembler: A51.exe V7.01
    Linker/Locator: BL51.exe V5.01
    Librarian: LIB51.exe V4.24
    Hex Converter: OH51.exe V2.6
    Simulation DLL: S8051.DLL V2.31
    Dialog DLL: DP51.DLL V2.31

    Does the new version of uVision support the internal BRG.
    The test software can be downloaded from;
    http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3420

    It might just be time to upgrade.

    Thanks in advance
    Regards
    John Garrelts

  • Your are using a brand-new device with software that is two years old.

    C51 Version 7.06 adds simulation support for this device. So it seems that it is time for an upgrade.