---
title: "WizNet W7100 on the iMCU7100 evaluation board"
url: "https://maker.wiznet.io/louis_m/projects/wiznet-w7100-on-the-imcu7100-evaluation-board/"
markdown_url: "https://maker.wiznet.io/louis_m/projects/wiznet-w7100-on-the-imcu7100-evaluation-board/md"
type: "UCC: User Created Content"
author: "ben's Hobby"
author_url: "https://benshobbycorner.tk/bzijlstra/software/examples/W7100.htm"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "ben's Hobby"
original_url: "https://benshobbycorner.tk/bzijlstra/software/examples/W7100.htm"
published: "2023-01-31"
language: "en"
hardware: ["WIZnet W7100A"]
likes: 9
views: 396
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# WizNet W7100 on the iMCU7100 evaluation board

> webserver display

Original author: ben's Hobby (source: https://benshobbycorner.tk/bzijlstra/software/examples/W7100.htm)

## Components

- **WIZnet W7100A** x 1 ([docs](https://docs.wiznet.io/Product/iMCU/W7100/w7100a))

## Article

| **Step 1. To-Do...** |
| --- |
| There is a new Circuit Cellar Contest going on, this time with the Wiznet W7100 microcontroller. A controller with a 8051 core and a build in TCPIPCore. 64 Kbytes flash, 64 Kbytes SRAM, 64 Kbytes TX/RX/TCPIP RAM, 256 Bytes data flash. The W7100 has all Special Function Registers as a plain 8051 but there are special registers for the TCPIP-part. What do we have to do? We have to make a W7100.DAT file for Bascom-8051 We have to make an include-file for all W7100 registers Get the LCD working Get something out of the serial port Get the three LED's blinking Get the TCPIPCore working |
| **Step 2: Creating the W7100.DAT** |
| Used the existing REG51.DAT as a template. Here the registers used in the REG51.DAT-file of Bascom-8051 [REG51.DAT](https://benshobbycorner.tk/bzijlstra/software/examples/benshobbycorner.tk/bzijlstra/software/examples/REG51.DAT) Here the registers used in the W7100.DAT-file. In green the new ones. [W7100.DAT](https://benshobbycorner.tk/bzijlstra/software/examples/benshobbycorner.tk/bzijlstra/software/examples/W7100.DAT) In the DAT-file: In the [BIT]-section (all registers that ends with a 0 or a 8), all registers that can be manipulated by bit, and in the [BYTE]-section all others. In the [MISC]-section the name of the microcontroller: **up = W7100** a few interrupts **I_TF2 = 2BI_INT2F = 43I_INT3F = 4BI_INT5F = 5BI_WDIF = 63** the size of the internal RAM **IRAM = 256** The start of the program (jumping over the interrupt-vectors) **org = 66** and as last the clock **clockdiv = 1 ** |
| **Step 3: Getting the first test program in the W7100** |
| We can test the W7100.DAT file with a small program to blink the three LEDs. **$regfile = "W7100.DAT"$crystal = 11059200DoSet P0.3Set P0.4Set P0.5Wait 1Reset P0.3Reset P0.4Reset P0.5Wait 1LoopEnd** We need WizISP to put the BIN or HEX file in the W7100. Connect the iMCU7100 to a serial port on your computer, start the WizISP-program that can be found on the Wiznet-site. Put the BOOT-switch to the right (ON), power the board, select the right COM-port and open the port in the WizISP-program. When you have compiled the above example in Bascom-8051 you will have a HEX and a BIN-file. Load this file. You should see this: With a push on AUTO your W7100 will be erased, blank checked, programmed and verified. And after all is well, it will start. You can leave the BOOT-switch to the right, but when you push the reset button the W7100 will stay in its boot loader. Putting the BOOT-switch to the left and pressing reset will restart the W7100. If all is done correct you will see the three LEDs go on for 1 second, off for 1 second and that is repeated. I have noticed it is very handy to minimize the WizISP program, every time you do a recompile of your Bascom-8051-program you will be noticed like this: When you forget to switch the BOOT-switch to ON you will get an error-message. When you have, later on, HyperTerminal open, you will also get an error-message. If you want every detail of the W7100-registers used, you could have a look here: [**Tutorial Wiz810MJ**](http://benshobbycorner.tk/bzijlstra/software/examples/wiz810mj.htm)** I have written before.** |
| **Step 4: Get the LCD and serial working** |
| Time for the real work, getting the LCD working. Have tested with the Bascom-8051 LCD-commands but it wasn't working. Have still to find why not. But remembered I wrote LCD-routines for the Siemens 80C535 before so used these. And also for the serial port, have to fill two registers to get it working. But don't worry you will see these are the only non-standard Bascom-8051 things to put in. **' second test with the Wiznet W7100$regfile = "w7100.dat"$crystal = 11059200$baud = 115200 ** Put the next values in the registers to get the baudrate right **Tl1 = &HFC ' 115200 baudTh1 = &HFE ** Just for now, a few subroutines to drive the LCD **Declare Sub Lcd_reg(r As Byte)Declare Sub Lcd_char(c As Byte)Declare Sub Init_lcdDim R As Byte ' registerDim C As Byte ' characterDim D As Byte ' temporaryDim Tekst As String * 20 ' string tekstDim Pos As IntegerDim Z As String * 1Reset P0.1 ' R/w LCD displayReset P0.0Call Init_lcd ** After this line you should see something on your LCD **Print "Start" ** And after this line you should see something on your terminal In the next loop the three LEDs should be blinking **DoSet P0.3Set P0.4Set P0.5Wait 1Reset P0.3Reset P0.4Reset P0.5Wait 1Print "X";LoopEndSub Init_lcdWaitms 15Call Lcd_reg(&H30)Waitms 4Call Lcd_reg(&H30)Waitms 1Call Lcd_reg(&H30)Waitms 4Call Lcd_reg(&H20)Waitms 1Call Lcd_reg(&H20)Call Lcd_reg(&H80)Waitms 1Call Lcd_reg(&H00)Call Lcd_reg(&H80)Waitms 1Call Lcd_reg(&H00)Call Lcd_reg(&Hc0)Waitms 1Call Lcd_reg(&H00)Call Lcd_reg(&H10)Waitms 1Tekst = "W7100 and Bascom"For Pos = 1 To Len(tekst)Z = Mid(tekst , Pos , 1)Call Lcd_char(asc(z))Next PosEnd SubSub Lcd_reg(r As Byte)P2 = RP0.2 = 1 'toggle EWaitms 1P0.2 = 0End SubSub Lcd_char(c As Byte)P2 = CP0.2 = 1P0.0 = 1Waitms 1P0.2 = 0P0.0 = 0Waitms 1Rotate C , Left , 4P2 = CP0.2 = 1P0.0 = 1Waitms 1P0.2 = 0P0.0 = 0Waitms 1End Sub** ![](http://benshobbycorner.nl/wp-photos/20091122-140002-1.jpg) |
| **Step 5: Include-file W7100.INC** |
| We have to create an Include-file with all registers of the W7100 in it. If you have seen the W5100-include file for the Wiz810MJ-module you will see a lot of similarity. [**W7100.inc**](http://benshobbycorner.tk/bzijlstra/software/examples/W7100.inc) If we take a look at the TCPIPCore-memory-map: we see FE0000-FE0034 Common Registers FE4000-FE47FF Socket Registers FE8000-FEBFFF TX memory FEC000-FEFFFF RX memory 8 sockets can be used on the W7100 and it is real easy to figure out which registers belongs to which socket. Have a look at a part of the W7100.INC Bascom-8051 include file. 'Socket Mode register Const w7100_S0_mr = &H4000 Const w7100_S1_mr = &H4100 Const w7100_S2_mr = &H4200 Const w7100_S3_mr = &H4300 Const w7100_S4_mr = &H4400 Const w7100_S5_mr = &H4500 Const w7100_S6_mr = &H4600 Const w7100_S7_mr = &H4700 'Channel Sn_CR register Const w7100_S0_cr = &H4001 Const w7100_S1_cr = &H4101 Const w7100_S2_cr = &H4201 Const w7100_S3_cr = &H4301 Const w7100_S4_cr = &H4401 Const w7100_S5_cr = &H4501 Const w7100_S6_cr = &H4601 Const w7100_S7_cr = &H4701 'Channel interrupt register Const w7100_S0_ir = &H4002 Const w7100_S1_ir = &H4102 Const w7100_S2_ir = &H4202 Const w7100_S3_ir = &H4302 Const w7100_S4_ir = &H4402 Const w7100_S5_ir = &H4502 Const w7100_S6_ir = &H4602 Const w7100_S7_ir = &H4702 'Channel status register Const w7100_s0_sr = &H4003 Const w7100_s1_sr = &H4103 Const w7100_s2_sr = &H4203 Const w7100_s3_sr = &H4303 Const w7100_s4_sr = &H4403 Const w7100_s5_sr = &H4503 Const w7100_s6_sr = &H4603 Const w7100_s7_sr = &H4703 |
| **Step 6: Two routines to read and write in the TCPIPCore registers (FE0000-FEFFFF)** |
| Here you see the external RAM of the W7100, 64 Kbytes SRAM, and 64 Kbytes for the TCPIP-core (including RX/TX buffers). Going over the C-examples I have seen the register **DPX0** is used to gain access to this piece of memory. ![](https://maker.wiznet.io/upload/mirror/body/adb36040ab266e8c6e11.jpg) Have written two small subroutines to get access to the FE0000-FEFFFF part of the memory: **Sub W7100_writeDisable InterruptsDpx0 = &HFEOut Adres , ValueDpx0 = 0Enable InterruptsEnd SubSub W7100_readDisable InterruptsDpx0 = &HFEValue = Inp(adres)Dpx0 = 0Enable InterruptsEnd Sub** The 000000-00FFFF can be accessed through Bascom-8051 INP and OUT commands. If you check the WIZMEMCPY.C routine on the CD, or website of Wiznet, you will see a routine to move a bulk of bytes from the lower part of RAM (Embedded RAM) to the RX/TX-buffers (TCPIPCore) and visa-versa. The adresspointers DPTR and DPTR1 are incremented or decremented simultaneous. I think the copy is done with a small routine that can be found in the boot loader. With the **WCONF** register access to the bootloader is managed. Registers **DPX0/1, DPH0/1, DPL0/1** are used for this action. |

---

Source: https://maker.wiznet.io/louis_m/projects/wiznet-w7100-on-the-imcu7100-evaluation-board/
