You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Can you copy/paste the following into the left-hand side, and tell me what it says on a Pico where the clock has stopped?

    var RCC = {
      "a": {
        "BDCR": 1073887344,
        "CSR": 1073887348,
      },
      "f": {
        "BDCR": {
          "LSEON": 1,
          "LSERDY": 2,
          "LSEBYP": 4,
          "RTCSEL": 768,
          "RTCSEL_0": 256,
          "RTCSEL_1": 512,
          "RTCEN": 32768,
          "BDRST": 65536
        },
        "CSR": {
          "LSION": 1,
          "LSIRDY": 2,
          "RMVF": 16777216,
          "BORRSTF": 33554432,
          "PADRSTF": 67108864,
          "PORRSTF": 134217728,
          "SFTRSTF": 268435456,
          "WDGRSTF": 536870912,
          "WWDGRSTF": 1073741824,
          "LPWRRSTF": 2147483648
        },
      }
    };
    
    function test() {
      console.log("LSEON",peek32(RCC.a.BDCR)&R­CC.f.BDCR.LSEON);
      console.log("LSERDY",peek32(RCC.a.BDCR)&­RCC.f.BDCR.LSERDY);
      console.log("LSION",peek32(RCC.a.CSR)&RC­C.f.CSR.LSION);
      console.log("LSIRDY",peek32(RCC.a.CSR)&R­CC.f.CSR.LSIRDY);
      console.log(["NONE","LSE","LSI","HSE"][(­(peek32(RCC.a.BDCR)&RCC.f.BDCR.RTCSEL)>>­8)]);
    }
    
    test();
    

    Thanks!

About

Avatar for Gordon @Gordon started