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

Problem with serial port

I've done a program using the simulated serial port. My program has to
communicate with a PC using the 232 interface, so I use the simulated
serial port for the monitor, and the 232 interface for the program. The program
works.
The problem is when I burn the program in ROM, because I want it starts when I switch on the board. Then I erase the monitor program in the flash, and I burn my program in the external ROM. Then the communication 232 doesn't works. What is happening??. Here you can see my configuration of the
serial
port:
S0BG = 0x0040;
DP3 |= 0x0400; /* Set TXD for output */
DP3 &= ~0x0800; /* Set RXD for input */
P3 |= 0x0400; /* Set TXD high */
tx_restart = 1; /* Set restart flag */
S0CON = 0x8019; //8 bits, 2 stop, no parity
S0RIC = 0x0076; //Interrupts RX
S0TIC = 0x0075; //Interrupts TX
S0TBIC = 0x0077;//Interrupts buffer TX
The same program works from the RAM with monitor in ROM. I've tried using DAVE, but I haven't got any improvement. Can anybody help me?
Thank you

  • First of all, I would suggest to use the _bfld_ instruction to set the DP3 register:

    _bfld_ (DP3, 0x0C00, 0x0400);
    Are global interrupts explicitly enabled in your program?
    IEN = 1;
    Are you sure that only the serial port is not working? Maybe you have a more generic "startup" problem...
    Does your ROM program run into the simulator?
    Maybe you can take a look at the MEASURE demo project, which makes use of the serial interface with interrupts.

  • Hi Beatriz,

    I burn my program in the external ROM. Then the communication 232 doesn't works.

    Do you mean that when you burn the program into ROM it partially works? Or it does it not work at all? The difference is significant.

    - mike

  • Hi, Mike.The program partially works. I have another interrupts source, with a timer 0, and they works properly. It's only the serial port.