Cannot display time from DS1307 to the AXE033 LCD module

PaulHetrel

New Member
Dear readers,

I've built the hardware for a clock project that employs an AXE033 LCD display module with optional clock upgrade using ic2 mode and interfaced to a 28X1 chip.

I can readily display text on the program using the ic2 test programming example (refer document AXE033.pmd v4.1 pg 6). My problem is that when trying to display a clock time on the LCD screen, it is blank. The conditions and other details of the programming and hardware configuration are this:

• The output LED from the DS1307 flashes twice in quick succession every 1 second as if the output is being reset.

• I have the 28X1 mounted on a project development board and removed the 10K resistor array from it and provided my on own pull up resistors for the switch inputs used for the project.

• Note the AXE033 has its own pull up resistors for the sda/scl lines. The SDA/SCL lines are OK as far as continuity from the DS1307 to inputs 3 and 4 of the 28X1

• ic2 mode used as per instructions set out in above referred doc. (AXE033)

• Using a 4.5V rail (3 x 1.5 batteries) with voltage protection diode shorted.
• I have linked (J1) in the clock module to operate in Ic2 mode. Voltage at the Vcc pin of the DS1307 is sitting at about 4.7V. I have ramped this up to 5.0V.

• The contrast setting is OK as would be expected with a text output.

• I have tried using the Hic2 commands in place the ic2, slave, write and read commands as recommended by the basic commands manual.

• I have tried reading from data memory using the EEPROM command rather than the DS1307 registers, but still failing to display anything.

• I have loaded sample times into the registers of the DS1307 and initialised the DS1307 & LCD display .

• Appropriate conversions of the time data from BCD to ASCII have been done.

My questions are:

What is causing the display to fail reading/writing from the DS1307?

Is there a basic RTC clock set-up test program that would work for my hardware set-up to ensure that my programming is correct?



Can serial mode be used for this project although the AXE1033 documentation suggests i2c mode to be used for an X1 type chip and the reading./writing from the DS1307 ?
The last question is where can I see any indication of the time clock or text variables in the simulator software of DS1307 registers and/or what is going and from the LCD module? I know this is available in the serial mode and display output can be seen on the simulator panel. The variables I did use were b0-b6 with a control variable, but need further indication to what is happening and have tried other combinations as per sample programs in the Basic commands manual.

Thank-you in advance for any comments and/or suggestions to help solve these issues.

Regards
Paul Hetrelezis
 

westaust55

Moderator
Paul,

Note the AXE033 has its own pull up resistors for the sda/scl lines.
There should only be one set of pull up resistors for the entire i2c bus.


What is causing the display to fail reading/writing from the DS1307?
In i2c mode the RTC will not send the time directly to the LCD.
You must read the time into the PICAXE and then write it back out to the LCD.
Reads as if you are doing this (you mention BCD-decimal conversions) but not 100% clear.

Suggest that you post your program code so that someone can have a look through it.

Serial mode will allow you to set and display the time but you cannot read the time into the PICAXE. reading the time into the PICAXE can only be doen using i2c mode.
 

tarzan

Senior Member
Control variable set @ %00010000 (1 Hz)

From the Manual:

Pulse Output (PLS)
The pulse output outputs a square wave of 1Hz (1 pulse per second) when the
optional DS1307 clock IC is fitted. A 330R resistor is included on the board to
allow a low current LED to be soldered directly to this connection to provide a
flashing ‘second’ indicator. The pulse output can sink or source 20mA. The pulse
output will not operate until the clock upgrade is fitted and the correct time is
programmed into the unit.

If you are confusing the DS1307 output with this one, which is connected to the PIC on the AXE033 board.
You’ll need to write the control variable as %00010000 (1 Hz) when setting the time.
 
Last edited:

PaulHetrel

New Member
Posted code for " Cannot display time from DS1307 to the AXE033 LCD module"

I'm now posting the code as suggested. Thank-you westaust55 & Tarzan for responses on first Posting. Refer original post for details

Regards


Paul H.
 

Attachments

westaust55

Moderator
Have not had the chance this morning to read through all your program but see two line that need correction:

Code:
i2cslave %11010000, i2cslow, i2cbyte' initialise DS1307
writei2c 0,(seconds,mins,hour,day,date,month,year,control)'write above declarations to DS1307 registers

Pause 500' allow time for Diplay to read data
loop1:
i2cslave %110[B][COLOR="Red"]1[/COLOR][/B]0000, i2cslow, i2cbyte 'initialise AXE033 for reading from DS1307 registers
readi2c 0,(seconds,mins,hour,day,date,month,year,control)

i2cslave %11000[B][COLOR="red"]11[/COLOR][/B]0, i2cslow, i2cbyte 'initialise AXE033 Display for writing time/date to LCD
see the changes in bold red above.
 
Last edited:

westaust55

Moderator
had a look at listing on train while heading to work.

for each of your writei2c commands, eg writei2c 0, (b3)

you must add , 255 after the actual data to be sent. This indicates to the AXE033 that it is the end of data and to display/carry out the sent instruction.


So the command becomes: writei2c 0, (b3, 255)
 
Top