📄 alert_overview.htm
字号:
<p><font color="#000040" size="2" face="Tahoma"><strong>Step 1:
Understand how ALERT works</strong> and how best to build your
application code around it. ALERT has been designed to be largely
"self-documenting", i.e. the source code and
comprehensive annotation therein should give the developer
sufficient understanding of its workings. The sample program (AT89c5131
debug monitor) shows how application-specific code is best
incorporated, i.e. as a number of background tasks which
interface with ALERT by means of "system calls"...<br>
(System calls are functions which the RTOS provides to facilitate
interfacing of the application code with system resources such as
the real-time clock, timers, serial data communications devices,
digital inputs and outputs, analog inputs, control surface
switches and indicators, displays, non-volatile memory, etc.)</font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>Step 2:
Decide which of ALERT's kernel features are required.</strong>
Customise the kernel module (rtos.c) accordingly. </font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>Step 3:
Decide which of the additional modules are required</strong>, i.e.
CLI facility (including Debug Monitor).</font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>Step 4.
Flesh out the kernel with</strong> <strong>I/O device drivers</strong>
to suit your particular MCU type and peripheral hardware (in
module rtos.c). Use the sample I/O drivers (as provided for the
AT89c5131 evaluation board) as a guide, substituting code to suit
your target hardware platform. (Other sample processors will be
added soon, hopefully. Donations of code would be gratefully
received.)</font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>Step 5:
Extend the kernel module, if necessary,</strong> to provide
support for additional resources, e.g. LCD panel, analog I/O, etc.</font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>Step 6:
Design and code application-specific tasks</strong>, making the
most out of available system calls in the ALERT kernel and CLI
modules. Stick to the guidelines in the Overview section above.</font></p>
<hr>
<p align="left"><font color="#000040" size="4" face="Tahoma">Command
Line Interface (CLI)</font></p>
<p><font color="#000040" size="2" face="Tahoma">A command string
is composed of a 2-letter command "name" and a number
of user-supplied "arguments" (parameters). Some
commands have no arguments. A single space must be inserted
between command line arguments, where there is more than one (including
the 2-letter command name). CLI input is generally not case-sensitive.
</font></p>
<p><font color="#000040" size="2" face="Tahoma">A list of
available commands is output by entering the "help"
command, "HE". Square brackets enclosing a command
argument mean that the argument is optional. (Don't type the
brackets!) Refer to "help" messages for command syntax
details.</font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>USB Comm's
Option (AT89c5131 "Eval" firmware)</strong></font></p>
<p><font color="#000040" size="2" face="Tahoma">The CLI is
accessible from either the USB port or the "RS-232"
async serial port (UART). The sample Eval 'C5131 program starts
up in UART mode by default. The host PC terminal emulator
software must be configured to use 38400 Baud, 1 stop bit, 8 data
bits, and no parity bit. Of course, these defaults can be altered
in the source code and the firmware recompiled.</font></p>
<p><font color="#000040" size="2" face="Tahoma">To switch the
"host serial I/O stream" from UART to USB or vice-versa
during program execution, the host simply sends 3 ASCII 'SYN'
chars (Ctrl+V) in succession. This will set the I/O stream to the
source of the 'SYN' (Ctrl+V) codes.</font></p>
<p><font color="#000040" size="2" face="Tahoma">If using the USB
port, the host PC needs a suitable USB device driver. A standard
USB "Communications Device Class" (CDC) driver should
allow a "virtual" COM port to be configured for use
with any PC application (e.g. HyperTerminal). MS Windows 98SE/98ME,
2000 and XP all have a built-in USB 'CDC' driver. A driver
information file (c5131_cdc.inf) is provided by Atmel for device
installation. Windows' USB device installation wizard may (or may
not) ask for the device information file when the 'C5131 Eval
Board is first plugged in.</font></p>
<p><font color="#000040" size="2" face="Tahoma">HyperTerminal can
be used to access the CLI via the USB port at a signalling rate
of 12Mbps! HyperTerminal will need to be configured to use a
"virtual" COM port, which should manifest itself
automatically when a USB connection has been established between
the host PC and the 'C5131 Eval Board. For example, if the host
PC has four physical serial ports, COM1 thru COM4, then 'COM5'
should magically appear in HyperTerminal's 'Serial Port Setup'
dialogue box as a selectable option. This will only happen if
Windows 'CDC' driver has recognised the 'C5131 Eval Board and
"attached" it. Otherwise, HyperTerminal setup is the
same as for a physical COM port ("direct connect" to
COMx). There is no need to select a Baud rate.</font></p>
<p><font color="#000040" size="2" face="Tahoma"><strong>Setting
up a USB "Virtual COM port" in HyperTerminal</strong></font></p>
<p><font color="#000040" size="2" face="Tahoma">To get
HyperTerminal working in USB "Virtual COM port" mode,
follow these steps:</font></p>
<blockquote>
<p><font color="#000040" size="2" face="Tahoma">1) First,
power up your USB device and connect it to the host PC. Make
sure the device is running your application program (e.g.
ALERT / eval_c5131), not the Atmel on-chip bootloader. You
might need to reset the device. </font></p>
<p><font color="#000040" size="2" face="Tahoma">Assuming the
Atmel 'AT89C5131 CDC' driver is correctly installed, the PC
will recognise the device and make a USB connection, i.e.
"enumerate" it, when the USB cable is plugged in.
If the device is not functioning correctly, Windows will give
an error message saying so. If the device is working OK, but
the driver is not installed, Windows will say "Found New
Hardware" and prompt you to install a driver. The best
way to proceed is to browse to the location on the hard disk
where the driver file (c5131_cdc.inf) was copied, i.e. don't
let Windows search for a driver automatically. </font></p>
<p><font color="#000040" size="2" face="Tahoma">2) Start
HyperTerminal. If first time run, use any arbitrary settings.
It wants to know your location, area code, etc. Anything will
do. Disconnect, i.e. "hang up" (if connected) and
select 'File - Properties' from the menu bar. A dialog box
appears. <br>
Select the "Connect To" tab. In the "Connect
Using" field, select 'COMx', where x is the highest
number shown. <br>
This should be a "virtual COM port". If you get an
error message, close HyperTerminal and start again at step 1.
</font></p>
<p><font color="#000040" size="2" face="Tahoma">3) In
HyperTerminal, click the "Connect" button (if not
already connected) and press Ctrl+V three times. <br>
The ALERT command line prompt (-->) should appear. </font></p>
</blockquote>
<p><font color="#000040" size="2" face="Tahoma">Note:
HyperTerminal seems to be a bit quirky in USB Virtual COM Port
mode. It may be necessary to fiddle around with the USB
connection (disconnect and reconnect the USB cable), and/or reset
the board, and/or restart HyperTerminal, and/or disconnect/reconnect
to the port (HyperTerminal tool buttons), not necessarily in that
order, to establish communications! Remember to hit Ctrl+V three
times after every change until you get the CLI prompt.</font></p>
<hr>
<p align="center"><font color="#800000" size="2" face="Arial">Copyright
2004++ Michael J Bauer</font></p>
<p align="center"><font color="#000040" size="2" face="Arial">Contact</font><font
color="#0000FF" size="2" face="Arial">: </font><a
href="mailto:mjbauer@hotkey.net.au"><font color="#0000FF"
size="2" face="Arial"><u>mjbauer@hotkey.net.au</u></font></a></p>
<p align="center"><font color="#000080" size="2" face="Arial">Website:</font><font
color="#0000FF" size="2" face="Arial"> <u>http://</u></font><a
href="http://www.hotkey.net.au/~mjbauer/free_ip.htm"><font
color="#0000FF" size="2" face="Arial"><u>www.hotkey.net.au/~mjbauer/free_ip.htm</u></font></a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -