RX8025 stuck


my clock RX8025 embedded in a stalker 2.0 is stuck when initialize , at command wire.entrasmission(). I’m using the yout aìstriker_logger_am06 project

what can I do?

Thanks as usual!


Here the code, is just the implementation of class RX8025 of your project:

[code]#include “WProgram.h”
#include <Wire.h>
#include “RX8025.h”

#define RX8025_address 0x32

unsigned char RX8025_Control[2]=

void setRtcTime(void)
for(unsigned char i=0; i<7; i++)

uint8_t bcd2bin (uint8_t val)
return val - 6 * (val >> 4);

uint8_t bin2bcd (uint8_t val)
return val + 6 * (val / 10);

void getRtcTime(void)
unsigned char i=0;
RX8025_time[i]= Wire.receive();//not use
RX8025_time[i]= Wire.receive();

year = bcd2bin(RX8025_time[6]&0xff);
month = bcd2bin(RX8025_time[5]&0x1f);
date = bcd2bin(RX8025_time[4]&0x3f);
week = bcd2bin(RX8025_time[3]&0x07);
hour = bcd2bin(RX8025_time[2]&0x3f);
minute = bcd2bin(RX8025_time[1]&0x7f);
second = bcd2bin(RX8025_time[0]&0x7f);

void RX8025_init(void)
Wire.beginTransmission(RX8025_address);//clear power on reset flag, set to 24hr format
for(unsigned char i=0; i<2; i++)
Serial.print("sent: " );Serial.print(i);


No idea?


For now I’ve bought a RTC in replacement of this one, but i would really like to know if I have any chance to make it work again, because it has worked for a while!


I would like to know what do you mean by ‘stuck’ ?
I got once, my stalker RTC didn’t tick. (only give date time at the time the sketch downloaded)
Many codes am try, but no luck.
So, I remove all power source, and drain the super cap with my ampere meter.

Once running, the code complaint about time not set.
After set the time, the stalker RTC ticking again.

Until now, i got another problem.
The RTC randomly give 25/45/165, and the stalker stop writing to memcard.
I guess i will create new thread about that.

I hope your problem solved, or maybe it should be replaced ?

Now I’ve just ordered another RTC, again seeedstudio (the one in “brick” package, with the female-male jumper to use directly in Arduino)…Even if they are not helping us with this problem

Unfortunately I have to confirm the observation of akulahpathub concerning the random wrong reading of RX8025. Yesterday I ran my first test sketch taken from wiki pages. It logs temp, battery voltage etc. I connected Stalker to USB via UartBee and battery plus solar panel to their sockets. Everything including charging looked fine until I got battery voltage 4,20 volts when the board sized with LED D8 lit continuosly. As it happened few times I thought it can be something wrong with the end of charging process, but then I observed the same stupid date reading as akulahpathub “25/45/165”. After a few reloads of the sketch I found out that I’m able to change the date/time data in RX8025, but the clock is not running. So I had to discharge the supercapacitor in order to restart the clock …
I left the sketch running overnight to check the power consumption but unfortunately in the morning I found the board sized again … Now it is running for already 3 hours but in fact I’m waiting when it will happen again …

Finally there is the statement “CH_bat_not_exist” for charge_status = 0x08. I can get all other three statements for charge_status depending on battery condition, but I can’t get that last one for (according to me) disconnected accu from the socket. Am I right or charge_status = 0x08 belongs to completly another situation ??

I also have been having similar issues.

I have the Stalker 2, using the demo sketch.
Everything was running fine logging the temperature and battery voltage and charge status for a day or so.
Now the sketch runs a few hours, or a few loops and the LED (Pin 8) stays on solid until resetting.

I do not have any shields installed.
I have tried several SD cards.

The only thing I have changes is, I have set the SS jumper to use PB1 instead of the default PB2.

As mentioned in another post, I am not able to get the charge status 0x08.
If the battery is removed, i get both red and greed charge indicators and the charge status results is 0x02 “Charge Complete”.

What needs to be changed to correct:
#1 - Hanging of the Stalker.
#2 - Unable to detect “No Battery Installed”

Possible reason, Wire library is hard coded for 100Khz I2C speed and a 16Mhz processor. This can be fixed by 2 changed files with 1 addition and 5 deletions.
25 //#define ATMEGA8
27 - #ifndef CPU_FREQ
28 - #define CPU_FREQ 16000000L
29 - #endif
30 -
31 #ifndef TWI_FREQ

80 cbi(TWSR, TWPS0);
81 cbi(TWSR, TWSP1);
82 - TWBR = ((CPU_FREQ / TWI_FREQ) - 16) / 2);
82 + TWBR = ((F_CPU / TWI_FREQ) - 16) / 2);

Check the issues on the Aduino code.



I have the same problems you describe in this forums. Bogus dates, and the thing just hanged. I tried the mod from Raider, but that also did not work.

I then downloaded the data sheet and had a look. Everything looked ok. Then I saw this

In the INIT CODE BELOW: (see line 5)

