Need time help on Axe033 with DS1307

drjeseuss

Member
When I set the time on my Axe033, then call the time, it displays 06/06/22 5:02 EVERY time. The minutes don't increase ever. For the details, I'm using serial mode for the LCD. I can correctly use any/all features of the Axe033 including saving custom messages, etc. I have removed the DS1307 chip and connected to it using I2C and can correctly write/read the time, and the chip keeps perfect time, so I think I can rule it out also. As for the program I've used to send time to the LCD, it's just the standard code in the Axe033 manual (with the added and required 16th space), but for the record:

init: pause 500
main: serout 7,N2400, (253,0,"25/12/01 22:00 ")
pause 1000
serout 7,N2400, (0)
end

If I run this to set the time it shows the time/date as described above. If I create a loop to redisplay the time at interval, it still shows the same constantly, and forever, as though the clock isn't working... but it should be.

Does this sound like bad firmware in the Axe033? Everything else seems to check out ok. Ideas anyone?

Edit: I've connected in I2C mode and can properly set/recall time. It stays accurate even after powerdown/powerup, etc. Once I knew the time was fine I tried serial again, and again it said 06/06/22 05:02 just as before. I tried setting the CLK jumper to see what it said, and also 06/06/22 05:02 just as in serial mode. So I went back to I2C to recall time, and to my surprise, in about 3 minutes (during which it had been connected in serial and CLK modes) it had raced ahead almost 3 hours!

I'd really appreciate any suggestions or otherwise anyone might have about this. I'm leaning toward a bad firmware chip I think. Anyone?
 
Last edited:

westaust55

Moderator
Reading time from AXE033 and writing to LCD

Okay to clarify a few things first:
1. To read the time from the DS3107 RTC on the AXE033 module into this PICAXE, this can ONLY be done using the i2c mode.
2. The time read in from the DS1307 is in BCD encoded format. To write time and or date to the AXE033 LCD you need to extract each digit from the BCD coding and convert to an ASCII value which can be written to the AXE033 display.
3. The conversion from BCD to ASCII characters can be done using the BCDTOASCI command – see manual 2 page 25.

I suggest that you post your complete code so we can see exactly what you are doing and will then be in a better position to guide you to a functioning program.
 

BeanieBots

Moderator
westaust55 just beat me to it.
You can't read the clock in serial mode.

Quote from page 2 of the AXE033 manual.

Which Mode? (serial or i2c)
Most users will use the module in the default serial mode.
The only reason to use it in i2c mode is if:
1) You are using a PICAXE-X, X1 or X2 chip and
2) You wish to read the time/data from the DS1307 clock upgrade directly into the
PICAXE chip.
 

westaust55

Moderator
AXE033 Getting time direct to LCD

Okay and re-reading your Edit,
I believe you are trying to just display the time directly from the DS1307 to the AXE033 LCD using commands in serial mode as per the AXE033 manual page 12.
I too had problems about 6 months ago with this mode trying to display the time but eventually came good. So think you will not find there is a faulty chip.


It came down to this:
The AXE033 only refreshes the LCD clock display when the minute changes. So the screen will stay at whatever it was previously until the next minute ticks over, at this point the new date/hour/minute will then be displayed.
 

drjeseuss

Member
Axe033 Time issue in Serial/CLK modes

To be clear, I know the DS1307 has correct as I have read the time from it accurately in I2C mode. Next, I connected the Axe033 with serial wiring, removed the mode jumper to place LCD in serial mode. I then run the following to "read" (i.e. display) the time:

pause 500
main:
serout 7,N2400, (254,128)
pause 10
serout 7,N2400, ("+")
pause 10
serout 7,N2400, (0)
pause 1000
serout 7,N2400, (254,128)
pause 10
serout 7,N2400, ("-")
pause 10
serout 7,N2400, (0)
pause 1000
goto main

Most of this code is to give the changing +/- to see the LCD/picaxe are behaving properly. Still, the time displayed is 06/06/22 05:02 as always. Also, if I add a jumper to CLK, I get Message1 on line 1, clock on line 2, and again the clock reads 06/06/22 05:02 as expected.

