Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to simulate UART in MPLAB X IDE?

Status
Not open for further replies.

electroRF

Member
Hi,

I wrote UART code that sends UART data to the PC.

I want to simulate it and therefore need to see a terminal that will present the data being sent to the PC from the PIC during the simulation.

How can I open up a terminal during the simulation?

Thanks!
 
There IS a terminal inside ISIS..

If you want to fully simulate UART then download an install this https://sourceforge.net/projects/com0com/ Its a brilliant bit of gear..

I write VB6 or C# programs that simulate the output of serial devices (UART) and use the virtual serial connection directly in ISIS.. Its seemless..
 
Hi Ian, thanks!

Could you explain a bit about what ISIS is and how it is reached in MPLAB X GUI?

The term ISIS does not appear in the MPLAB X IDE Manual

--

I currently don't have the HW connected to the PC, therefore I only simulate the code.

Therefore I'm not sure how the virtual COM port that the apps you suggested offers would help me.
 
Last edited:
Hi Ian, thanks!

Could you explain a bit about what ISIS is and how it is reached in MPLAB X GUI?

The term ISIS does not appear in the MPLAB X IDE Manual

--

I currently don't have the HW connected to the PC, therefore I only simulate the code.

Therefore I'm not sure how the virtual COM port that the apps you suggested offers would help me.

I meant to apologize.... I misread the post .... MPLAB ide has a uart tool


Select DMCI from the tools menu. When its loaded use the Remote comunication on the DCMI menu....

The readme file is easy to understand..
 
Last edited:
There is another way

Set the debugger to MPLAB sim... in the debugger menu select settings... In the UART I/O tab select ouput to window... You can create a text file to be injected into the UART as well.
 
Thanks again Ian :)

There is another way

Set the debugger to MPLAB sim... in the debugger menu select settings... In the UART I/O tab select ouput to window... You can create a text file to be injected into the UART as well.

I followed your description, then I set the project into debug mode.
However, I don't see any UART window (although I enabled it as you said).
How do you make it appear?
 
Hi Ian,
Thank you

This is the UART IO configuration as you indicated:
UART.jpg

However, as you can see below, there's no UART window / tab:
MPL.JPG

Any idea what's wrong?
 
Hi Ian,
How do you reach the limitations tab?

PIC18F4520 DOES support UART, so it'd be weird that MPLAB not supports it.
 
Hi Ian,
How do you reach the limitations tab?

PIC18F4520 DOES support UART, so it'd be weird that MPLAB not supports it.

hi,
Click Debugger/Settings /UART I/O

You should see as this image.

The Window, is the output Window.

E.
 

Attachments

  • AAesp01.gif
    AAesp01.gif
    33.9 KB · Views: 1,699
hi electro,
Its present in MPLAB v7.60 and v8.83

E.
 
Hi,
it works :)
I ran a code in which it sends Chars to PC (from PIC) and the UART1 window appeared!
Thanks a lot guys!

Perhaps you know if there's a way to simulate an input from PC to PIC in mplab?
 
Hi Ian,
I deeply thank you for your kind support :)

I attached a simple text.txt file into the UART I/O window, which contains 5 letters ABCDE.
Is that what you meant by Script?

I wonder how it works, I mean, does the file content being sent to the PIC endlessly? or some other way?
 
You have two options option 1 send the file once... Or if you click the rewind button, it'll be a continuous loop..

You can also use register injection.... Any given time you can inject a value into the UART.. Read the MPLAB SIM help file... Search for UART I/O ... Then read register injection.
 
Thanks Ian.

The MPLAB X Manual is VERY problematic, it actually explains nothing.

For example.
UART word appears only once.
UART1.JPG

Injection register does not appear there at all..

I'll try looking for that elsewhere
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top