---
title: "[From QnA]WIZ812MJ based on W5100 and PIC16F874 development"
url: "https://maker.wiznet.io/forum/9560"
markdown_url: "https://maker.wiznet.io/forum/9560/md"
type: "Forum topic"
category: "IO Modules"
author: "wiznetmuseum"
created: "2013-09-24T04:40:12+09:00"
last_activity: "2017-05-04T08:30:02+09:00"
language: "en"
views: 862
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# [From QnA]WIZ812MJ based on W5100 and PIC16F874 development

## Question

Asked by wiznetmuseum on 2013-09-24 in IO Modules.

I have module WIZ812MJ based on W5100 and PIC16F874 development board.
Refer W5100_Datasheet_v1_1_8 and WIZ812MJ_Datasheet_V_1.1 i work with WIZ812MJ
PIC16F874 has the same power as the module 3.3 V.
I use direct bus interface mode (p. 59 W5100_Datasheet_v1_1_8), UDP mode. I don’t write MR register. I use default value MR = 0x00 h.

1. At first - power on and reset refer RESET TIMING (p. 64 W5100_Datasheet_v1_1_8)

2. Read default values as RTR0 = 0x07 h, RTR1 = 0xD0 h, RMSR = 0x55 h, TMSR = 0x55 h.

3. Write GATE WAY registers, SUBNET MASK ADRESS registers, SOURCE HARDWARE ADRESS registers.

4. Connect LAN cable from PC to module and do ping and arp command. I see communication and module’s MAC.

5. Then I configure Socket_0 registers: S0_MR = 0x02 h, S0_PORT registers = 0x1388 h, and do open port command S0_CR = 0x01 h. Check SO_SR == 0x22 h - OK!

6. Send UDP packet from PC.

7. Check S0_IR register = 0x04 - interrupt from socket 0 occur and S0_RSR registers. Their value isn’t zero.

8. Clear interrupt - write 0x04 to S0_IR register.
   9)Then I begin to read starting from adress 0x6000. And ERROR occur.
   After I have read one byte from RX memory the HANG occur. S0_IR register, S0_CR register, IR register, MR register, RMSR register, TMSR register accepts impermissible values. I can’t write these registers. But I can read all data (packet) from RX memory. Only RESET (refer RESET TIMING p. 64 W5100_Datasheet_v1_1_8) can help.

If I try to write TX_ memory after steps 1-5 ERROR and HANG occur too.

What is it? What should I do?

## Replies

### Reply 1 by wiznetmuseum, 2013-09-24

Hello Evgeny,
On your testing procedure 9), do not read 0x6000 address to read your received data.
You have to read Sn_RX_RD first, it indicates RX read pointer of RX buffer.
Its value may not 0x6000 because it has a random value when your system was reset.
So you should read 0xXXXX from Sn_RX_RD to get your received data.
After all reading, write the updated pointer value to Sn_RX_WR and execute “RECV” command to update Sn_RX_RD pointer.
For more detail information, you can refer to our updated W5100 datasheet v1.2.2 (updated about Sn_RX_RD and Sn_RX_WR and more).
Thanks.

---

Source: https://maker.wiznet.io/forum/9560
