News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

How to push a serial feed into ISIS simulation

Started by JohnB, Jan 10, 2024, 12:51 PM

Previous topic - Next topic

JohnB

I am having a really difficult time handling return messages from a Nextion display. I have run a simulation of   messages from the Nextion which runs perfectly but when I connect the Nextion and the real hardware I miss certain messages from the Nextion.

Is there a way to connect the serial data returned from the Nextion into the ISIS model so I can see what is going on.
JohnB

ricardourio

Hi JohnB,

      Do you mean connect a real USART TTL to a simulated PIC in the ISIS ? It's possible.

Ricardo Urio

JohnB

Quote from: ricardourio on Jan 10, 2024, 01:27 PMHi JohnB,

      Do you mean connect a real USART TTL to a simulated PIC in the ISIS ? It's possible.

Ricardo Urio
exactly because with my simulated messages it all works fine.  How to do it?
JohnB

top204

#3
There is a component named "COMPIM" in the miscellaneous parts and this creates a virtual serial port to the outside world.

I used to use it many years ago, but I tried it recently and I have had problems with it on Windows 10 and it does not show as a virtual serial port in the real world. i.e. On any serial terminal program in windows, as it used to do in XP and Windows 7.

JohnB

Thanks Les, I wasn't aware of that. I'll give it a try.  I find it really difficult debugging serial coms under interrupt control. I have two messages which come through in quick succession, but I never see the second message.   
JohnB

RGV250

Hi John,
Another thing I use if I am using ISIS to another program with a serial port is a virtual serial port https://eterlogic.com/Products.VSPE.html so you never go to the real world. Free for 32bit windows but you get a 4 week demo for the 64 bit version.

Bob

JonW

I don't trust ISIS anymore and prefer to debug with a scope that can decode serial. If you don't have one then you could use a cheap dspic dev board to sample the serial lines using an ADC and feed it into a free pc based analysis program like Sigrok serially.  I am pretty sure Sigrok has serial decoders and could easily show any clashes/errors/timing/glitches and can accept serial data to display and decode.

Peter Truman

Quote from: JonW on Jan 11, 2024, 01:02 AMI don't trust ISIS anymore and prefer to debug with a scope that can decode serial. If you don't have one then you could use a cheap dspic dev board to sample the serial lines using an ADC and feed it into a free pc based analysis program like Sigrok serially.  I am pretty sure Sigrok has serial decoders and could easily show any clashes/errors/timing/glitches and can accept serial data to display and decode.

I use the Saleae Logic 8 along with their Logic Software - easily captures the data I need and the software has multiple decoders and timing functions. Really good for getting into the weeds. Not cheap but an awesome tool (and still cheaper than scope with a logic analyser). I did try a cheap version from Amazon - but it was so bad I tossed it in the bin!

JohnB

Thanks for all the input.  I think I have found the root of the problem: When the Nextion goes into Sleep mode it issues a short message to say its in Sleep.  When the Nextion comes out of sleep (Wake on Touch) it issues three messages, two touch and a release coordinates and finally a short Wakeup message. The wakeup message follows directly  after the last coordinate as if its one continuous message. I don't need for the touch messages but can't stop them. Messages are received under interrupt and placed in a buffer for processing.

I respond to messages using HRSOut, if I stop sending the responses I can detect the Wakeup message.  I don't really understand why HRSOut messages should affect what I see coming in but at least I have something to work on.

I would love to buy a Saleae Logic analyser but can't really justify it against other expenditures.
 
JohnB

kcsl

QuoteI would love to buy a Saleae Logic analyser but can't really justify it against other expenditures.
 

Have a look at these. I got one several years ago and it's not bad - and it's cheaper.
https://www.amazon.co.uk/gp/product/B07D21GG6J/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1
There's no room for optimism in software or hardware engineering.

Pepe

I use Virtual Serial Port Driver 8.9 by Eltima Software

Stephen Moss

Quote from: kcsl on Jan 11, 2024, 12:56 PM
QuoteI would love to buy a Saleae Logic analyser but can't really justify it against other expenditures.
 

Have a look at these. I got one several years ago and it's not bad - and it's cheaper.
https://www.amazon.co.uk/gp/product/B07D21GG6J/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1
If you don't need 100MHz or more than 8 bits then the The Hobby Components USB 24M 8CH 24MHz Logic Analyser is even cheaper at around £15. Brought it as my USBee one seemed to have stopped working, not had much opportunity to use it but so far it has worked well enough for my purposes once I download the right build of the Sigrok PulseView software.

TimB

#12
A few comments

I have a cheap logic analyser somewhere and it uses open source logic analyser software. Worked ok for me I can send it to you if you want. You are welcome also to borrow my scope for a month or so. I'm round your way tomorrow I can drop them at your front door.

Second, interrupt driven coms is a thing I enjoy writing. I would be happy to look over the process and see if I can spot an issue in your logic.

I doubt the compin will be up to the task to replicate the timing. Better off just having a pic on the SIM to fire data at it. It would not be hard to emulate the timing.

JohnB

Thanks Tim, if its not too late that is a very kind offer.  I have a scope and I am not sure a logic analyser will get me to the problem but I would gladly share my code with you and pick your brains on the issue.  Its been bugging me for a week now.
JohnB

Bravo

I have a Kingst 200Mhz logic analyzer which looks identical to Kcsl's one on Amazon, but a lot cheaper.
https://kingst.aliexpress.com/store/2791035
Retired RF Tech