1void RX8025_init(void) 2{ 3 Wire.begin(); 4 Wire.beginTransmission(RX8025_address);//clear power on reset flag, set to 24hr format 5 Wire.send(0xe0); 6 for(unsigned char i=0; i<2; i++) 7 { 8 Wire.send(RX8025_Control[i]); 9 } 10 Wire.endTransmission(); 11 //setRtcTime(); 12 }

You will note from the data sheet that the control register is market as E. In line 5 we write to 0xe0

now i think in HEX - e = 14, and e0 = 224 or something.

Cant this be the issue? shouldn’t line 3 read:
5 Wire.send(0x0e); AND NOT
5 Wire.send(0xe0); ???

I have changed this, reset the board, drained the cap…lets see what happens. i also wrote a reset function that i modified from source.ridgerun.net/svn/leopard … c/rx8025.c

here is the code…not sure if it will work though

[code]#define RTC_CTL2_REG_ADDR 0x0f
#define RTC_CTL2_BIT_PON 0x10
#define RTC_CTL2_BIT_VDET 0x40
#define RTC_CTL2_BIT_XST 0x20
#define RTC_CTL2_BIT_VDSL 0x80

void RX8025_reset(){

    char ctl2;

 //read the control register
    ctl2 = Wire.receive();
    // rtc_read(RTC_CTL2_REG_ADDR);
    //do some stuff

    //write some calue to it
//rtc_write (RTC_CTL2_REG_ADDR, ctl2);


Ok my fix of e0 to 0e did not work.

Did some more reading. Seems the Wire.begin should only be calle once… the temp sensor calls this aswell so i commente out the Wire.begin there.

Also – there is no need for a wire.endtransmission after a read. as is in the readrtc function…

still not working though. faaaaaaak!

I have a similar problem here. Draining the super cap solves VERY temporarily the stuck RTC, no more than a couple of minutes. :frowning:

a constantly get about 50,000 reads to the rtc then it gets stuck… so exited about the board, but have to ditch it now.

it gets stuck in the wire.endtransmission. if you minimise the calls, the performance improves and then it just faks out

hi guys,

We are sorry for the problems taking.
Please try this libraries with your Stalker v2.0b and Stalker v2.0.
garden.seeedstudio.com/images/c/ … ibrary.zip


I have started to play with my second Stalker with a new library for Stalker 2.0b and 2.0. I ran the sketch for adjusting of the RTC and after its proper setting the monitor have been running for 7 minutes only and Stalker is stucked. Herebelow is the end of the log:


2011/8/8 19:36:45
2011/8/8 19:36:46
2165/165/165 85:13:47

2165/165/165 165:25:48

2011/8/8 19:36:49
2011/8/8 19:36:50
2011/8/8 19:36:51
2011/8/8 19:36:52
2165/165/165 1:36:53

2011/8/8 19:36:54
2025/8/8 19:36:55
2165/165/165 165:75:5

2165/165/165 1:36:57

2011/8/8 19:36:58
2165/165/165 165:45:58

2011/8/8 19:37:0
2011/8/8 19:37:1
2165/165/165 165:17:0

2165/165/165 19:37:3
2165/165/165 12:37:4

2011/8/8 19:37:5
2165/165/165 6:37:6

2011/8/8 19:37:7
2011/8/8 19:37:8
2165/165/165 165:165:25

2011/8/8 19:37:10
2011/8/8 19:37:11
2000/8/8 19:37:12


I’m afraid that the RTC problem persists even with new library …


I just removed the super capacitor (and the resistor R2 + diode D5 through which it was charged) and placed a CR2032 held by two pieces of tin. Not the most elegant hack, but it works. Now the RTC is working fine.
I believe RTC was fed a Vcc too close to its max specification and some of th RTCs didn’t work properly at this voltage.

My clock will run, with just the USB5V power. However if a fully charged Li-ion battery is added, the clock stops; and if you do a search, for I2C addresses, the only one that is found is the TMP102 chip at 48. The voltage feeding the super capacitor increases by over a volt when the LI-ion battery is connected. Would placing a zener diode of 3 volts, in place of the 1N4148 (D5) diode, keep the voltage in the range of the RX8025 chip?

That’s it, my Stalker 2.0 got this disease too.
It was fine for a couple of weeks since I got it, running on USB or LiPo. Until today.

What’s interesting, it is running just fine, then one line with “2165/165/165”, OK for a while, two lines with wrong time, OK for a while, and then comes the “165” time more and more until it simply halts.

Yes, I’m using the newest library from Seeedstudio.


How about a fix for the RX8025 clock, so we can use it with our Lithium-ion battery and solar panel!!!

Thank you,

I’ve met the same problems with RX8025 on Stalker v2:

  1. suddenly got only zeros instead of correct time
  2. two wire library hangs somewere inside.
    I gues that 10k pullup resistors on SDA and SCL lines is not enought.
    So I simply add two 3k3 resistors from 3.3v to sda and scl lines on Analog IN connector.
    Few days testing is OK.