Page 2 of 2

Re: Behaviour of SER_BUFF in QPC & SMSQ/E

Posted: Fri Jan 19, 2018 12:59 pm
by tofro
martyn_hill wrote: For the QLUB project, I appear to need to extend the SERial buffer beyond the (old) default of 81 bytes to ensure messages are not split when transmitted via the virtual COM/USB port to the microcontroller and the SER_BUFF procedure seems to achieve this nicely when running my SBASIC test 'wrapper.'
On second thought, I feel you're doing something wrong when trying to use buffering in order to ensure message integrity. The serial line is just a bit pipe - if you want it to transfer "packets", you need to implement that packetizing yourselves (like framing, headers, counting bytes you want against bytes you have, ...). Especially on an emulator that uses an emulated hardware like an USB-to serial through a foreign operating system, there's simply way too much buffering involved on various levels (SMSQ/E, QPC, Windows, the adapter,...) you can't even control.

Tobias

Re: Behaviour of SER_BUFF in QPC & SMSQ/E

Posted: Fri Jan 19, 2018 6:56 pm
by martyn_hill
Hi Tobias, Marcel and other posters :-)

In summary, looks like my earlier conclusion that the size of buffer internal to SMSQ was causing the comms problems/fragmented USB packets with the uC were a red-herring after-all.

I don't hit the problem these days - I'll try removing the SER_BUFF call altogether and check again.

As for the discussion around USB to Serial adapters - I have had similar experiences when connecting laptop with USB to QL Serial ports (having purchased and tested several of the less-cheap models out there) - I''ve yet to get any reliable results unless I use a native COM port at the PC end (like when I dock my laptop and connect the cable to the dock itself.) Even those that purport to support hardware handshaking are flaky.

In the context of the QLUB adapter however, this isn't especially relevant, as the uC I've selected has a native, on-board USB port (not the typical 'uino Uno 2-piece arrangement) and the driver in Windows simply emulates/presents a serial port to SW. Its really USB all the way in hardware - only pretending to be serial inside Windows and therefore QPC.

Thanks for the feedback!