Added mod to avoid reset of Arduino when USB serial connection is made
THE NORMAL BEHAVIOR OF ARDUINO IS TO RESET WHEN A USB CONNECTION OPENS
The serial communications supported over USB includes the DTS/DTR signals. When a serial connection is instituted by an RS232 device (such as USB on a laptop), signals are toggled that the Arduino detects and issues a reset to itself.
This restarts the 'sketch' running in the Arduino so it is in a known good state, but also watches for a specific data stream at the beginning which is targeted at the bootloader. This is how the development environment uploads new code to the Arduino.
THIS LEAVES CONTROL SIGNALS IN UNDEFINED STATE FOR A SHORT PERIOD
While the processor is reset and running under the bootloader code, the state of various input-output pins on the Arduino is not controlled by your sketch. They assume some default values until you code begins running to set the pins up correctly. For example, an output pin is by default in logic low state.
The 1130 makes wide use of inverted logic, where a logic low signal is the true state of a signal. In particular the signal -Req CS Level 1 when pulled to low triggers a cycle steal to access memory on behalf of our loader. Thus during the reset time we fire off a spurious cycle steal with undefined word value and undefined core memory address.
This is undesirable. Somebody could fire up a terminal while the 1130 is still running a program, causing a random write into memory. My logic in the core loader will not request a cycle steal if the CPU is running, but the pin activity during the reset period is not bound by that protection.
CAPACITOR ACROSS RESET WILL BLOCK THE RESET FROM THE SERIAL CONNECT
The Arduino routes the reset line out to one of the pins around its periphery, where a .1uf capacitor can be soldered with the other end hooked to the nearby ground pin. This 'eats' the short reset pulse from the USB serial connection, preventing the sketch from restarting. It also prevents the Arduino bootloader from running thus an upload of new code will not occur as it usually does from the development environment.
Comments
Post a Comment