Author Topic: Reading Register bits - Big endian  (Read 314 times)

0 Members and 1 Guest are viewing this topic.

Offline FreshmanTopic starter

  • Contributor
  • Posts: 31
  • Country: in
Reading Register bits - Big endian
« on: March 04, 2024, 05:24:22 am »
I am using this device, KSZ9897S, (https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/KSZ9897S-Data-Sheet-DS00002394C.pdf) and this is the errata (https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/Errata/KSZ9897S-Errata-DS80000759.pdf)

I want to disable Auto-MDIX.
Hence, I went to this register, page 127, section 5.2.2.20 PHY Auto MDI / MDI-X Register.

When I went to understand, how to write to this register, I found on page 65 of the datasheet. "For multi-byte registers, the data is addressed in a big-endian format, with the most significant byte at the lowestaddress, and the least significant byte at the highest address,"

Also, with reference to the errata document point 6, I need to write this register as 32bit along with the 5.2.2.21. register PHY Control Register.

Upon default configuration start-up, I got these values for the 5.2.2.20 & 5.2.2.21 REGISTERs - 0x2400 0000.
While I tried to decode the above register values for each bit by big endian format as they mention. But when I do so, it seems that "RESERVED" bits are having some value. But RESERVED Bits should not have any value right? Hence, I assume, I am reading it incorrectly. Please clarify.

I am not able to understand how this value is coming?

Can someone help me to understand the default registers value that I obtained above? And with the same thing, I just want to disable MDIX. Hence, what should be the change I need to do?
« Last Edit: March 04, 2024, 08:52:58 am by Freshman »
 

Offline Zipdox

  • Regular Contributor
  • *
  • Posts: 170
  • Country: nl
Re: Reading Register bits - Big endian
« Reply #1 on: March 04, 2024, 08:36:06 am »
The links don't work, they redirect to the home page.
 

Offline FreshmanTopic starter

  • Contributor
  • Posts: 31
  • Country: in
Re: Reading Register bits - Big endian
« Reply #2 on: March 04, 2024, 08:53:39 am »
@Zipdox, my apologies. I have fixed the links in the original question.
 

Offline Zipdox

  • Regular Contributor
  • *
  • Posts: 170
  • Country: nl
Re: Reading Register bits - Big endian
« Reply #3 on: March 04, 2024, 09:00:06 am »
Okay I found the datasheet. Reserved bits aren't always zero. Page 5 reads "Unless otherwise noted, values are not guaranteed when reading reserved bits." Although I think the register map default values for reserved registers fall into the "otherwise noted" category. As for the default values you read from the register, that doesn't look right to me either. It should be 0x0000 03XX. Could you share some code?
 

Offline FreshmanTopic starter

  • Contributor
  • Posts: 31
  • Country: in
Re: Reading Register bits - Big endian
« Reply #4 on: March 04, 2024, 12:27:26 pm »
Thank you for the answer. Let me get the code in sometime and get back.

1. What does it mean when the datasheet mentions, Unless otherwise noted, values are not guaranteed when reading reserved bits. "?

Does it mean that the values that are present in the reserved bits might be changed when we try to read those? If so, how can we read the register without accessing the reserved bits too?

2. Can you please simply this, "Although I think the register map default values for reserved registers fall into the "otherwise noted" category."
 

Offline Zipdox

  • Regular Contributor
  • *
  • Posts: 170
  • Country: nl
Re: Reading Register bits - Big endian
« Reply #5 on: March 04, 2024, 07:43:26 pm »
1. What does it mean when the datasheet mentions, Unless otherwise noted, values are not guaranteed when reading reserved bits. "?
As it says, there are no guarantees when reading reserved bits, unless explicitly stated.

2. Can you please simply this, "Although I think the register map default values for reserved registers fall into the "otherwise noted" category."
Some reserved registers don't list a default value, others do. The ones that do, are what the datasheet referred to as "otherwise noted".
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf