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

Using debugger with real serial port

Has anybody had trouble getting the simulator to use a real serial port instead of the builtin serial terminal?

Here is my configuration thats loaded on debug:
MODE COM1 19200, 0, 8, 1
ASSIGN WIN <NUL >NUL
ASSIGN COM1 <SIN >SOUT

My simulated program can output serial data through the PC serial port all day long without problems, however when my application reads a byte the simulation hangs.

My code runs fine on the real hardware, and it runs fine in the simulator using the builtin serial terminal window, it only hangs when reading a byte, with the assignment to COM1:

Ive tested my cables, so i know thats not an issue here. Ive tried the above conf with out assigning NUL to WIN as well, no luck.

Any thoughs or suggestions would be greatly appreciated.

Parents
  • With polled input, your code will "hang" if it doesn't get any input - that would be correct operation!

    Yep, it hangs, thats what i want it to do. The problem is, it still hangs even when i send it a byte from over the serial port to the program running in the simulator.

    Here is whats going on:
    The simulated program can send bytes through the PCs serial port.

    The simulated program when waiting for a byte never gets it even though i am clearly sending a byte to it.

    So the simulated program can send bytes through the PCs serial port, but it cannot read bytes.

    The same code can send and receive using the builtin serial terminal.

    The same code can send a receive bytes on real hardware connected to external devices.

    So what i am trying to determine here is if there is a quirk in the simulator? Do i need to use interrupt driven routines for serial to be correctly handled in the simulator through the PC's serial port? I would think the simulator would handle a polled serial routine properly as well as an interrupt driven one, what are yall doing in this regard?

Reply
  • With polled input, your code will "hang" if it doesn't get any input - that would be correct operation!

    Yep, it hangs, thats what i want it to do. The problem is, it still hangs even when i send it a byte from over the serial port to the program running in the simulator.

    Here is whats going on:
    The simulated program can send bytes through the PCs serial port.

    The simulated program when waiting for a byte never gets it even though i am clearly sending a byte to it.

    So the simulated program can send bytes through the PCs serial port, but it cannot read bytes.

    The same code can send and receive using the builtin serial terminal.

    The same code can send a receive bytes on real hardware connected to external devices.

    So what i am trying to determine here is if there is a quirk in the simulator? Do i need to use interrupt driven routines for serial to be correctly handled in the simulator through the PC's serial port? I would think the simulator would handle a polled serial routine properly as well as an interrupt driven one, what are yall doing in this regard?

Children
No data