Disable automatic reset

Post Reply
localhost
Posts: 2
Joined: Mon Jan 28, 2019 2:25 pm

Disable automatic reset

Post by localhost » Mon Apr 01, 2019 3:19 pm

Hello,

Is there any way we can disable automatic reset of Controllino (MAXI) after connecting to Serial port for example ?

Is there any non-hardware way to do it ?

Thank you !

set-comm
Posts: 3
Joined: Wed Apr 10, 2019 11:53 pm

Re: Disable automatic reset

Post by set-comm » Thu Apr 11, 2019 12:03 am

Hello There !
S.O.S.
Same question : Is it possible to disable automatic reset on the MEGA after connect it to PC USB port ? It provokes reset on all input and outputs, and relays back to inactive.
S.O.S.
[It is an important issue to all of us starting using Controllino]

Thanks !

User avatar
Lukas
Posts: 33
Joined: Tue Dec 18, 2018 3:44 pm

Re: Disable automatic reset

Post by Lukas » Fri Apr 12, 2019 10:44 am

Hello,

the only way is to modfiy the firmware of the Atmega16U2 which serves as an USB to UART converter.

The source codes are available, e.g. here https://github.com/jj1bdx/arduino-atmega16u2

The build toolchain is described e.g. here http://www.fourwalledcubicle.com/files/ ... apps.html

Compiled binary then may be uploaded in DFU mode - so you do not need any special device as a programmer.
To switch 16U2 into to the DFU mode you have to open the CONTROLLINO and short circuit two pins at the 16U2 ISP programming connector.

set-comm
Posts: 3
Joined: Wed Apr 10, 2019 11:53 pm

Re: Disable automatic reset

Post by set-comm » Fri Apr 12, 2019 5:13 pm

Thanks Lukas !

I really like this Arduino-PLC integration as it can help me solve some controlling projects for my own company.

Regarding "reset behavior" of the unit, in my opinion, maybe it's gonna be better to use Controllino taking advantage that it is a ruggedized-industrial microcontroller only, and wait until Controllino take care of details in the future (pretty sure they can easily if requested by most of users), cause I'm pretty sure integrators don't want processes reset when in operation just for opening aplications programs via USB port .

I'm using UNO and Leonardo, even managed by Server and my programs (C# pgms/browser) are not affected by this detail...It only happens with MEGA2560 and its CLONS , maybe same firmware. I have not checked with an app via Ethernet port yet, hopefully this can help overcome this commented detail.

Thank you !

User avatar
Lukas
Posts: 33
Joined: Tue Dec 18, 2018 3:44 pm

Re: Disable automatic reset

Post by Lukas » Mon May 13, 2019 11:57 am

Hello,

but the reset via USB COM port is essential for the activation of the bootloader and sketch upload by the avrdude from the Arduino IDE. So we cannot just disable it based on "integrators" request :) Because then we will lose the compatibility with the Arduino IDE ...

Or am I wrong?

Thanks,
Lukas

set-comm
Posts: 3
Joined: Wed Apr 10, 2019 11:53 pm

Re: Disable automatic reset

Post by set-comm » Wed May 15, 2019 5:25 am

Hey Lukas,

Basically the reset we are talking about occurs when you activate your app program (in my case a C#) from a PC USB connected to Controllino MEGA.
I have deployed my app with ARDUINO UNO, ARDUINO LEONARDO and it doesn't reset the microcontroller when you open the program...but in Controllino MEGA. It is important that the program just get the status when you open it and later on you can control it.
I have been using windows10 PC including LATTEPANDA(ARDUINO LEONARDO included) and no problem at all. Maybe you guys have a better understanding of Controllino USB port comm and can recommend/find a fix. In no case the IDE communication was lost.

Thank you !

Marco

User avatar
Lukas
Posts: 33
Joined: Tue Dec 18, 2018 3:44 pm

Re: Disable automatic reset

Post by Lukas » Mon May 20, 2019 10:11 am

Hello Marco,

thanks for the information. We will investigate it and probably prepare a new firmware for the USB-UART converter.

Stay tuned! :)

Lukas

asch
Posts: 3
Joined: Mon May 13, 2019 1:48 pm

Re: Disable automatic reset

Post by asch » Mon May 27, 2019 10:26 am

I have once implemented such a feature that the program could reconnect without triggerning reset. It is possible to disable the use of DTR if serial is programmed low level on the PC side.

User avatar
Jasin
Posts: 4
Joined: Wed Jan 30, 2019 8:35 am

Re: Disable automatic reset

Post by Jasin » Wed Jul 03, 2019 1:18 pm

Hello,

Ad connecting and reconnecting to Serial port of Controllino and Arduino in general.
In C# when You use SerialPort Class there is SerialPort.DtrEnable Property which enables or disables DTR (Data Terminal Ready) signal during serial communication.
When it is disabled connecting and reconnecting to Controllino (tested on Mini, Maxi and Mega) do NOT cause Controllino to reset.

Here is example of my Class and Constructor I used for tests:

Code: Select all

using System.IO.Ports;

    /// <summary>
    /// Defines the <see cref="COMPort" />
    /// </summary>
    public class COMPort : SerialPort
    {
       
        /// <summary>
        /// Initializes a new instance of the <see cref="COMPort"/> class.
        /// </summary>
        /// <param name="aPortname">The aPortname<see cref="string"/></param>
        /// <param name="aBaudRate">The aBaudRate<see cref="int"/></param>
        /// <param name="aDataBits">The aDataBits<see cref="int"/></param>
        public COMPort(string aPortname, int aBaudRate, int aDataBits, bool aDtrEnable)
        {
            // open ComPort
            this.PortName = aPortname;
            this.BaudRate = aBaudRate;
            this.DataBits = aDataBits;
            this.Parity = System.IO.Ports.Parity.None;
            this.StopBits = System.IO.Ports.StopBits.One;
            this.Handshake = System.IO.Ports.Handshake.None;
            this.RtsEnable = true;
            this.DtrEnable = aDtrEnable;
        }
    }
And when I open COM port with aDtrEnable=true it causes reset, but when I open COM port with aDtrEnable=false the Controllino (even Arduino UNO and Arduino MEGA) do NOT reset.

Post Reply