RTC pins
#1
The wiki indicates real time clock (RTC) support under "Expansion Ports" [https://wiki.pine64.org/wiki/Quartz64], but I'm not sure where to connect the coin cell battery holder.

Anybody know where to connect this?

Thanks!
  Reply
#2
(07-09-2022, 01:43 PM)gadgeteer Wrote: The wiki indicates real time clock (RTC) support under "Expansion Ports" [https://wiki.pine64.org/wiki/Quartz64], but I'm not sure where to connect the coin cell battery holder.

Anybody know where to connect this?

Thanks!

Man I've been combing over this site trying to find this too.  So far all I've found is maybe this accessory https://pine64.com/product/lithium-battery-casing/ .  I wish it also had a diagram/pinout since I see a PCB tucked inside there.

There's also a little bit of info on the Quartz64_model-A_schematic_v2.0_20210427.pdf from the wiki on page 21/99 section "PMIC RK817 Managerment" implies a battery model BT2100 should connect.

If anyone else can confirm a working RTC/Lithium battery connection and model I'd also be grateful  Heart
  Reply
#3
Hi, there's two different types of batteries here.

The RTC Battery

This is a battery that will not be recharged by the board, it's simply there to keep the RTC clock ticking while the board is powered off. This is the only kind of battery the Model B supports. The connector for it is right behind the Ethernet jack.

Battery holders that fit this are the following on the store:
No special drivers or anything are needed to make this work, the battery will passively keep the RTC circuitry alive while the board is powered off, making sure that the next time it boots the clock is still more or less correct. The battery not being recharged by the board is fine, it draws so little power from it that it will last for literal years. The CMOS battery in many computers is also non-rechargeable, and I've had some last for a decade.

The Rechargeable LiPo Battery

This is a battery that will be recharged by the board, and will power the entire board when wall power is removed. This is the only kind of battery the Model A supports. The battery chemistry of this is Lithium-Polymer. The charging and discharging of the battery is handled by the RK817 PMIC. The connector is a 3 pin one (Positive, temperature sensor, negative). Any single-cell Lithium Polymer battery will work, provided you modify the device tree accordingly to specify its proper capacity, and make sure the wires on the connector are the right order. This battery will also power the RTC circuitry if the board is switched off, see the schematic diagram of the RK817 PMIC on sheet 21 out of 89 for that: VCC_RTC is connected though a diode to BAT1.

The driver for the RK817 battery charger functionality still has not been merged into mainline as of the time of writing (July 2022). I will be doing some testing on the driver patchset and hope to accelerate its merging into the mainline tree as soon as I get the time to. Before you have such a driver, you should not be connecting a battery to the board, even though the PMIC has safe limits programmed in by default it's better to be safe than sorry.

Once it is merged, I will write a wiki article detailing instructions on how to connect and use a battery with the Quartz64 Model A. I can already tell you that the connector it uses is a 2.0mm type PH connector, here's the datasheet. I've seen that many Lithium Polymer batteries come with a connector like this, but I've had to change the order of wires on one of mine. If you have a passable crimp tool, it's of course also possible to buy the crimps and connector housings and make your own connector.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#4
(07-28-2022, 06:46 AM)CounterPillow Wrote: Hi, there's two different types of batteries here.

The RTC Battery

This is a battery that will not be recharged by the board, it's simply there to keep the RTC clock ticking while the board is powered off. This is the only kind of battery the Model B supports. The connector for it is right behind the Ethernet jack.

Hello CounterPillow, Thanks for the reply and great info.

What about the Model A?  Is that what you're updating on the Wiki?  Reading between the lines, is the model A only able to have an RTC battery after the upcoming driver changes?

I'm trying this out with the ESXi on Arm fling and I'm having issues where it wont load drivers because the signature on the files isn't valid since the board thinks it's Jan 1 2000 (or at least that's my theory at the moment based on the logs I'm seeing).  I'm currently getting an error trying to communicate with the RTC in ESXi; I'm assuming (hoping) it doesn't show up unless it has a battery to keep it going?
  Reply
#5
(07-28-2022, 11:57 AM)jg159357 Wrote: What about the Model A?  Is that what you're updating on the Wiki?  Reading between the lines, is the model A only able to have an RTC battery after the upcoming driver changes?

The LiPo battery on the Model A doubles as the RTC battery. It should work without any driver, the kernel just won't know what the current battery level is and how to charge it, from what I know. So you can connect a LiPo battery to it right now even without having Linux or EDKII drivers, and it should still keep the RTC clock alive.

To use a LiPo battery on Model A, be sure to remove the BAT_ON/OFF jumper when connecting a battery.

As for which batteries can be used, any LiPo with a nominal 3.7V can be used, including several cells in parallel from what I understand. PINE64 sells a case for three 18650 cells in parallel that should work, but if you're just going for the RTC battery you can obviously go smaller.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#6
The information you're giving is amazing CP!

Do you have any more suggestions for me?

When I plug in a 3.7 LPO battery on pins 1/3 and then a 10k 25c NTC from pins 2/3 and have the jumper removed nothing happens. When I apply power the system light turns on/white, about 2-3s later the ethernet light comes on for a half second or so and then the board appears to retry booting. I don't see any display output during this time.


If I leave the battery disconnected with the jumper removed the board exhibits the same symptoms of lights cycling on then off. The port has 0v across the +/- 1/3 pins at this time.

If I have the jumper on when the board is powered, but don't have a battery connected, I read 4.2v on pins 1/3 from the vbat port.

If I have the 3pin connector removed, I read 3.6v between pins 1/3 (little low, but plenty of power in the cell). The resistance between pin 2/3 is 9.98k.

Parts:
https://www.amazon.com/dp/B07LGL7S2G?psc...ct_details
https://www.amazon.com/dp/B01DUC1PW6?psc...ct_details
https://batteryhookup.com/products/2x-sp...ded-insert #individual cell I have on hand that I know is way overkill, but still a 3.7v L-Ion.
  Reply
#7
Your wiring sounds correct, what I suspect may be going on here is that the EDK II port is not configuring the RK817 PMIC right. In such a case, the RK817 PMIC might think it's running into some dangerous condition and resets the board. I tried checking the EDK II repo for anything relating to RK8xx but it doesn't seem to be doing anything from what a quick GitHub search revealed, which means the PMIC is using factory pre-programmed values for its config registers. For what it's worth, u-boot doesn't seem to be setting anything immediately obvious either; it enables under-voltage protection on LDO3 but that seems to be the opposite of what I'd suspect the problem to be. It's possible this is a red herring, but the board resetting itself after a few seconds does smell like a PMIC problem.

Here's the RK817 datasheet with all its register descriptions and such, maybe it's helpful in figuring out what's going on.

By the way, it's also definitely not a battery voltage issue, the PMIC only hard powers down the system in such a case at a battery voltage of like 2.9 last I checked, and it shouldn't be doing that when the board is getting power from the wall.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#8
(07-28-2022, 06:46 AM)CounterPillow Wrote: Hi, there's two different types of batteries here.

The RTC Battery

This is a battery that will not be recharged by the board, it's simply there to keep the RTC clock ticking while the board is powered off. This is the only kind of battery the Model B supports. The connector for it is right behind the Ethernet jack.

Battery holders that fit this are the following on the store:
No special drivers or anything are needed to make this work, the battery will passively keep the RTC circuitry alive while the board is powered off, making sure that the next time it boots the clock is still more or less correct. The battery not being recharged by the board is fine, it draws so little power from it that it will last for literal years. The CMOS battery in many computers is also non-rechargeable, and I've had some last for a decade.

The Rechargeable LiPo Battery

This is a battery that will be recharged by the board, and will power the entire board when wall power is removed. This is the only kind of battery the Model A supports. The battery chemistry of this is Lithium-Polymer. The charging and discharging of the battery is handled by the RK817 PMIC. The connector is a 3 pin one (Positive, temperature sensor, negative). Any single-cell Lithium Polymer battery will work, provided you modify the device tree accordingly to specify its proper capacity, and make sure the wires on the connector are the right order. This battery will also power the RTC circuitry if the board is switched off, see the schematic diagram of the RK817 PMIC on sheet 21 out of 89 for that: VCC_RTC is connected though a diode to BAT1.

The driver for the RK817 battery charger functionality still has not been merged into mainline as of the time of writing (July 2022). I will be doing some testing on the driver patchset and hope to accelerate its merging into the mainline tree as soon as I get the time to. Before you have such a driver, you should not be connecting a battery to the board, even though the PMIC has safe limits programmed in by default it's better to be safe than sorry.

Once it is merged, I will write a wiki article detailing instructions on how to connect and use a battery with the Quartz64 Model A. I can already tell you that the connector it uses is a 2.0mm type PH connector, here's the datasheet. I've seen that many Lithium Polymer batteries come with a connector like this, but I've had to change the order of wires on one of mine. If you have a passable crimp tool, it's of course also possible to buy the crimps and connector housings and make your own connector.

People should click through to the installation guide on that first battery holder. Holds two so that was confusing. Didn't seem right and they are in series so 8v on the meter. Installation guide recommends which slot to put _one_ in.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)