Using the ST10F168 Microcontroller CAN

Background
----------
The CAN unit is mapped as an X-Peripheral.  The XPEN bit of SYSCON (SYSCON.3) must be set to activate the CAN unit.

The SYSCON register is protected against inadvertent modifications.  It may not be changed after the initialization instruction EINIT.  An application program must set XPEN while initializing SYSCON if the CAN unit is to be used.  If you run a program under the monitor control, the monitor needs to initialize SYSCON.  You may modify the source code for the monitors (given in a separate subdirectory) and recompile the monitors.  Refer to the Bootstrap Loader Toolkit documents and tools available on Rigel's website for more information.

The ST10F168 microcntroller is similar to the ST10F167, ST10R167 and SAB-C167 processors.  The monitor programs for the R167-FLIC and R167-JIF boards work with the ST10F168 microcntroller, except for the handshake byte 0xD5 rather than 0xC5.  You may simply use the existing 167 monitors, specifying the new handshake byte under "Tools -> Hardware Configuration."

Precompiled Monitors
--------------------
The following bootstrap and minmon files set the SYSCON XPEN bit to allow running CAN routines under the monitor.

Board      Bootstrap File   Minmon File    SYSCON Value
--------   --------------   -----------    ------------
R168-JIF   B68JX.BIN        RMM68JX.BIN    0x8004
R168-FLIC  B68X.BIN         RMM68X.BIN     0x0084


Implementation and Use
----------------------
Copy the monitor files into the database sub-directory under the Reads166 directory.

Specify these files in the Reads166 "Tools -> Hardware Configuration" menu.

Step 1.
-------
Click "New" to create a new record.

Step 2.
-------
Input the following fields for the R-167JIF board:

     Name          : R168J (user preference)
     Processor     : ST10F168 
     Board         : R168-JIF
     Handshake     : D5
     Bootstrap file: B68JX.BIN
     Minmon file   : RMM68JX.BIN
     Monitor file  : RM67J.HEX
     Description   : (optional -- user preference)

Similarly, for the FLIC board, use:

     Name          : R168 (user preference)
     Processor     : SAB-C167CR-LM 
     Board         : R168-FLIC
     Handshake     : D5
     Bootstrap file: B68X.BIN
     Minmon file   : RMM68X.BIN
     Monitor file  : RM67J.HEX
     Description   : (optional -- user preference)

Step 3.
-------
Click the "Post" button.  (Note if you click the "OK" before "Post" the new record is discarded.)

Step 4.
-------
Make sure you select the new hardware configuration in the "Options -> Hardware Options" dialog.

Step 5.
-------
Bootstrap the board.  Observe if there are any error messages on the status line of the Reads166 IDE or in the download dialog box.

Step 6.
-------
Verify that SYSCON is 0x8004 with the monitor "w" command.

    wFF12 <enter>

shows the contents of the memory word 0xFF12 (SYSCON).



