I am having a bit of difficulty understanding the datasheet for AB18X5 and therefore the library and reference design for AB1805 with a Lithium battery.
The confusion and what appears to not be working is FOUT to D8.
I have built the V1 featherwing and this passes the hwtest.cpp sketch. If I try the periodic-wake.cpp it doesn't work.
Looking at the top of AB1805_RK.cpp I can see this
// Define SET_D8_LOW on FeatherAB1805v1 boards as the pull-up is wired to 3V3R instead
// of 3V3 which can cause current leakages when powering down using EN.
#define SET_D8_LOW
However, on the schematic there is no pull-up to 3V3R? There is no pinMode for FOUT/D8 with INPUT_PULLUP.
The D8/FOUT connection is only used if waking from hibernate sleep using the AB1805 RTC, as the nRF52 RTC does not run in hibernate sleep mode. If you're not using that feature, you really don't need the D8 connection.
The comment was referring to the FeatherAB1805 (not -Li or -SC). In FeatherAB1805 v1, the D8 pull-up was to 3V3R, but this caused current leakage. In FeatherAB1805 v2 there's 100K hardware pull-up to 3V3 which does not have current leakage.
In FeatherAB1805-Li, there isn't a hardware pull-up at all. This is OK because when you specify a wake source on a GPIO on either rising or falling, an MCU pull is enabled on the pin, eliminating the need for a hardware pull-up.
The hardware pull-up could have been removed on all designs, but I didn't do that.
I have the following use case - RTC with battery backup and hardware watchdog both must have requirements. Should have is the ability to set an alarm that will allow the P2 to receive an interrupt and handle it - i.e. start or stop a process.
I am trying to explore the alarm functionality but not making progress - if there is a board issue i.e. AB1805 pin to D8 connection then would this manifest with the test sketch. The register values I am seeing are different from the examples in the sketch - since there is no description I have no way to understand if this is significant. Thanks
static const uint8_t REG_ID0 = 0x28; //!< Part number, upper (read-only)
static const uint8_t REG_ID0_AB08XX = 0x18; //!< Part number, upper, AB08xx
static const uint8_t REG_ID0_AB18XX = 0x18; //!< Part number, upper, AB18xx
static const uint8_t REG_ID1 = 0x29; //!< Part number, lower (read-only)
static const uint8_t REG_ID1_ABXX05 = 0x05; //!< Part number, lower, AB1805 or AB0805 (I2C)
static const uint8_t REG_ID1_ABXX15 = 0x05; //!< Part number, lower, AB1815 or AB0815 (SPI)
static const uint8_t REG_ID2 = 0x2a; //!< Part revision (read-only)
static const uint8_t REG_ID3 = 0x2b; //!< Lot number, lower (read-only)
static const uint8_t REG_ID4 = 0x2c; //!< Manufacturing unique ID upper (read-only)
static const uint8_t REG_ID5 = 0x2d; //!< Manufacturing unique ID lower (read-only)
static const uint8_t REG_ID6 = 0x2e; //!< Lot and wafer information (read-only)
It's fully expected that 2b, 2c, 2d, and 2e will be different because the lot number and unique ID will almost certainly be different from when I ran the self-test on my chip.
Hi @rickkas7 I am back testing the AB1805 Li and library.
Using the example selftest4 software the following test fail:
// Set an interrupt in 30 seconds
ab1805.interruptCountdownTimer(30, false);
SystemSleepConfiguration config;
config.mode(SystemSleepMode::HIBERNATE)
.gpio(D8, FALLING);
System.sleep(config);
// System should reset here
Log.error("TEST_HIBERNATE_30 failed");
testNum = 0;
break;
My guess is that the pull-up really is required. It's on the other boards, but not the AB1805-Li test board. If you can temporarily wire a 10K pull-up from D8 to 3V3 it would be interesting to see if that fixes the problem. You could also try setting pinMode(D8, INPUT_PULLUP).
If you are using stop or ULP sleep you can wake on any pin on RTL872x. If you are using hibernate sleep you can only wake on D10. On the Photon 2, D10 is in the same physical position as D8 on the Boron and Argon but you would need to update the code to use D10.
Also I just remembered that on the P2/Photon 2, in hibernate sleep, RTL872x does not support software pull-ups on D10, so if the hibernate wake tests will fail unless you add an external pull-up to 3V3.
Updated the design files for FeatherAB1805-Li to add a missing pull-up resistor that would affect using it with the Photon 2 for wake from hibernate sleep. Also fixed the code to use WKP instead of hardcoding D8, since WKP is D10 on the Photon 2.
@rickkas7 Top service - I have tested all the options - observation is that the timing (alarm) isn't that accurate - I intend to try some more controlled tests.