Introduction to the board
This board, also known as Olimex, will allow you develop easy Ethernet connectivity applications. It has everything you would normally need for such applications: power relays, LCD display, analogue inputs for connection to sensors, digital optoisolated inputs, trimmer potentiometer, temperature sensor and an Ethernet connector. Another awesome feature about this board is the ability to command most of the board features through a pre-built web interface. This comes in handy with regards to MNS as we will be able to receive updates from the Mimic boards installed on different floors in hospitals at a central point.
The PIC18F97J60 has 128KB flash programming memory. The on board AC/DC converter makes the board very tolerant to the external power supply, which could be in the 9 – 25V DC or 7 – 18V AC range.
Maxi Web TCP-IP board
- PIC18F97J60 microcontroller with embedded Ethernet MAC and PHY and 128KB Flash programming space
- 1Mbit on board serial flash for web pages storage
- ICSP/ICD connector for programming and debugging with PIC-ICD2 and PIC-ICD2-POCKET.
- Temperature sensor
- Trimmer potentiometer connected to analogue input
- Two relays 10A/250VAC
- Four optoisolated digital inputs
- Twelve analogue inputs on terminal block
- Two buttons
- LCD16x2 with backlight
- RS232 interface
- Ethernet interface
- Complete web server and TCP-IP stack support as per Microchip’s open source TCP-IP stack
- Terminal block for power supply works with 9-25 VDC power supply
- Extension header to connect to other boards
- Dimensions 120×108 mm (4.72×4.25″)
- PIC-MAXI-WEB.pdf – User manual
- Understanding PIC WEB boards and Microchip TCP-IP stack tutorial
- Microchip TCP/IP AN833 – please read carefully, the TCP/IP stack is described
- PIC-MAXI-WEB software setup provided by customer of ours Tom Nguyen
Making an ICSP Programmer / Debug Adapter for the Board
The board comes with an ICSP connection that allows us to re program the PIC18F97J60 microcontroller. Below you will see an image explaining the pins on the ICSP connection.
PGD I/O Program Data. Serial data for programming.
PGC Input Program Clock. Clock used for transferring the serial data.
In order to re program the microcontroller you will need to connect the ICSP to a PICkit programmer. As per the below image, you must make sure that your pins are correctly aligned (pin 1 of the programmer is connected to pin 1 of the ICSP).
PICkit 2 connected to the ICSP of the board to program the microcontroller
Programming the Board with the Newest Firmware
Once you have loaded the hex you will get the above warning
Successful writing of the hex to the microchip
Pre and Post Programming of the Correct HEX
We have updated the default hex that comes with the TCP-IP board to suit the application of the board in the Nurse Call environment. The boards come with a ‘TCPStack v5.00’ already programmed into the microchip. The TCPStack v5.00 has a static IP address programmed into the microcontrollers. The static IP address is 192.168.0.95. As we require the IP address to be dynamic, thus we have changed the hex to obtain an IP address from the router. The latest version of the TCPStack at the time of publish, is version ‘TCPStack v5.41v2’. Below you will see 3 pictures of the board during 3 stages of the programing and testing.
The default settings of the board
Once programmed the version changes as well as the IP address
Once you connect the board to your network you will notice that the IP changes
Once you have the board connected to the network and it has received a DHCP IP address, you can run a program called ‘MNS Ethernet Listener Discoverer’. The will search for all the Maxi Web devices connected to your network. This is a very handy program as it displays the IP Address, Host Name and MAC Address of the devices that it detects.
Uploading the HTTP server
Once you have uploaded the latest hex file to the microchip and you are able to discover the board on the network, you will have to upload the web server to the board. If your board is discoverable on the network, you can open your browser and enter the IP address that is displayed on the boards LCD into the browser. In my case I entered the IP address 192.168.16.187. The page will then prompt you to upload a MPFS Image onto the board. If you cannot access the page from the initial page then you can type the following into the browser to access the page <IP_ADDRESS>/mpfsupload i.e. I would type 192.168.16.187/mpfsupload
Once you access the upload page you will be able to browse for the MPFSImg2.bin file and upload it to the board. The upload takes about a minute to complete. The browser might seem like it has crashed during the upload but just give it time to complete. Once completed you can click on the ‘Site main page’ link and you should be taken to the main page.
Uploading the MPFS Image
After uploading my MPFSImg2.bin file, I ran into a problem where the page was not in the correct format (see below image). After downloading a whole bunch of MPFSImg.bin files and still have no success, followed by a Google marathon to try and correct the issue, I realised that my MPFSImg.bin file was missing a define header. I used a tool provided by Microchip called ‘Microchip MPFS Generator’ to rebuild the MPFSImg.bin file and it worked from there.
Incorrect MPSF Image uploaded
Editing the Webpages
You can easily edit the webpage of board and simply upload the newer page once the editing is complete. To edit the webpages you simply have to navigate to the following directory, TCPIP/Demo App/WebPages2 , and you can start editing the webpages from there.
Please note that if you have edited any of the webpages you will have to rebuild the MPFSImg2.bin file and reload that onto the board for the changes to take effect.
Microchip MPFS Generator
Microchip has provided a MPFS Image Generator that we have to use to rebuild our MPFSImg2.bin files after we have edited the webpage. Once you have completed editing the webpages you can simply run the app which looks as follows.
Microchip MPFS Generator
You will have to make sure all the settings are correct in order for the generation to be correct. Follow the below setting examples.
- Source Directory: Point this to the directory which contains the webpages which you wish to generate into the .bin file
- Output: As we need to upload a BIN Image onto the board, make sure that you have selected it. The advanced settings tab can remain on all its default settings
- Output Files: This is the directory where the generated BIN file will be stored
- Upload Image To: We will not be using this option so you can just un check the check box
Once you have completed steps 1 to 4, you can the click the generate button to generate the new MPFSImg2.bin file, which can be uploaded onto the board.
Changing the MAC Address
Once you have uploaded your desired webpage onto the board, it is a good idea to give that board a MAC Address which is specific to that board. It is really simple to change the MAC Address of the board. Once you are on the boards webpage, simply click on the ‘Network Configuration’ tab on the left side of the screen. You might be prompted to enter a username and password. The default username is ‘admin’ and the default password is ‘micro’. Once you have passed the security check you will be able to edit the MAC Address as well as the Host Name of the board as per the below image.
Currently we are defining all the MAC Addresses with a standard of 00:04:A5:5A:00:11 where boards ending in the range of 00:01 to 00:99 are all test and demo boards. You will see that we have given the boards the Host Name of ‘LISTNER’ followed by a unique ID which consists of the last 4 digits of the MAC Address.
We are currently working on a way of automating the process of assigning the boards a MAC Address.