Main Page

2.48

Introduction

This download (example projects download from SBC65EC or SBC68EC product pages) contains example projects for using the Modtronix TCP/IP Stack with different target boards and compilers. Each folder contains one or more MPLAB IDE example project.

All examples are supplied with "*.mcp" MPLAB IDE project files (in "src" folder of example folder). To compile the project, simply install the MPLAB IDE and a compiler, open the project in MPLAB, select the PIC chip in MPLAB ("Configure", "Select Device..." menu) and click on the "Build All" toolbar button. This will compile the whole project and create the hex file.

MPLAB Workspace files (*.mcw) are also supplied for different hardware version of each board.

The name of the MPLAB project file indicates the following:

The name of the MPLAB project file has the following format: projectname_target_bootloader_compiler.mcp

Some example project names and their meanings are:

Some Modtronix Ethernet enabled boards are delivered programmed with a network bootloader for updating the firmware. Such a board can be identified by a BLN Vm.nn label on the front of the board - normally stuck on the RTL8019AS 100 pin network chip. Where Vm.nn is the version number of the bootloader. These boards can be programmed without a PIC programmer.

Program Versions

When using the MPLAB C18 compiler and MPLAB, you have to ensure that the versions of both programs are correct. Click here for details. The MPLAB C18 projects included with this download have been configured for MPLAB C18 V3.02 or higher, and MPLAB V7.22 or higher.

When using the HI-TECH PICC18 compiler, V8.35PL3 or higher should be used. This project was tested with V8.35PL3.

Specifying the target board and PIC device

Each MPLAB project will create code for a specific target board. The target board can be specified in one of two places:

Most projects included with this download use the MPLAB project file to specify the target board. To modify such a project for another target board, right click on the project in MPLAB, select "Build Options...", and in the "Macro Definitions" edit box modify the "BRD_XXX" define for the required board, for example "BRD_SBC65EC".

If the target board is defined in the "projdefs.h" file, the following line in this file has to be changed to compile the project for a different target board.

 #define BRD_XXX 

Additionally the PIC microcontroller has to be specified in MPLAB before building the project. This has to be the PIC used on the target board. This is done in the "Configure", "Select Device..." menu in MPLAB. For example, to compile for the SBC68EC, select the PIC18F6680 chip in MPLAB.

The following target boards are currently supported:

   * All SBC65EC boards with HW version higher than HW2.11, use the HW2.11 projects.    * All SBC68EC boards with HW version higher than HW2.21, use the HW2.21 projects.

Compiling code for the Bootloader

When compiling code for use with a bootloader, the code starts from address 0x800 in stead of at address 0. The bootloader lives in the code space 0x0 to 0x7ff.

To create a new MPLAB project for a target board with a bootloader, do the following:

Compiling code for use without Bootloader

When compiling code for use without a bootloader, the code starts from the normal location (address 0) in stead of from address 0x800.

To create a new MPLAB project for a target board without a bootloader, do the following:

Programming a board with a bootloader

Some of the Modtronix Ethernet enabled boards have a Network Bootloader installed on them. The firmware on these boards can be updated without a PIC programmer. For details, click here.

Programming a board without a bootloader

When the project has been compiled for a target board without a bootloader, a PIC programmer has to be used to program the target board. For details, click here.

Modifying And Updating The Web Pages

Some example projects have web pages that have to be put on the target board, and are used for web based control and monitoring of the target board. The source code for these web pages are always located in the "../src/webpages/" folder of the example source code.

Web files can not be uploaded to the Modtronix TCP/IP Stack individually. All files have to be compiled into a File System Image, and then this image is uploaded to the target. The Modtronix Network Bootloader application is used to create and upload this file to the target Ethernet board. The following methods can be used to upload the File System Image to the target board.

Uploading the File System Image with the Modtronix Network Bootloader

The simplest method is to use the built in FTP server of the Modtronix Network Bootloader. Simply click on the "Upload Web Page" button, and the File System Image is uploaded to the board at the given IP address.

Uploading the File System Image with a FTP client

A FTP client can be used to connect to the target board and upload the File System Image. The default user name is "admin" and the password is "pw". After connecting to the target board, simply upload the entire File System Image file. After doing this, the target will contain the new Web pages.

Total Commander is a great free application that can be used to do all ftp transfers. It can do much more then just ftp. To upload the File System Image with Total Command, do the following:

Uploading the File System Image via the Xmodem protocol

A Terminal program capable of sending files via the Xmodem protocol can be used to send the File System Image file to the target. For this to work, the target has to be connected to the PC running the Terminal program (HyperTerminal on Windows for example) via its RS232 port. After powering up the target board, enter RS232 configuration mode by following the instructions displayed on the Terminal program. Then select "Download File System Image" from the menu, and send the created "File System Image" file via the Xmodem protocol. In HyperTerminal, this can be done by selecting the "Send File..." menu item in the "Transfer" menu. This will open the "Send File" dialog box. Select Xmodem protocol, and send the "File System Image" file created with the Modtronix Network Bootloader program. After doing this, the target will contain the new Web pages.

mxsecbar18.gif
mxsecbar20.gif
mxsecbar22.gif

Generated on Wed Jul 11 11:34:38 2007 for Example Projects by  doxygen 1.5.2