WIZnet Developer Forum

Mode Register Indirect.

Could someone kindly point me in the direction of the acceptable example for the W5100
that sets the MODE REGISTER to INDIRECT MODE, AUTO ADRESS — Then READS the mode register. I cant seem to get this to work. Neither of them - Do BOTH these work?

Using Wiz812MJ dev board.

So far I’ve tried

W5100 starts off UNPOWERED. All address lines on WIZ are grounded except ADDR0 and ADDR1.

  1. Power up micro
  2. After micro starts up correctly I drive low
    – the WIZ SCS pin (I DISABLE SPI)
    – the WIZ RESET LINE
  3. Micro powers J1 pin 12 of WIZ812MJ on. Waits half second
  4. Micro powers J2 pin 1 of WIZ812MJ on. Waits half second
  5. Drive the 3 HANDSHAKE Lines CS / WR / RD HIGH.
  6. Drive the RESET line HIGH (Releases RESET to let WIZ operate) Waits half second

---- RESET ALL REGISTERS ----

  1. Put value of 0 on both ADDR lines (DIRECT ADDRESS IS 0x0000)
  2. Put value of 0x80 on DATA LINES. Wait 150nS.
  3. Drive CS line LOW. Wait 150nS
  4. Drive WR line LOW. Hold 250nS
  5. Drive WR line HIGH. Wait 150nS
  6. Drive CS line HiGH. Wait 30mS (Presumably I just cleared all registers to default states)

---- SET INDIRECT and AUTO ADDRESS INCREMENT MODEs by “DIRECT ADDRESSING”----

  1. Put value of 0 on both ADDR lines (DIRECT ADDRESS IS 0x0000)
  2. Put value of 0x03 on DATA LINES
  3. Drive CS line LOW. Wait 150nS
  4. Drive WR line LOW. Hold 250nS
  5. Drive WR line HIGH. Wait 150nS
  6. Drive CS line HiGH. Wait 1mS

(Presumably I just loaded the MODE REG with correct data. I’d like to READ THAT BACK! INDIRECTLY)

So ---------- Then to READ ------

---- Attempt to READ MODE REGISTER INDIRECTLY ----

Yeah… Hmmmmmm… Seems you have 2 choices here.

AS one might assume — Choice # 1 The Real McCoy “INDIRECT” METHOD
( by manual Rev 1.2.7 page 61 )

  1. Put value of 0 on both ADDR lines (Yeeessss weird I know. Same as DIRECT ADDRESS 0x0000)
    OH! ----- Wait 150nS
  2. Drive CS line LOW. Wait 150nS
  3. Drive RD line LOW. Wait 100nS (at least 48 right?)
  4. SAVE DATA that appears
  5. Drive RD line HIGH. Wait 150nS
  6. Drive CS line HiGH. Do whatever but certainly –
  7. Marvel at your data - if you got any .

OR as some OTHERS might assume ---- Choice #2. The OTHER Real McCoy Indirect Method (???)

  1. Put value of 0x01 on ADDR0 and ADDR1 lines (IDM_ADR0 MSB ADDRESS)
  2. Put value of 0x00 on DATA LINES
  3. Drive CS line LOW. Wait 150nS
  4. Drive WR line LOW. Hold 250nS
  5. Drive WR line HIGH. Wait 150nS
  6. Drive CS line HiGH. Wait 100nS
  7. Put value of 0x02 on ADDR0 and ADDR1 lines (IDM_ADR1 LSB ADDRESS)
  8. Put value of 0x00 on DATA LINES
  9. Drive CS line LOW. Wait 150nS
  10. Drive WR line LOW. Hold 250nS
  11. Drive WR line HIGH. Wait 150nS
  12. Drive CS line HiGH. Wait 100nS
  13. Put value of 0x03 on ADDR0 and ADDR1 lines (IDM_DR Addr)
  14. Drive CS line LOW. Wait 150nS
  15. Drive RD line LOW. Wait 100nS (at least 48 right?)
  16. SAVE DATA that appears
  17. Drive RD line HIGH. Wait 150nS
  18. Drive CS line HiGH.

19,. Marvel at your data. Which I ---- er - umm “OTHERS” never see anything but “0”'s

Guessing second approach doesn’t work. Right?

Thanks for any time for a reply

After micro starts up correctly I drive low
– the WIZ SCS pin (I DISABLE SPI) <<<< ---------- ERROR… Wrongo!
– the WIZ RESET LINE

Not verified OPTION 1 yet. Where just ADDR0 and 1 are set low(0) and just punch the READ line to see if mode register data shows up on the data lines.
BUT!
Option 2, using the Indirect method and the 2 IDM_ARx registers works - IF you catch the datasheet differences from the W5100 CHIP versus the W5100 implementation on the WIZ812MJ.
Specifically the fact that the WIZ812MJ fiddles with (INVERTS) the SPI ENABLE pin 31,
0= DISABLE , 1 = ENABLE.
Based on the level setting of the SCS signal pin 29. If you have the SCS signal low On the WIZ812MJ (like I did) this gets inverted and sent to the SEN pin 31. IE: Enables SPI mode. Exactly the opposite of what I wanted.

Writing registers, Reading registers and pinging. MUCH BETTER !

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.