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

The most simple A51 program

Hi
I just bought the MCB900 ver.4 with LPC935.
I have programmed the first demo program into the flash - CheckLed - and it works fine on the eval board.

I have many experiences with the old non Keil DOS assembler but I don't know yet to manage Keil A51. As I have found there are only C examples on the CD, but this is useless for me.

PLEASE, can somebody save me some hours and show the short *.A51 program which will flash or do something else with the
MCB900 on board LEDs.
I really can't understand why I can't find some A51 examples on the enclosed CD.

Parents
  • Thank you, Neil, for your reply.
    Of course I have that files in the mentioned directory.

    But I need a real working assembler project not only *.A51 file. I still don't know to write a ''project'' with a few lines assembler code, which will - for example - force F0h to the P2 (this will ligh on four P2 LEDs).
    Can somebody post that few lines, please ?
    Thank you.

Reply
  • Thank you, Neil, for your reply.
    Of course I have that files in the mentioned directory.

    But I need a real working assembler project not only *.A51 file. I still don't know to write a ''project'' with a few lines assembler code, which will - for example - force F0h to the P2 (this will ligh on four P2 LEDs).
    Can somebody post that few lines, please ?
    Thank you.

Children
  • "But I need a real working assembler project not only *.A51 file."

    My CD has a complete set of project files:

    D:\KEIL\c51\Examples\A51>dir
     Volume in drive D is LPC_2_2003
     Volume Serial Number is EA7C-B5D9
    
     Directory of D:\KEIL\c51\Examples\A51
    
    01/01/1601  12:34    <DIR>          .
    01/01/1601  12:34    <DIR>          ..
    13/09/1996  06:10                84 ABSTRACT.TXT
    08/09/1999  10:49               251 ASAMPLE.BAT
    17/09/1999  14:35             1,004 ASAMPLE.OPT
    17/09/1999  14:35             1,865 ASAMPLE.UV2
    17/06/1989  12:30             1,083 ASAMPLE1.A51
    08/09/1999  10:46               804 ASAMPLE2.A51
    17/06/1989  12:30               344 ASAMPLE3.A51
    13/09/1996  06:10             9,341 TEMPLATE.A51
                   8 File(s)         14,776 bytes
                   2 Dir(s)               0 bytes free
    ASAMPLE.UV2 is the uVision Project file - double-click it, and the Project should open in uVision.

    ASAMPLE1.A51 is the "main" module;

    ASAMPLE2.A51 contains the string output routines PUTSTRING and PUT_CRLF;

    ASAMPLE3.A51 contains the character output routine PUTCHAR.

    So there you have a complete real working assembler project!

    The operation of the uVision interface is not language specific - so the process of creating a project, adding files to the project, building the project, debugging, etc, etc are all as described in the Getting Started guide.

  • A.W. Neil,
    many thanks for your help.
    I only added the following 3 lines to the ASAMPLE1 and on board LEDs light in according with the third line. From now it will go more easy.

    sfr P2M1 = 0xA4;
    MOV P2M1,#0
    MOV P2,#01010101B

  • Hi Folks, Could someone explain the difference between using putchar and mov to send data to a serial port? They seem functionally the same to me.
    thanks,

    John

  • "They seem functionally the same to me."

    Not at all.

    MOV is a single processor instruction.

    putchar is a function; ie, a sequence of instructions that you call to perform some required operation.

    The putchar function in the ASAMPLE expample first waits for the TI flag to be set, then clears it, then uses a MOV instruction to copy the byte from the Accumulator into SBUF, then returns.

    The putchar function provided in the C51 library also expands '\n' into CR LF and handles XON/XOFF software flow control.