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

Data from serial line (or virutal com port) in simulation.

Hi,

I am using serial port in my project.
I want to use simulator on Windows PC with uVision IDE simulator running my application.
The input to application should be from UART.
I know that I can
1. Create simulation scripts.
2. Use the following:

MODE COM2 9600, 0, 8, 1
ASSIGN COM2 <S0IN >S0OUT
S0TIME = 1


to get the data from COM2.

COM2 is a virtual com port paired with other virtual com port (COM5).
Application (actually python), is supplying data to COM5.

This "almost" works. The data goes through. Unfortunatelly it is not reliable.
Some bytes are lost.

I have checked thoroughly that data is ok on COM5.

I am simulating LPC2378. The UART is handled in polling mode.
LPC application does not do anything else at this stage.

I know that interrupt based application would be better, next thing on my todo list,
but this should also work.

Doing some excersizes in simulator I discovered that it does work well only if there are programmed delays between character.
I wonder if this is not a solution. Intercept the data from COM in simulation and supply it char by char with programmed delays. Is it possible to get the data from serial in script function?

Regards
Hubert

Parents
  • Andy,

    This works on hardware without any problems. The polling is risky in general but if the device is not doing anything else this should work IMHO. I am rather certain that the simulator is doing what it should. The issue is with the data comming from outside (virtual com) with the actual rate, which must be supplied to simulated UART at the simulated rate i.e. much, much slower. This is not happening when assingent is done.

    Regards
    Hubert

Reply
  • Andy,

    This works on hardware without any problems. The polling is risky in general but if the device is not doing anything else this should work IMHO. I am rather certain that the simulator is doing what it should. The issue is with the data comming from outside (virtual com) with the actual rate, which must be supplied to simulated UART at the simulated rate i.e. much, much slower. This is not happening when assingent is done.

    Regards
    Hubert

Children
No data