Mintoris Forum

Author Topic: Arduino USB serial communication problem  (Read 3390 times)

Operator

  • Full Member
  • ***
  • Posts: 14
Arduino USB serial communication problem
« on: Aug 23, 2014, 12:50 PM »
Hello, I have some issues, questions playing with Mintoris and some Arduinos…

Arduino UNO R3 / Mintoris 6.3.3:
1) How must a data$ string end to be recognized by UsbReadln ?
If using the basic sketch AnalogReadSerial which prints the data with "line feed/new line"
I get a syntax error: Expecting end of line…
(No Problem if UsbRead is used instead)

2) If all the data received is just printed, then Mintoris gets slower and slower ( guess it stores all that data ).
Is there anything that can be done with all that data being OFF screen‥?
(If a CLS command is included after say 30 records, then the speed is mantained)

3) If I disconnect the OTG cable while data is being sent and received, UsbGetState will remain in State 1,
so it does not detect the disconnection…(?)

Arduino Micro R3 / Mintoris 6.3.3:
1) While running USB diagnostics: No UsbSerialDriver available…
Could this be solved in a future Mintoris update ?
Has anyone a workaround ?

Arduino Leonardo R3 / Mintoris 6.3.3
1) While running USB diagnostics: driver is OK, but no data is received.
Leonardo/Micro require RTS and/or DTR Line to be "high" in order to send data.
(UsbTerminal App has such control features and I can read after toggling one of
those lines)
Could this be solved in a future Mintoris update ?
Has anyone a workaround ?

Code used:
Code: [Select]
' Test for reading usb serial
' Open a USB serial device.
' Mod to just read some data from Arduino

device$ = UsbGetFirstDevice$()

if device$ = "" Then
  Print "No device connected"
Endif

UsbOpen 1, device$, 9600, 8, 1, 0

Print "State: "; UsbGetState(1)
Print "Error: "; UsbGetError$(1)

Print "Vendor ID: "; UsbGetVendorID(device$)
Print "Product ID: "; UsbGetProductID(device$)
driver$ = UsbGetDriverName$(device$)

if driver$ = "" then
  Print "No driver - Device not supported"
 Else
  Print "Driver: "; driver$
Endif

if UsbGetState(1) <> 1 then
  Print "Connection failed"
  End
Endif

Print
T0 = Time()
Looop:
if UsbGetState(1) = 1 then
  size = UsbGetSize(1)
  'print "Size: "; size
  if size > 1 Then
    UsbRead 1, data$, size
    Tstp = Time()-T0
    T0 = Time()
    Print "#: "; Tstp, size, data$;"®"
  Else
    Print "data size is 0"
    Print UsbGetState(1)
  Endif
Else
  Print UsbGetError$(1)
  Print UsbGetState(1)
  Print "State <> 1"
Endif
wait 200
'CLS
Goto Looop
« Last Edit: Aug 23, 2014, 01:52 PM by Operator »

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Arduino USB serial communication problem
« Reply #1 on: Aug 25, 2014, 02:40 AM »
I'll look into these issues this week.

-Chuck

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Arduino USB serial communication problem
« Reply #2 on: Aug 25, 2014, 09:57 PM »
Arduino UNO R3 / Mintoris 6.3.3:
1) How must a data$ string end to be recognized by UsbReadln ?
If using the basic sketch AnalogReadSerial which prints the data with "line feed/new line"
I get a syntax error: Expecting end of line…
(No Problem if UsbRead is used instead)

I would have to see your UsbReadLn command.

It should look something like:

UsbReadLn 1, data$

At a guess, I would suggest that there is no size parameter on the UsbReadLn command.

-Chuck

Operator

  • Full Member
  • ***
  • Posts: 14
Re: Arduino USB serial communication problem
« Reply #3 on: Aug 28, 2014, 06:22 AM »
Hello Chuck,
thx for your feedback.
The basic code used is included in the
first post (just scroll down).
I will experiment omitting the size
comand which I use to make sure
the "buffer" is empty after one usbread.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Arduino USB serial communication problem
« Reply #4 on: Aug 28, 2014, 06:01 PM »
Quote
Arduino Micro R3 / Mintoris 6.3.3:
1) While running USB diagnostics: No UsbSerialDriver available…
Could this be solved in a future Mintoris update ?
Has anyone a workaround ?

If you would like to do some testing to try and get this Arduino working, send an email to support@mintoris.com.

I need to know the vendor ID and product ID for the Arduino Micro R3. Also, do you know what usb/serial chipset is used in this microprocessor? If it uses a supported chipset, it will just have to be added to the supported device list.

-Chuck


Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Arduino USB serial communication problem
« Reply #5 on: Sep 11, 2014, 02:19 AM »
This problem was solved in Basic 6.4 by the addition of the UsbSetRTS command.

-Chuck

Operator

  • Full Member
  • ***
  • Posts: 14
Re: Arduino USB serial communication problem
« Reply #6 on: Sep 11, 2014, 10:53 PM »
Thanks for the update…
Now Arduino Leonardo/Micro work  ;D