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

problems with at89c51rc

Hi

I have bben working with the at48c4051 and have not had any problems at all - i can use the uart, interrupts, timers, etc; but I just started working with the AT89C51RC and i have not able to do anything with it, not event light up an led!!

The only connections to the chip are the Rxd, Txd, p3_7 where i connect the led and reset to GND (and of course Vcc and Vss).

Does anybody know if I need to set something first? or if i need to connect any other pins? i have been reading and so far they don't require anything else.

I would appreciate any help.

Thanks in advance

Parents
  • I just started working with the AT89C51RC and i have not able to do anything with it, not event light up an led!!
    WHY on earth would anyone start working with an outdated chip?

    Does anybody know if I need to set something first? or if i need to connect any other pins?
    yes, you need to "set" the code, I believe the programming algorithm and something elase there is different. pins: You need to set !EA to the correct state, I assume the chip you used before did not have that pin.

    Erik

Reply
  • I just started working with the AT89C51RC and i have not able to do anything with it, not event light up an led!!
    WHY on earth would anyone start working with an outdated chip?

    Does anybody know if I need to set something first? or if i need to connect any other pins?
    yes, you need to "set" the code, I believe the programming algorithm and something elase there is different. pins: You need to set !EA to the correct state, I assume the chip you used before did not have that pin.

    Erik

Children
  • Hi

    Hi Erik, thanks for your response.

    Actually I am working with the at89C51RD2, i don't think this one is outdated. I probably sohuld've mentioned this before but i have a couple of the AT89C51RC DIP, and i have it on a breadboard, that is why. The RD2 according to Atmel is fully compatible with the RC. Sorry about the confusion.

    Anyway, about the EA, if you are talking about the "Enable All Interrupts" pin, i am enabling it.

    I tried the samples from the Atmel website (general samples for the family 8051) and I get the same result.

    i am posing the simple piece of code i am using.

    #include "reg_c51.h"
    
    char uart_data;
    
    /**
     * FUNCTION_PURPOSE: This file set up uart in mode 1 (8 bits uart) with
     * timer 1 in mode 2 (8 bits auto reload timer).
     * FUNCTION_INPUTS: void
     * FUNCTION_OUTPUTS: void
     */
    void main (void)
    {
    	SCON = 0x50;				/* uart in mode 1 (8 bit), REN=1 */
    	TMOD = TMOD | 0x20 ;        /* Timer 1 in mode 2 */
    	TH1  = 0xFD;				/* 9600 Bds at 11.059MHz */
    	TL1  = 0xFD;				/* 9600 Bds at 11.059MHz */
    	ES = 1;						/* Enable serial interrupt	*/
    	EA = 1;						/* Enable global interrupt */
    	TR1 = 1;					/* Timer 1 run */
    
       while(1);                    /* endless */
    }
    
    /**
     * FUNCTION_PURPOSE: serial interrupt, echo received data.
     * FUNCTION_INPUTS: P3.0(RXD) serial input
     * FUNCTION_OUTPUTS: P3.1(TXD) serial output
     */
    void serial_IT(void) interrupt 4
    {
    
    	if (RI == 1)
    	{
    	//uart_data = "W";				                 /* if reception occur */
    	SBUF = uart_data;
    	RI = 0; 			           /* clear reception flag for next reception */
    	uart_data = SBUF;          /* Read receive data */
    	SBUF = uart_data; 	        /* Send back same data on uart*/
    	}
    	else TI = 0;        /* if emission occur */
    	  		              /* clear emission flag for next emission*/
    }
    
    

    Regards

  • Anyway, about the EA, if you are talking about the "Enable All Interrupts" pin, i am enabling it.
    there is NO SUCH "PIN" that is an SFR bit.

    I refer to !EA. fFrom "the bible"
    External Program Memory is accessed under two conditions:
    Whenever signal EA is active
    NOTE "active means low!, it is !EA, NOT EA

    Erik

  • I see what you are saying.

    I tried that too.
    I am tying !EA to VCC, for internal program executions, then !EA to GND. It did not work either.

  • I am tying !EA to VCC, for internal program executions
    I guess you just do not get the program loaded

    Erik