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 with FX2

Hi,

After working on EZUSB FX evaluation board,I am now working on our own EZUSB FX2 board.
Right now the main task is communication to Hardware through MON51 utility.In my custom made FX2 board,Memory mapping and other configurations are same as EZUSB-FX evaluation board with little changes.

For communicating to MON51 ,I am using "mon-ext-sio1-c0.hex" file which I am downloading on EEPROM.

On Keil Debugger I am starting Code Space from 0x4000 and xdata from 0x5000.

The baudrate is 38400 and port is COM1 as I have only one serial port.

But still I am not able to communicate to my FX2 board.

Please let me know what else I have to do to make communication.

DO I have to change Install.A51 file?If yes then what values I have to change.Please let me know.

I gave a try after running command "Install 8 7f 0" on command prompt to create MON hex file. And I downlaoded this file to EEPROM using EZ USB COntrol panel, but I am not getting success!!

Please help me with this!!

  • You need to change the INSTALL.A51 file, you can tryout by modify serial 5 in INSTALL.a51 file. Below is example of 38400Hz at CPU 48MHz using Timer 1 mode2

    $IF (SERIAL = 5)
    ;********************************************************************
    ;* Using second serial interface of 8051 *
    ;* Time 1 and dual data pointer support *
    ;* Oscillator frequency = 48.000 MHz *
    ;* Set Baudrate to 38400 Baud *
    ;********************************************************************
    DPS DATA 086H
    CKCON DATA 08EH
    SCON1 DATA 0C0H
    SBUF1 DATA 0C1H
    WDCON DATA 0D8H
    RI1 BIT 0C0H.0

    InitSerial: PROMCHECK ; Check if PROM in System
    MOV DPS,#00H
    MOV TMOD,#00100000B ;C/T = 0, Mode = 2

    set EICON.7 ;SMOD1=1
    MOV DPTR,#0E600H ;set CPUCS to clock @ 48MHz
    MOV A,#12H
    MOVX @DPTR,A

    MOV TH1,#0F6H ; 38400 baud @ 48 MHz

    ORL CKCON,#010H ; Timer 1 uses a divide by 4 clock

    SETB TR1
    MOV SCON1,#01011010B ; Init Serial Interface
    JMP Mon51
    $ENDIF

    *************************************
    Set "SERIAL = 5" on the "OPTION for file INSTALL.A51".

    Add MON51dp2.lib in the project and tick all the modules in "Option for file MON51DP2.lib" if you used dual pointer.

    Add BLlocater:
    --------------
    Code: INITSEG(0),STOPSEG(0xC000),CODE_AREA,INSTALLCODE,GOCODE_AREA
    Xdata: XDATA_AREA(0xDF00)

    Add BLmisc:
    ------------
    Misc control:PRECEDE (STACK (08))

    Compile to .HEX format. Observe the .m51. Try to use your own Keil debugger by redirect the LOADMON path on FX2 control panel. Ensure it work before proceed to EEPROM stage.