Serial Port error while sending message

I should also state I have not added any other code, I was just trying to get data to come in so I can view it.

OK, so that dialog is being generated by the SerialDevice’s Error event handler. Set a breakpoint at one of the lines in the handler and examine the passed property “e”, which is a RunTimeException. The RunTimeException has properties of ErrorNumber and Message. Let us know what those are and it may help point to the issue.

this is what I am getting

Sub Error(e As RuntimeException)
#PRAGMA unused e

error number 103

103 is “Hardware detected a break condition. Usually due to a signal rate mismatch.”

Check your baud rates.

checked the baud rate and it is set to match the micro

Show me :slight_smile:

You have to set the Baud property to a class constant. IIRC the compiler allows you to set it to an arbitrary number (like your actual baud rate) but that won’t give you the baud rate you want.

For example, if you want 9600 baud, you have to set the Baud property to SerialConnection.Baud9600, or 8.

image

The baud rate is set to match the micro.

Too a snap of coolterm along with XOJO serial

Reread your message so adding the serial baud to program now to test.

OK, if you’re setting baud rate via the inspector you can’t go wrong - my comment about the class constants were relevant only if you’re setting baud rate in code.

A 'scope or logic analyzer would be really handy right about now


I have a scope that I can use, it just seems strange that the cool term program works fine but the XOJO does not.

CoolTerm is written in Xojo :slight_smile:

Install Free download | COM Port Data Emulator - Freeware and look into what your app is doing differently compared to coolterm. And also give Serial Port Monitor software - serial port, COM port and RS232 port monitor, sniffer and analyzer tool a trial.

1 Like

Snapshot of com port

Cool Term Connected to com port

XOJO Connected to com port

On reset XOJO sent error

coolterm connected and reset sent

You say that the error happens as soon as the micro is reset, and I assume you’re not doing anything on the Xojo side at that moment. This might point to a hardware issue, e.g. the micro is pulling down RXD or TXD when it resets, causing a BREAK. I have no hypothesis for why this doesn’t happen with CoolTerm, though, assuming you’re connecting with the same hardware.

BTW @Robert_Wiser if you’re still struggling with this I just noticed that Roger Meier has published an open-source version of CoolTerm at

https://opensource.the-meiers.org/

If you have a break condition, use ClearBreak to resume

Don’t have a break condition, but thanks.