Reading Register bits - Big endian - Page 1
Forum section: electronics / beginners

author: Freshman
author_rank: Regular Contributor
timestamp: March 04, 2024, 05:24:22 am
content: 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?

author: Zipdox
author_rank: Regular Contributor
timestamp: March 04, 2024, 08:36:06 am
content: The links don't work, they redirect to the home page.

author: Freshman
author_rank: Regular Contributor
timestamp: March 04, 2024, 08:53:39 am
content: @Zipdox, my apologies. I have fixed the links in the original question.

author: Zipdox
author_rank: Regular Contributor
timestamp: March 04, 2024, 09:00:06 am
content: 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?

author: Freshman
author_rank: Regular Contributor
timestamp: March 04, 2024, 12:27:26 pm
content: 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."

author: Zipdox
author_rank: Regular Contributor
timestamp: March 04, 2024, 07:43:26 pm
content: Quote from: Freshman on March 04, 2024, 12:27:26 pmAs it says, there are no guarantees when reading reserved bits, unless explicitly stated.Quote from: Freshman on March 04, 2024, 12:27:26 pmSome reserved registers don't list a default value, others do. The ones that do, are what the datasheet referred to as "otherwise noted".