First communication with the ATmega microcontroller

After making the physical connection from your ATmega device to your computer, the next step is to run a terminal program. There are quite a few choices, depending on your Operating System. Few can be tailored and have the features needed to work directly with the ATmega microcontroller as CommTool, the one which we provide, at no additional charge, to anyone who has purchased a device with MIRTOS. Although each copy of CommTool is licensed with a specific MIRTOS device serial number, it can be used with any device that requires serial or USB connection and a text interface. The examples on our website assume that you're using CommTool.

The suggested first CommTool command is with just the "/S" parameter. This requests that the program scan COM1 through COM100 to see which can be opened. It doesn't send anything out of the port, or try to see if anything is connected to it, but just checks to see if the Operating System can open the port then lists which COM ports are available for use and immediately exits the program.

C:\>CommTool /S
CommTool, Version 4.23 - Thursday, April 25, 2019
Copyright (c) 1999 through 2019 by SCADA Support Group, Inc.
Contact: CommTool@SCADASupport.Com
Licensed with Serial Number: SSG Demo
COM1 is accessible
COM4 is accessible
COM5 is accessible
COM6 is accessible
COM11 is accessible
COM14 is accessible

D:\>                                                                            

CommTool has syntax help available via the "/?" command line parameter, which emits the help sequence and exits. The syntax help takes precedence over any other command line switch. That means that if you've started a command line, but can't remember the precise syntax of one of the switches, just append the "/?", display the syntax, press F3 or Up-arrow to repeat the command, use Backspace to delete the "/?" and revise the line and issue the command.

Assuming that our device is connected to COM6 instead of COM1, for example, we would reinvoke CommTool and use the command line parameter "/C6" then press the reset button on the 328P device with a result perhaps something like this:

C:\>CommTool /C6
CommTool, Version 4.23 - Thursday, April 25, 2019
Copyright (c) 1999 through 2019 by SCADA Support Group, Inc.
Contact: CommTool@SCADASupport.Com
Licensed with Serial Number: SSG Demo
1c!`h8#c%jlsz<

D:\>                                                                            

Press the Esc key to exit CommTool.

That strange output is likely because CommTool will default to a 9,600 BPS communication rate. If that occurs, exit CommTool and restart it, appending the second parameter, "/B57600", for example, to set a different communication rate. Note that the order of the command line parameters is not important. Press the device's reset button (or cycle power) and the result will hopefully be something like this:

C:\>CommTool /C6 /B57600
CommTool, Version 4.25 - Thursday, May 23, 2019
Copyright (c) 1999 through 2019 by SCADA Support Group, Inc.
Contact: CommTool@SCADASupport.Com
Licensed with Serial Number: SSG Demo
Copyright, 2013-2019, SCADA Support Group, Inc.
Sonoma, CA 95476  ###.###.####
MIRTOS for 16 MHz Arduino Pro Mini
Version 2.16 - Friday, August 17, 2018
Serial Number: #########
Cause of the last reset: external RESET pin pulled LOW
>>>>>>>>>>>                                                                     

If no readable text was output, you'll have to try a different BPS values until you find one that works. MIRTOS ships from HomeSCADA configured to communicate at 57,600 BPS. The CommTool program can support nearly any BPS value, even very large, very small, or non-standard ones.

CommTool was originally designed in 1992 to be able to provide simple text input and output with any terminal device. Sometimes they were slightly out of spec, so CommTool was coded to overcome that obstacle. Consider a device that was documented to communicate at 38,400 BPS, for example, but either its clock or that of the computer, was just a little bit off. It might actually require 38,380 or 38,392 or 38,411 or 38,425 on the computer side in order to successfully communicate with it.

Let's proceed, assuming you've successfully synchronized CommTool to communicate with your ATmega device. Type "DSE" at the MIRTOS command prompt.

>DSE
EEPROM contents:
0000:  10 21 00 9F 01 00 84 FF-04 00 FF FF 28 01 50 FF  .!..........(.P.
0010:  C0 00 3F FF 60 08 03 67-FF 15 74 FF FF FF FF FF  ..?.`..g..t.....
0020:  22 28 05 00 FF FF 38 FF-FF FF 14 20 00 08 FF FF  "(....8.... ....
0030:  80 16 FF FF FF FF FF FF-90 00 B0 00 80 01 FF FF  ................
0040:  FF FF FF FF F0 01 00 36-FF FF FF FF FF FF FF FF  .......6........
>                                                                               

"DSE" (or "DES") means "Display System EEPROM". It requests that MIRTOS output the content of the first eighty (80) BYTEs of EEPROM to the COM1 command console. They are the system configuration. Some are bitmapped BYTEs, some are BYTE values, and some are WORD values. The meaning of each can be found in the SystemEEPROM.Def definition file.

Once communication and interaction with MIRTOS is established, the next exploration step is to see what commands are available and what can be done with them. MIRTOS comes with a terse online Help, accessed with "?", which is programmed in the user FLASH section so it can be changed or deleted.

>?
? displays this help sequence (** - means intercepted)
0 turns all 3 EISP test outputs (B0, B1, and B2) OFF
1 turns those same 3 EISP test outputs all ON
2 integer to 2 post-decimal digits formatting example
   ...                                                                          

Since the HELP output is much longer, the result above was truncated.

Please refer to the program description webpage for much more detailed CommTool.Exe program documentation.