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

Serial Communication

I need to communicate between an RS232 and the UART of an 80C2051 microcontroller in order to program another 8051 chip. I have configured the correct settings for the UART set up, all I would really like to do is send a character from RS232 and view it in hyperterminal, writing the software in C language as opposed to Assembly. does any one know the correct way to do this? I have looked at many code examples and they dont really give much as to how this is done for example sending the character '$' and how it is recieved on UART, and how you can check this is correct using Hyperterminal.

Parents
  • "the following assembly code kicks out errors in keil"

    No, it doesn't!

    Read the message carefully, and think about what it is telling you:

    'C:\Keil\C51\INC\ATMEL REG51.H: error A10: ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL
    


    The message refers specifically to the REG51.H file - not to the code that you posted!

    Remember that REG51.H is a 'C' header file: it defines the 8051 SFRs, because 'C' knows nothing of SFRs - but the Assembler has these definitions built-in. Thus using the 'C' header tries to re-define things that are already built-in to the assembler; ie, it attempts to define already-defined symbols - just as the message says!

    See: http://www.keil.com/support/man/docs/a51/a51_xb.htm

    And, as Erik says, stdio.h has no place in an assembler file!

Reply
  • "the following assembly code kicks out errors in keil"

    No, it doesn't!

    Read the message carefully, and think about what it is telling you:

    'C:\Keil\C51\INC\ATMEL REG51.H: error A10: ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL
    


    The message refers specifically to the REG51.H file - not to the code that you posted!

    Remember that REG51.H is a 'C' header file: it defines the 8051 SFRs, because 'C' knows nothing of SFRs - but the Assembler has these definitions built-in. Thus using the 'C' header tries to re-define things that are already built-in to the assembler; ie, it attempts to define already-defined symbols - just as the message says!

    See: http://www.keil.com/support/man/docs/a51/a51_xb.htm

    And, as Erik says, stdio.h has no place in an assembler file!

Children
No data