I took the suggestion that it only will update to the new time once minutes roll over. I've had it running for about 10 minutes now, but the time/date sticks. Upon returning to I2C mode, the time is totally messed up (date still correct, but time jumped 4-5 hours ahead), so I had to reset the time/date, just as before.

I'm aware I cannot "read" the time in serial mode. My issue is that when in serial mode, the Axe033 can't properly read the time and display it [serout 7,N2400, (0)]. I have no doubt the DS1307 is ok. The LCD is completely fine in all modes until I try to use any of it's time functions, such as display time, CLK, alarm, etc. It's as though the firmware isn't communicating with the DS1307 properly. In I2C mode, they are effectively disconnected allowing I2C calls to each part seperately, and in this configuration all is well. It's when the firmware trys to interact with the DS1307 that I have troubles. And I find it very strange that no matter what time is set on the 1307 or how long it's been running it will ALWAYS display 06/06/22 05:02 as time/date. Also while in serial or CLK mode, something happens that causes the DS1307's clock to race ahead hours at a time. Thanks for the suggestions so far, and I hope I've explained clearly enough. Any ?'s please ask. Thanks again.
 

BeanieBots

Moderator
OK, does sound like something 'odd' is going on.
For clariity, it might be better to use the term "display" when you want to display the time rather than "read" which in this context is normally associated with what the PICAXE would be doing and not what YOU are doing.

I doubt very much that there is a firmware fault which can result in all I2C functions with the RTC to work AND all serial functions OK but can't 'talk' direct with the RTC.

I don't have the new rev board with I2C so cannot test this for you.
Things to check:-
Make sure when you set the clock that you also start it. (one of the control bits)
Double check your soldering. Make sure there are no solder bridges, especially around the serial/I2C area.
Other than that, lost for ideas.
 

drjeseuss

Member
Crazy behavior only when using time functions in serial mode

"Odd is right! No solder bridges I can see. None even questionable as far as I can tell. As for the clock, when setting, I use control $10 (%00010000) which should enable SqWe. Also the CH bit is set to 0 (ClockHalt off). In I2C mode the clock is perfect. Once switching to serial I noticed the SqWe (I have an LED attached) flashes only once at powerup, then not again. In I2C it flashes per second as it should. Also, this time I noticed after switching to serial, then back to I2c the clock time has fallen behind by about 15 minutes (in a 4 minute period). I tried setting alarm interval to 10s with the following:

init: pause 500
serout 7,N2400, (254,1)
pause 10
serout 7,N2400, (253,9,"00:00:10 ")
pause 10
main:
serout 7,N2400, (254,128)
pause 10
serout 7,N2400, ("+")
pause 10
serout 7,N2400, (0)
pause 1000
serout 7,N2400, (254,128)
pause 10
serout 7,N2400, ("-")
pause 10
serout 7,N2400, (0)
pause 1000
goto main
end
Strangely, the SqWe flashes per second exactly 45 times, then stays off. The program is still running as the +/- still cycles. I get the same result when setting an alarm time as well. [serout 7,N2400, (253,8,"00/00/00 11:00 ")] After these trials, when back in I2C, the clock is 3?/09/08 05:02:00 and counting properly. The time has reverted to the infamous 05:02 for some reason, and the date is September 3? 2008. I'm not sure what day 3? even is... Anyway, it seems any clock functions in serial mode corrupt the clock data. In CLK mode after these trials, the clock reads 06/06/3F 05:02 and the SqWe flashes very randomly. (flash 3sec flash 35sec flash 10sec flash 42sec flash flash 2sec flash...) Once I fix the clock in I2C, it will keep proper time powered or not, unless I use it in serial mode again. I hope somebody knows what this is or how to fix it!

I know I can do all in I2C mode, but it saves a lot of code to use the interval timer for data logging, etc. instead of having the picaxe check the time and decide to log or not. It would certainly make all much easier if I could use the serial time calls.

