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

Mon51 funktioniert nicht mit externer Uart

Ich habe versucht Mon51 mit der externen Uart in Betrieb zu nehmen - leider erfolglos.
(es kommt keine Kommunikation mit µVision zustande)
Mit der internen Uart funtioniert es.

Mon 51 mit der externe Uart habe ich mit folgenden einstellungen generiert:
install.bat 6 7F 80

für Mon51 mit der internen mit
install.bat 9 7F 80

den bauddiv. für die externe Uart habe ich in install.a51 auf 0xC eingestellt (1.843200 MHz / 9600 Bad)

Die Externe UART befindet sich im Bereich zwischen 0xE400 - 0xE7FF.
Wenn ich auf die externe Uart mit einem Programm zugreife funktioniert das Senden und Empfangen ohne Probleme.


Ich hoffe jemand kennt eine Lösung.

Vielen Dank im voraus.

Frank Keubler

Parents Reply Children
  • > Just to make this absolutely clear: you
    > did change SIOADDR in install.a51 to the
    > actual address of your 16550, then?

    Yes and i can access the external uart - i know this because i write some asm routines to test the communication.

    > You're referring to something you
    > call "IO_space" instead, which leaves room > for guessing...

    Ok -- i use the wrong word -- i shuld say my uart is mapped in the external xram space.


    but this works - i know
    because i can send data.

    have you experiences with external uart and Mon51?

  • Gents;
    Mon51 does support external UART. The Keil MCBx51 board uses the 16550 for the monitor leaving serial 0 for the user. In the MON51 folder is an install.bat file with definitions for multiple serail configurations. Selecting serial 6 and defining the XDATA (XRAM) start address for your memory map UART will allow you to build a MON51 for your direct configuration. See the PDF file in the MON51 folder for more details. Also look at the MCBx51 hardware manual on the Keil web site to see how they interfaced thier 16550 UART. Full schematics are shown. Bradford

  • Yes and i can access the external uart - i know this because i write some asm routines to test the communication.

    That's not exactly the test you should be running. You should check that the actual code as found in install.a51, with your modifications, can successfully communicate with your 16550.

    You may have to actually try a copy-n-pasted version of it in your test program to be completely sure.

  • yes -- i know that it should support external uart - i will use this and i read many many times the manual.

    I also know the install.a51

    My uart is at this moment in the same Xram (and Code space - as descibed in manual {chapter 3/page 14})

    At this time i used the same configuration as the Keil eval board - but the unused I/O are used for my specific hardware enviroment)

    This is not the problem.

    I had some questions about the install.a51
    **********************************************************************************
    1. -- how would for serialtype 6 the bauddiv register initialised?

    Ok -- i see the formel :
    BAUDDIV EQU (SIOCLK / 16) / BAUDRATE

    this is correct -- but the parser cant handele the value of SIOCLK if this is bigger 65535 - <and so the generated value for Bauddiv is 0 -- from where i know it?
    i see it in the disassembled generated mon51.hex

    the next problem -- in the hardware manual for the external uart the interrupt IE0 is used - how ?
    did somewhere see a using of this in install.a51?

    I see at IE0 the code :
    LJMP INT_ADR_OFF + 03H

    if external uart is used for me should then stay at IE0 - location

    LJMP SER_ISR

    the next question

    If the external int is used by the monitor then how ?

    if serial 6 is used in install.a51 the

    I see in the serial 6 section the following:

    SER_INT_ADR EQU 23H ;

    is used, why ?

    I think external serial interrupt bin is connected to IE0

    so for me there should stay
    SER_INT_ADR EQU 23H ;

    ok... it would be nice if someone can answer my questions.

    A other solution would be if someone have a MCBx51 board.


    I can use the monitor memory dump and load it in the simulator of keil to see what is going on to use the external Uart -or what my mistake is.

    for this if someone have the MCBx51 he must go following steps.
    Set :
    Uart_INT: ON
    ext_Uart : ON
    PAGE: OFF
    Monitor: ON
    51/151: ON

    if this setting are correct,start the µvision debugger - with communication over
    external uart.

    in the debugger command window type in the following command:

    save Monitor.hex C:0xE000, C:0xFFFF


    send this to my e-mail.
    Solo_Frank@web.de

    with this -- i find the right solution.

    best regards,
    Frank



    > You may have to actually try a copy-n-pasted version of it in your test program to be completely sure. <

    The initialisation from install.a51 was used for test.

    For the readout and writing to the uart i write some routines to emulate the readou and writing of the monitor....
    But -- i didnt know how it is realized in mon51.lib