EasyManua.ls Logo

Skyworks Si5338 - Register Write-Allowed Mask

Default Icon
164 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Si5338-RM
Skyworks Solutions, Inc. • Phone [781] 376-3000 • Fax [781] 376-3100 • sales@skyworksinc.com • www.skyworksinc.com 29
Rev. 1.4 • Skyworks Proprietary Information • Products and Product Information are Subject to Change Without Notice • 2021
10.3. Register Write-Allowed Mask
The masks listed in Table 1 indicate which bits in each register of the Si5338 can be modified and which bits
cannot. Therefore, these masks are write-allowed or write-enabled bits. These masks must be used to perform a
read-modify-write on each register.
If a mask is 0x00, all bits in the associated register are reserved and must remain unchanged. If the mask is 0xFF,
all the bits in the register can be changed. All other registers require a read-modify-write procedure to write to the
registers. ClockBuilder Pro can be used to create ANSI C code (Options
Save C code header file) with the
register contents and mask values. AN428 demonstrates the usage of this header file and the read-modify-write
procedure.
The following code demonstrates the application of the above write allowed mask.
Let addr be the address of the register to access.
Let data be the data or value to write to the register located at addr.
Let mask be the write-allowed bits defined for the corresponding register.
// ignore registers with masks of 0x00
if(mask != 0x00){
if(mask == 0xFF){
// do a regular I2C write to the register
// at addr with the desired data value
write_Si5338(addr, data);
} else {
// do a read-modify-write using I2C and
// bit-wise operations
// get the current value from the device at the
// register located at addr
curr_val = read_Si5338(addr);
// clear the bits that are allowed to be
// accessed in the current value of the register
clear_curr_val = curr_val AND (NOT mask);
// clear the bits in the desired data that
// are not allowed to be accessed
clear_new_val = data AND mask;
// combine the cleared values to get the new
// value to write to the desired register
combined = clear_curr_val OR clear_new_val;
write_Si5338(addr, combined);
}
}

Related product manuals