problems with soft uart strings

Status
Not open for further replies.

toozie21

New Member
So I dusted off some old code recently and since i am on a new PC now I needed to install the latest Pic Simulator. Once done I went to simulate, but I cannot seem to send a string of characters to the PIC (which I thought I could before). I have a GPS parser that looks at a GPS sentence and set the day/time accordingly, but using the Software UART interface only allows me to send one character at a time (which takes forever).

I could have sworn that my old version allowed me to paste in a whole character string, hit send, and let it crunch away. Am I losing my mind, or is there a way to still do that?

Thanks,
~Jason
 

hi Jason,
Which simulator are you using.?

A look at your code would be helpful.

EDIT:
If its Oshonsoft Sim, this the method used.
Some examples:

DEFINE SEROUT_DELAYUS = 5000
SEROUT PORTC.6, 1200, "Hello world!", CrLf
DIM I AS BYTE loop:
SERIN PORTC.7, 9600, I
SEROUT PORTC.6, 9600, "Number: ", #I, CrLf
GOTO loop

EDIT2:
You can use the Hardware UART for sending strings to the Sim program, set the TX and RX lines to suit.
 
Last edited:
Hi Eric, it is the most recent PICSIMIDE (6.86). The code works (because I had tested it when I first wrote it), it is the simulator I am having issues with (since it used to work, I assume I either don't remember, or what I want to do moved to a new window).

I think your second edit might be the answer. I want to send an string of characters into the PIC via 4800 baud serial (simulating a GPS device hooked up to the PIC). If I use the software UART, it will allow me to send one char at a time and I can see the code receiving the chars. But you think the hardware UART will do the whole sentence (I am at work, so I am gathering data for when I get home), what is the difference in the hardware/software UART in the simulator?

Thanks for all the help!!!!
~Jason
 
hi Jason,
Tried the HW and software UART combination, it will not accept it.???

The HW UART will accept a string for transmission.

Will keep trying a few ideas.
 
Thanks for checking on it Eric.

Are you saying it worked for you, or that you are seeing a similar problem?

~Jason

EDIT: I think I have found my problem. When I originally wrote the code, PICSIM didn't support the hardware UART, so I was using the Serin commands. You need to use the soft serial window for that (and it doesn't allow strings). I changed to use the HSerin and not I can use the hardware serial window which does allow the transmission of strings and all seems to be working (at least in simulation, and that is 1/2 the battle). Now to see how well it works in the hardware! Thanks again for the help!
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…