Hi Wolfram, On Tue, Mar 22, 2016 at 5:26 PM, Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote: >> However, the notes for Table 8.2a say there are _2_ possible values: >> >> "The initial value depend on MD14, MD13. >> When MD14=L and MD13 = H, RCLK = 32.89 (kHz) >> In the other setting, RCLK = 32.55 (kHz) > > Well, to be precise, it says the are two resulting frequencies, but for > that, 4 values are needed as you found out. > > >> While the register documentation says there are _4_ possible values, and it >> doesn't document the relation behind these values and the "dividers": >> >> "MD14=0, MD13=0: 6’B00_1111 >> MD14=0, MD13=1: 6’B01_0010 >> MD14=1, MD13=0: 6’B01_0111 >> MD14=1, MD13=1: 6’B01_1111" >> >> I also cannot see how you get to the RCLK/OSCCLK values by using EXTAL >> (33.33333 MHz on final boards) and the dividers above. > > See figure 8.1a. OSCCLK is EXTAL_divider / 8. Internal RCLK is > EXTAL_divider / 8 / 4. So, now assume the lower 6 bits of the RCKCR > register are a standard DIV6 divider where the divisor is the value of > these bits + 1. So, with EXTAL = 33.333MHz and MD14=MD13=1, the register > value becomes 0x1f and divisor = 32. > > So for internal RCLK: 33333333 / 32 (fixed prescaler) / 32 (DIV6) = 32552.1 > > According to the Salvator-X manual, section 2.1.1.9: > > When EXTAL = 20MHz, and MD14=0 and MD13=1, then regval = 0x12, divisor = 19: > > So for internal RCLK: 20000000 / 32 (fixed prescaler) / 19 (DIV6) = 32894.7 > > I tried all the combinations and they match the datasheet precisely. Thanks for the explanation. The numbers didn't match for me, as I had forgotten about the different EXTAL value. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds