Skip to main content
deng
Associate III
December 11, 2009
Question

'SCON2': invalid base address

  • December 11, 2009
  • 2 replies
  • 860 views
Posted on December 11, 2009 at 14:11

'SCON2': invalid base address

This topic has been closed for replies.

2 replies

Andrew Neil
Super User
May 17, 2011
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
deng
dengAuthor
Associate III
May 17, 2011
Posted on May 17, 2011 at 11:52

Hi All,

I am using the uPSD3254BV-24U6. I am able to get UART1 working fine. And trying to setup UART2 to work like the UART1. When I make the changes to the SCON2 in the UPSD.h file and try to complie it using Keil, I got the following errors messages:

E:\COMMUN\KEILV70\C51\INC\ST\UPSD.H(264): error C146: 'SCON2': invalid base address

Here is what I have in the UPSD.h file:

// --- UART2 SFRS ----

sfr SCON2 = 0x9A; // UART2 Serial Control

sfr SBUF2 = 0x9B; // UART2 Serial Buffer

:

:

/* SCON 2 */

sbit SM02 = SCON2^7;

sbit SM12 = SCON2^6;

sbit SM22 = SCON2^5;

sbit REN2 = SCON2^4;

sbit TB82 = SCON2^3;

sbit RB82 = SCON2^2;

sbit TI2 = SCON2^1;

sbit RI2 = SCON2^0;

Any idea what I did wrong? From looking at the datasheet, the Sfr address is correct.

Best Regards.