Virtual Terminal UART Help

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
sobtzaktech
Professional User
Posts: 3
Joined: Thu 2021-09-30 2:31

Virtual Terminal UART Help

Post by sobtzaktech »

HI. I'm new to Proteus. I'm using it to simulate a PIC16F1619. I've done a couple of simple simulations so I got the basics. I'm trying to get a simple simulation of the PIC just outputting an increasing number every 200ms to the UART. I've physically built the circuit so I know the code works.
From what I've seen, if I just want to simulate this output on screen, all I need is a virtual terminal. I added one and hook it up, TX to RX and vise versa. One time when I started the simulation the terminal window popped up but things weren't working right. Now I cannot get it to come up and get the simulation to work even though I know the code is good. Is there anything I'm missing?
Also, can you actually have the simulation output the data to a USB/FTDI cable or any other port on the PC? Would you need to model the 232 converter then?

I appreciate any help!
Thanks,
Tom
chimimic
Expert User
Posts: 508
Joined: Tue 2006-04-11 13:31
Location: France
Contact:

Re: Virtual Terminal UART Help

Post by chimimic »

Hi Tom,

Data delivered by UART-TX of the PIC can be sent to :
- TERMINAL component, if data you're sending is text
- COMPIM component, if you want send data out of the computer, on a real or virtual COM port (without or with an USB/RS232 adapter)
In all cases and for simulation only purpose, there is no need to add RS232 converter model.

Does your data are transmitted in BINARY or in ASCII format ?
In first case, only "printable" chars will be displayed on terminal.
If you convert your auto-incremented numbers in a string format before sending them, you'll see all them in terminal.

Hope this help.

Remy
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Virtual Terminal UART Help

Post by Ettore »

sobtzaktech wrote: Wed 2021-10-06 5:27 ... One time when I started the simulation the terminal window popped up but things weren't working right...
What specific thing do you think is not working right ? Did you get garbage characters ? Or nothing at all ?
Assuming you have connected correctly the Virtual Terminal to the PIC, one thing you should look at is the baud-rate selection. Baud-rate programmed in the PIC depends by FOSC and should be as the same value selected to the Virtual Terminal.
Just in case of any doubt, I suggest you to attach here your example and we will be more than happy to help.
sobtzaktech wrote: Wed 2021-10-06 5:27...Now I cannot get it to come up and get the simulation to work even though I know the code is good. Is there anything I'm missing?
You, perhaps, have closed the Virtual Terminal by clicking the close button in the upper right corner. To have it to come up again you need to open Debug menu when in simulation and select the Virtual Terminal item.

Anyway, find attached an example you may use to play with that we used to validate the PIC model.
test.pdsprj
(21.71 KiB) Downloaded 192 times
Kind regards,
Ettore Arena - Labcenter Electronics.
sobtzaktech
Professional User
Posts: 3
Joined: Thu 2021-09-30 2:31

Re: Virtual Terminal UART Help

Post by sobtzaktech »

All, I got it working!

Chimimic - I'm sending text form the PIC using the printf() in the code so its ASCII data that I'm looking for. I'll have to try the COMPIN to see if I can get it out of the PC. Good to know this (though I'm sure I'll forget and have ask again some time in the future!) :)

Ettore - Thanks for the the feedback. First time I was getting garbage. I did get confirm the Fosc correct. Not sure what I was doing wrong. Since then I was having no luck getting the Virtual Terminal Window to pop up when the simulation started.

Now that I got the right pin connected, it works. Question, If there is no data going out to the virtual terminal, will the window NOT pop up?

Got another question since I'm brand new to this...The little colored squares next to the pins. I see Red, Blue, and Gray. What do these squares and colors represent?

Sorry. This is all new to me and I haven't found a real good tutorial series on YouTube for this at all so I'm going to have a lot of questions as I sludge through this. I appreciate the help!

Tom
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Virtual Terminal UART Help

Post by Ettore »

sobtzaktech wrote: Thu 2021-10-07 2:09 ... Question, If there is no data going out to the virtual terminal, will the window NOT pop up?...
Virtual Terminal window pops up anyway.
sobtzaktech wrote: Thu 2021-10-07 2:09 ...The little colored squares next to the pins. I see Red, Blue, and Gray. What do these squares and colors represent?
Represent logic states. Red=High, Blue=Low, Gray=Floating
Kind regards,
Ettore Arena - Labcenter Electronics.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Virtual Terminal UART Help

Post by Ettore »

sobtzaktech wrote: Thu 2021-10-07 2:09 ...Sorry. This is all new to me and I haven't found a real good tutorial series on YouTube for this at all so I'm going to have a lot of questions as I sludge through this. I appreciate the help!
You may like to have look at the help documentation.
Under "Getting Started" section of the Home Page you can get a good initial Tutorial and under Help section the full Simulation help manual.
Immagine 2021-10-07 114143.jpg
Immagine 2021-10-07 114143.jpg (284.06 KiB) Viewed 3101 times
Kind regards,
Ettore Arena - Labcenter Electronics.
David
Site Admin
Posts: 2267
Joined: Mon 2006-02-20 14:56
Location: Head Office
Contact:

Re: Virtual Terminal UART Help

Post by David »

Hi Tom,

Just to add... if the VT doesn't appear when you press play, you can reopen it from the Debug menu > Virtual Terminal - at the bottom of the menu.

Regards,
Dave.
sobtzaktech
Professional User
Posts: 3
Joined: Thu 2021-09-30 2:31

Re: Virtual Terminal UART Help

Post by sobtzaktech »

Thanks for the info! That's good to know on how to re-open the window. I'll take a look at the tutorials in the left of the opening window and see what I can learn!

Tom
Post Reply