Writing
[Java Ring] 06. The Cause Was the Battery!
After replacing the built-in battery, maybe...
[Java Ring] 06. Invalid CRC16: Is It Really the Cause?
In the previous article (por-error.htm), I discussed how I communicated with Java Ring from iB-IDE and found that a CRC error occurred after POR correction.
This time, let's delve deeper into this CRC error issue.
Invalid CRC16 Isn't Always the Root Cause!#
Initially, I thought that all problems stemmed from the Invalid CRC error. However, humans tend to consider the last part of an error message as the ultimate problem, which is not always true in this case.
Firstly, after sending data, what appears on the screen is Attempting to correct the POR!. When the IDE detects this, it immediately retries and receives the same error again. Eventually, it transitions to a Bad CRC ... error.
Secondly, during repeated testing with different conditions, I found that the CRC error does not occur every time. It seems that about 3/5 of the cases result in a CRC error, while the rest return another type of error:
<8 0 40 0>[0]This exception occurred: com.dalsemi.onewire.OneWireException: POR of Device is set., Retrying to send the apdu after POR...
com.dalsemi.onewire.OneWireException: POR of Device is set.
at com.dalsemi.onewire.container.JibComm.checkStatus(JibComm.java:644)
at com.dalsemi.onewire.container.JibComm.transferJibData(JibComm.java:426)
at com.dalsemi.onewire.container.OneWireContainer16.sendAPDU(OneWireContainer16.java:2033)
at com.dalsemi.onewire.container.OneWireContainer16.getFirmwareVersionString(OneWireContainer16.java:668)
at com.ibutton.opt.ide.IDEFrame.oneWireArrival(IDEFrame.java:1260)
at com.dalsemi.onewire.utils.OneWireMonitor.notifyOfArrival(OneWireMonitor.java:181)
at com.dalsemi.onewire.utils.OneWireMonitor.pollDevices(OneWireMonitor.java:490)
at com.dalsemi.onewire.utils.OneWireMonitor.run(OneWireMonitor.java:225)
At this point, I began to wonder if the POR error might actually be the real issue.
Investigating Java Ring's Internal Structure#

According to Kingpin's paper from @Stake Inc., it appears that the Java Ring (iButton) contains a Lithium Backup component. From its name, we can infer that this is likely a lithium battery.
The purpose of this lithium battery remains unclear. The literature suggests that there is a 32 kHz quartz oscillator inside the Java Ring contributing to the Realtime Clock; it's probable that this battery powers it. However, whether it also maintains RAM is uncertain.
Assuming the lithium battery does maintain RAM: Cardlets (programs) are likely stored in RAM, and the POR status flag might be kept there as well. If RAM were depleted, the Java Ring would not recover from a POR state, which explains why this symptom could occur.
My Java Ring was manufactured no later than 1998. To my knowledge, there is no coin cell battery that can last for over 25 years. Considering this, I thought replacing the battery might allow it to recover from a POR state.
Battery Replacement?#
After some research, I found someone on YouTube (https://www.youtube.com/watch?v=eyg_7VpKyrU) who had replaced the battery in their iButton.
Their device stopped communicating due to an error similar to mine:

Given that it's Invalid CRC read from device, this seems closely related to my issue. Moreover, replacing the battery restored functionality, which is quite intriguing.
In other words, the CRC errors I've been chasing might not be due to software implementation or CRC calculation issues but rather a result of the iButton's internal battery degradation.
But I'm a Software Guy#
The problem here is that the Java Ring's iButton is enclosed in stainless steel casing. Unlike typical battery compartments, it can't simply be opened and replaced. Furthermore, determining where exactly the battery is located within the device is challenging.
From watching the video, it seems necessary to pry open (cutting the case) of the iButton to replace the internal cell. This involves more physical work than electronic tinkering. Of course, failing to do so properly could destroy the Java Ring itself.
That said, without addressing this issue, I can't proceed past POR correction responses. It appears that replacing the battery is necessary for me as well.
Conclusion#
What did you think?
In this article, I found a video of someone replacing an iButton's battery with similar symptoms to my CRC errors. It seems likely that the problem isn't just software but also due to internal battery degradation.
Next time, we'll explore how to proceed with this battery replacement.
Until then!
Previous: 【Java Ring】05. POR Error!
Next: 【Java Ring】07. Knight Scoop, Let's Meet There!
References#
- Kingpin, "A Practical Introduction to the Dallas Semiconductor iButton™", @Stake Inc., 2000