Livingston
Full Member level 2
- Joined
- Nov 26, 2007
- Messages
- 129
- Helped
- 3
- Reputation
- 6
- Reaction score
- 1
- Trophy points
- 1,298
- Location
- Chennai-India
- Activity points
- 2,104
minimum circuit of 89c2051
Hai,
I have designed a simple circuit to display some character in the p.c.
That circuit contains one max232 circuit and basic working circuit fo 89c2051(contains 11.0592 crystal with two 33pf and 8,3k ohms and 10µf for reset pin).
The program is executing well (tested with 89c51 controller) but if i programmed the same code in 89c2051 there is no output from the uart
The baurd rate is 9600bps
/*------------------------------------------------------------------------------
Serial.c
------------------------------------------------------------------------------*/
#include <REG52.H> /* special function register declarations */
/* for the intended 8051 derivative */
#include <stdio.h> /* prototype declarations for I/O functions */
#ifdef MONITOR51 /* Debugging with Monitor-51 needs */
char code reserve [3] _at_ 0x23; /* space for serial interrupt if */
#endif /* Stop Exection with Serial Intr. */
/* is enabled */
/*------------------------------------------------
The delay function
------------------------------------------------*/
void Delay (const unsigned int DELAY)
{
unsigned int x, y;
for (x = 0; x <= DELAY; x++)
{
for (y = 0; y <= 120; y++);
}
}
/*------------------------------------------------
The main C function. Program execution starts
here after stack initialization.
------------------------------------------------*/
void main (void) {
/*------------------------------------------------
Setup the serial port for 9600 baud at 11.0952 MHz.
------------------------------------------------*/
#ifndef MONITOR51
SCON = 0x42; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 0xFD; /* TH1: reload value for 9600 baud @ 11.0592 MHz */
TR1 = 1; /* TR1: timer 1 run */
TI = 1; /* TI: set TI to send first char of UART */
#endif
/*------------------------------------------------
Note that an embedded program never exits (because
there is no operating system to return to). It
must loop and execute forever.
------------------------------------------------*/
while (1)
{
P1 ^= 0x01; /* Toggle P1.0 each time we print */
Delay(1000);
printf ("Livingston\n"); /* Print "Livingston" */
}
}
Hai,
I have designed a simple circuit to display some character in the p.c.
That circuit contains one max232 circuit and basic working circuit fo 89c2051(contains 11.0592 crystal with two 33pf and 8,3k ohms and 10µf for reset pin).
The program is executing well (tested with 89c51 controller) but if i programmed the same code in 89c2051 there is no output from the uart
The baurd rate is 9600bps
/*------------------------------------------------------------------------------
Serial.c
------------------------------------------------------------------------------*/
#include <REG52.H> /* special function register declarations */
/* for the intended 8051 derivative */
#include <stdio.h> /* prototype declarations for I/O functions */
#ifdef MONITOR51 /* Debugging with Monitor-51 needs */
char code reserve [3] _at_ 0x23; /* space for serial interrupt if */
#endif /* Stop Exection with Serial Intr. */
/* is enabled */
/*------------------------------------------------
The delay function
------------------------------------------------*/
void Delay (const unsigned int DELAY)
{
unsigned int x, y;
for (x = 0; x <= DELAY; x++)
{
for (y = 0; y <= 120; y++);
}
}
/*------------------------------------------------
The main C function. Program execution starts
here after stack initialization.
------------------------------------------------*/
void main (void) {
/*------------------------------------------------
Setup the serial port for 9600 baud at 11.0952 MHz.
------------------------------------------------*/
#ifndef MONITOR51
SCON = 0x42; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 0xFD; /* TH1: reload value for 9600 baud @ 11.0592 MHz */
TR1 = 1; /* TR1: timer 1 run */
TI = 1; /* TI: set TI to send first char of UART */
#endif
/*------------------------------------------------
Note that an embedded program never exits (because
there is no operating system to return to). It
must loop and execute forever.
------------------------------------------------*/
while (1)
{
P1 ^= 0x01; /* Toggle P1.0 each time we print */
Delay(1000);
printf ("Livingston\n"); /* Print "Livingston" */
}
}