Edit: I also noticed when all is correct in I2C mode, if I place the CLK jumper, it displays 06/06/22 05:02 and upon return to I2C the clock time/date is 22/09/08 05:02 so it has at least changed the clock's time registers simply by powering up in CLK mode.
 
Last edited:

drjeseuss

Member
Update

Just an update. After my last post, I set the clock in I2C mode, then unpowered (3v backup only). I just checked, and the time is still accurate to the second. I feel safe saying the DS1307 is performing tip-top.

I am curious about the firmware chip on the Axe033. It appears to be a Picaxe 20A. Wouldn't it be possible to build a simple bare bones downloader on breadboard to upload new code to the chip? And to that, does anyone know of a way to get such code? I'm guessing it's not something they'd like to let float around. Then again, the money's in the hardware, not the code as far as I can tell since such code would be useless without the Axe033 hardware. I can only hope.
 

westaust55

Moderator
Axe033 with DS1307

I do not believe Rev Ed are at all likely to give you the code/details for the firmware in the AXE033 controller chip.

What exactly are you trying to achieve (a) long term, and (b) in thinking about reprogramming the AXE033 firmware chip?

Unfortunately, in terms of helping you quickly, my AXE033 is stored away these days as I am using a larger serial comms only 4x20 LCD module and a separate RTC (a DS1338 pin for pin compatible with DS1307) and 3V battery on a home built module.

I will see if I can get time tonight to load up your program and give it a try with my AXE033 if no-one else identifies you problem in the mean time.
 

drjeseuss

