DS1307 Initialization and Demo
Shalini
Posts: 59
Hi everyone!
I'm having some trouble intializing the ds1307 rtc. I've included the codes I'm using for initialization and demo . Please take a look at them and point me if i have the things in the right place or not.
Thanks in advance
I'm having some trouble intializing the ds1307 rtc. I've included the codes I'm using for initialization and demo . Please take a look at them and point me if i have the things in the right place or not.
Thanks in advance
Comments
The programs I'm using now are:
DSRTC_driver
FullDuplexSerial
Extended_FDSerial <-- Extended Full Duplex Serial on obex.parallax
LCD RTC demo
I'm getting error in LCD RTC demo program. I've bolded and underlined as to where it's indicating the error. The error is "Expected a Subroutine Name"
PUB Main
LCD.init(TX_PIN, BAUD, 2, 16)
LCD.cls
Can anybody help me out on how to fix this error!!
Thanks
If you just want to display the time on your PC using the Parallax Serial Terminal, just remove the LCD code.
Make sure you have specified the correct pins for the RTC clock and data pins.
oh ok...i fixed it as per ur code....now all programs are loaded...what is the next step?? should the time automatically appear on the LCD??
in the serial terminal its giving me some other characters updating every second not the rtc clock.
No, if you're running the code that was attached above, you need to run the Parallax Serial Terminal at 57600 baud rate.
ok I'm getting 01/01/00 Sun
00:00:80 AM
how do i set the time and date??
If the clock has not been set, enter "y" at the "Enter 'y' if you want to set clock:" prompt and enter the year, month, day, etc to set the clock...
I'm not getting the prompt to set the date and time.
Make sure you start the Parallax Serial Terminal, set the appropriate Comm Port and set Baud Rate to 57600.
Load the program from the Propeller tool (F11) and immediately click the enable button on the Serial Terminal.
The program gives youe 3 seconds to respond.
If you miss it, hit the reset button on the Propeller board...
If you are not familiar with the Parallax Serial Terminal, you should read up on it
Ok thanks a lot. I have the clock running on the serial terminal. I've to work further to make it display the time and date on the LCD.
how can i make this time and date display on the lcd??? I've included the code,but I've excluded all LCD lines because I'm getting "subroutine error" on the following line:
PUB Main
LCD.init(TX_PIN, BAUD, 2, 16)
Could u please check the code and guide me how to fix it....thanks
Your particular LCD and OBEX code probably have totally different routines and parameters that the Sparkfun LCD/driver I used.
You are going to have to do a little work here. This appears to be a parallell LCD (using 8 or four pins).
You need to find an OBEX object (or other code) that will work with your LCD and study the code to learn how to use it.
NOTE: you got it working before my post
The LCD I'm using is not a familiar one like HD4480, so can i still find a OBEX object for this lcd... and yes I'm using 4 bits
I found these on OBEX...
PUB Main
LCD.init(TX_PIN, BAUD, 2, 16) <-- "subroutine" error
so I want to know what 2 and 16 are in the code??
I wrote my OBEX object to work with specific Sparkfun serial LCDs. Some have 2 lines some have 4 - some have 16 characters/per line and others have 20.
The 2, 16 indicate rows and columns. Many OBEX objects work with very specific devices - they are not universal drivers.
My LCD code won't work with your LCD.
oh ok, so in my case i would that 2 and 8...rite?? because the lcd I'm using is 8x2 lines
oh i see...ok i'll check the JHD162A datasheet and get back to u...thanks a lot!!
Right now the time and date is been displayed on the serial terminal, but can you suggest me any spin code i can use to make it display on the JHD162A 16x2 LCD please??
I'm really in need of help!!
Here's something hacked together from my I2C and LCD routines, with some glue code to allow for setting the time.
LCD clock - Archive.zip
yes, this is problem I'm having....so if I use the code you've given me will I be able to see the clock running on the LCD instead of serial terminal??
In your LCD driver.spin code you have given:
PUB start(E_pin, RW_pin, RS_pin, D4_pin) : okay
stop
pins[0] := E_pin
pins[1] := RW_pin
pins[2] := RS_pin
pins[3] := D4_pin
the 0,1,2,3... is the propeller pins numbers which your using to connect E, RW, RS, and DB4??