6/2/2023 0 Comments Wifi battery monitor![]() The battery-related startup for the board: ArduinoCore-samd/variant.cpp at 020b419fc1dbca49b23b7c0b5e47d50fb2a04485 GitHub - looks to set REG01 to 0x1B which means "charge mode" but p28 of wants 0x2B I think for OTG.| | WiFi SPI | | | | | | | | | | | | | |īut in neither scenario does the 5V pin output 5V when running on battery.| | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK |.| Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H |.I can then surface it to the "Arudino" layer as necessary with a custom Core buildĮdit: have found: arduino/ArduinoCore-samd/blob/master/variants/mkrwifi1010/variant.cpp#L122.If I dig around enough in the Core code (from #1), I can likely find a way to control PA18.PA18 is a GPIO pin of the SAMD21, but will not be exposed in the "Arudino" standard interface.GitHub, which brings it up to a standard "Arduino" interface / library.At a low level, the board is running ArduinoCore-samd/cores/arduino at master.I'm not very au fait with the workings of the Arduino but if someone could tell me if I'm on the right lines here I'd be very grateful: I've been looking into this myself and it seemed that OTG was the key (as well as setting REG01 to 10 via I2C, but that might already be the case). So something ~5V should be available then.Īn easy way to test this is by connecting a USB OTG device to your Arduino and confirming it is powered. This is connected to the 5V node through D3, a PMEG6020. If you pull PA18 low this will activate OTG functionality and the 5.1V boost (If bus voltage is low enough, which it should be since you are running on battery only). This pin is connected to PA18 of the SAMD21 via Q3 (see arduino MKR wifi schematic). This is done by setting the OTG pin to high. If you look at the datasheet of the BQ24195L you can find in section 8.3.1.5 that you can enable a boost to 5.1 volts on the PMID port. ![]() Maybe Arduino team can give us more info too. I don't know I2C programming too well but I'm learning, so if someone with a bit more knowledge want to chip in and suggest some code they're welcome. Which means that the chip it is interfaced but I don't know at what level they have implemented it. I2C device found at address 0圆B ! > This should be the TI chip I2C device found at address 0圆0 ! > This should be the WiFi chip It seems like the the USB monitoring function (D+ and D-) of the TI BQ chip is also not implemented. You can get the 5V only when on USB or external VDC (controlled by Q2). The switching circuit (SW out) is boosting up to 3.8V to be rectified to 3.3V for the board Voltage supply lines (there are 2 of this). The 5V pin will report 3.3V when on battery. The BQ24195L includes boost converter capability and is wired up in such a way that it should be able to generate 5V (at 1A?) at the 5V pin.
0 Comments
Leave a Reply. |