Member
Westaust55: My goal with reflashing the firmware is simply to eliminate it as the issue. I can't say I've tried EVERYTHING else, but it feels like it. I hope another set of eyes may see something I've missed. Beyond that, my goal of course is to experiment. I have several projects I'd like to use the module in utilizing the alarm features. Also, if I can only get the clock functions working in I2C mode it eliminates the module from any project with using a picaxe lesser than the 18 (I have an 8 and a 14M I'd like to be able to use it with).

As for the behavior of the module, I'm concerned about the fact that a simply display time call [serout 7,N2400, (0)] would actually change the time in the DS1307. It seems to me that it should internally be READING the time from the DS1307, so why/how would the time change (other than seconds, etc.) when nothing should even be written? I'm afraid I may be stuck with this issue...
 

Technical

Technical Support
Staff member
There does appear to be something wrong with your setup, but it wouldn't be the firmware chip or else nothing would work. The fixed date you get is weird, but not the values you would get if the i2c was not functioning at all.

Our money is on a bad joint/connection somewhere. If you want to send the board back to use we will take a look.
 

westaust55

Moderator
Axe033 with DS1307

Okay, I dug out my AXE033 display - had to insert a DS1307 chip.

Initialised the clock using a small program I had written before.

Then tried you program as given in post 5 and I get the right time (bottom line) with alternating "+" and "-" on top line.

I cannot see any problem in your programs. Attached is the small test program I wrote ages ago and used to initialise the clock and then display the time and character set - all thru serial comms.

If this will not work on your AXE033 then I, like Technical think there is an assembly fault. If the PIC with firmware as faulty you would get no chars on screen,

Code:
main: pause 1000
serout 7, N2400, (254,1) ; clear the screen
pause 500
serout 7, N2400, ("hello Westaust55")
pause 2000
[B]; remove REMs to set time[/B]
; serout 7, N2400, (253,0,"18/03/08 21:30 ")
; pause 10000 ; YES a TOTAL of 10 seconds !!!

b3=127-16
shwtim: for b0 = 32 to b3
serout 7, N2400, (254,1) ; clear the screen
pause 30
serout 7, N2400, (0) ; display the date and time
pause 10
serout 7, N2400, (254,128) ; move to start of line 1
for b1 = 1 to 16
b2= b0+b1
serout 7, N2400, (b2) ; display a different char each loop
pause 2000
next b1
next b0
end
 

drjeseuss

Member
There does appear to be something wrong with your setup, but it wouldn't be the firmware chip or else nothing would work. The fixed date you get is weird, but not the values you would get if the i2c was not functioning at all.

Our money is on a bad joint/connection somewhere. If you want to send the board back to use we will take a look.
Sending it back to UK isn't necessary. While I'd like to get it going, that seems a bit much. I will however carefully check all the board and connections. If I understood your comment, would you say I should first check the I2C connection between the DS1307 and the firmware then? Maybe you can't say, but if I understand things:
-the firmware is a picaxe20
-on the Axe033 the "firmware" connects to the DS1307 by I2C

If both are true, I should be able to work out the traces related to the I2C lines on the board easily. At any rate, I'll have a good look at it all today. Thanks for the help.
 

Technical

Technical Support
Staff member
The chip on board is a custom programmed PIC running a program specific for that board, it is not a PICAXE chip.
 

drjeseuss

Member
I've checked the board for bad joints but all appears ok. Also checked resistors etc. and all seem to meet spec. My only next step I think is to try removing and replacing parts, though I'm not sure which ones could even create the issues I've had. Is there a certain resistor on the Axe that acts as an onboard (serial mode) I2C pullup, etc. that I should check first? Any other places I might check?
 

BeanieBots

Moderator
I'd not start removing things but worth taking out the RTC chip and check that no pins have bent and all fit snuggley in the socket.
Use a continuity meter to make shure there is no short between any of the serial lines and any of the I2C lines.
Check that there IS continuity between ALL the 0v points.
 

westaust55

Moderator
I've checked the board for bad joints but all appears ok. Also checked resistors etc. and all seem to meet spec. My only next step I think is to try removing and replacing parts, though I'm not sure which ones could even create the issues I've had. Is there a certain resistor on the Axe that acts as an onboard (serial mode) I2C pullup, etc. that I should check first? Any other places I might check?
As you can write serially to the LCD and you advise that you can write and read sucessfully to the RTC via i2c comms I believe there is nothing wrong with the serial vs i2c comms mode selection.

You suggest indirectly, that you can write to the LCD in serial mode, so the problem relates to a an error in the AXE033 internally reading from the DS1307 RTC and displaying the date and time on the bottom line of the LCD under serial control.

If you can get text messages on the LCD thru serial comms write commands then I think your soldering connections between the LCD board and the serial/i2c comms interface board are good (otherwise you would have problems with basic test display on the LCD).

The firmware PIC is able to write to the LCD with the right time and date format but does not have valid/correct data from the DS1307. These are both on the same board and factory soldered sockets so no home assembly.

Maybe time to reconsider and take up Technicals offer to send it back to Rev Ed
 

drjeseuss

Member
I have finally decided to seperate the LCD from the Axe033 module. Not my favorite task, but all went well. In the hope that it may be of help, I have posted some pics of the boards. I took several of each side as lighting on the joints was deceptive in a few. Also, there was flux residue on a few of the connection points that appeared like solder due to reflection. The picture resolution is high enough when viewed full size to see many details. If your browser "sizes to fit" be sure to expand them to original size for best viewing.

The first 2 pics are of the LCD board, though I believe this isn't an issue.
http://www.indywebs.com/Axe033/Axe033-1.JPG
http://www.indywebs.com/Axe033/Axe033-2.JPG

The component side of the Axe033 board.
http://www.indywebs.com/Axe033/Axe033-3.JPG
http://www.indywebs.com/Axe033/Axe033-4.JPG

And the trace side.
http://www.indywebs.com/Axe033/Axe033-5.JPG
http://www.indywebs.com/Axe033/Axe033-6.JPG
http://www.indywebs.com/Axe033/Axe033-7.JPG

Picture 7 was after flux was cleaned off. The Project connection header (Out,+,In,-,Cl,Da) are the hardest to tell in these pictures, but they do not touch. I've traced continuity on the ground traces, and also from header to chip for In, Cl, Da but found no obvious trouble. I don't know what could be learned from these pics but hope it's helpful. I agree with Westaust55 that the issue seems to be between the firmware and the DS1307 somewhere, but aside from what's in/under the chip sockets, I'm not sure what more to check. Thanks so far though to all of you!

Edit: After reconnecting things to check again, I noticed the CLK displayed 06/06/25 05:02 which is interesting. It appears in serial or CLK, it's using the date in the year place. Not sure about the 06/06 part, or the 05:02. Also of interest, upon switching from serial to I2C, the clock is changed from current time to 05:02, but the date remains correct. I must say after all the digging into this, I think it's working far too well and predictable for a board issue. I'm starting to point back to firmware, possibly a few lines bad during firmware programming process with this chip. Or maybe even a chip that had a bad memory location or two from birth causing corruption to the firmware's program. Does this sound reasonable?
 
Last edited:

drjeseuss

Member
Well, I've searched top to bottom but see nothing out of ordinary. As I'm currently needing to use the module for a current project, sending back as Technical suggested is out of the question for me at the moment. That said, a few questions.

Is the firmware on the Axe033 the same as FRM010? If not, is there a way to get a replacement firmware for the Axe033? And if it is the same, does anyone know a source for the FRM010 in the US? I've checked SparkFun and WorldEducationalServices, but neither have them. Any ideas?
 

Technical

Technical Support
Staff member
The firmware in the AXE033 is part AXE033-IC, not FRM010. It is available in the store at www.techsupplies.co.uk

Its almost impossible to program a new PIC chip incorrectly in the way you suggest, it either works or it doesn't. However they could become damaged through incorrect connection, although in this case you would expect them to stop working all together.
 

drjeseuss

Member
Technical, normally I'd be one to agree but after checking and rechecking the board I can't really see any reason for the issue. As far as the Firmware, the only reason to replace it would be that it's the next easiest step in eliminating possibilities. I can't find a dealer in the US that carries that part, and if ordered from the UK, the shipping more than doubles the cost. It's not that high, but not something I'm doing in the next few days. In the mean time, is there a datasheer for Axe033-IC that might help in tracing the problem? Or could you at least give me some direction as far as communications between the Axe033-IC and the DS1307. If there is a board issue, it's likely to be there. I assume in serial mode, the firmware and DS1307 "talk" by I2C between each other. In I2C mode the firmware and DS1307 don't commu8nicate to each other at all. Is that correct? I think I have a few places to look more closely, but a datasheet would be a great help in knowing what should be where. Thanks again.
 

geoff07

Senior Member
display time not updating on axe033: solved _8

Posting this in case useful to others even though solved (see below)

I seem to be having exactly this problem in a new setup I have just assembled to manage my solar panel pump. I'm only using serial comms, not i2c. Setting the time seems to work fine. And resetting the attached picaxe causes the display to show the correct time. But when it is left running with a simple loop to display the time (0) string there is no time updating.

As resetting the picaxe does not reset the lcd, but does cause it to display the correct time it must simply be a matter of sending the right command sequence, n'est ce pas? But the code I have used is (I think) in effect exactly what is in the axe033.pdf.

As others have had this problem I would be grateful if anyone had a definitive answer that I have not yet found by searching or playing.

The setup is an AXE033 talking to a 28x2 module (no setfreq) at N2400. The test code is below, minus the declarations etc. The time update commands are commented out but worked when they were needed.

serout lcd,N2400,(254,1)
pause 120
serout lcd,N2400,(254,128,"Solar Controller ",#revision," ")
pause 30
serout lcd,N2400,(254,192,"S.Gillies 2010 ")
pause 500
'serout lcd,N2400, (253,0,"16/10/10 18:32 ")
'pause 1000
repeat:
serout lcd,N2400,(0)
pause 200
goto repeat

stop press: If I move the repeat label to the top. then it updates. Something in the earlier serouts is messing up the time display updating. It isn't the too-long message, as the same happens when I shorten it.

solved: I feel like I'm rambling here. But it may be of interest to know that changing N2400 to N2400_8 solved the problem. Yet the comms worked at N2400 - well almost. And the compiler accepted N2400 for a picaxe 28x2.
 
Top