I would like to connect to my DS1307 and output the time to either a TV or VGA, does anyone have the code? Object Exchange only seems to have the output go to LCD, which I do not have.
I did that a while back, but can't lay my hands on my code..
Post a link to the object you are looking at and I'll do it again..
It's not tough. Most of the .out and .str commands are directly
compatible with the text object. IIRC, I converted them nearly
straight across and removed the LCD specific stuff.
I *think* this code conversion is correct. (Not near my prop)
It will either work perfectly or get you in the ballpark.. [noparse]:)[/noparse]
I've added a text : "tv_text" to the CON, and move the LCD to an unused pin.
Complete file is attached.
[b]PRI[/b] DS1307_demo | secs
' DEMO the DS1307 Real Time Clock (RTC)
secs := ds1307object.gettime
[b]if[/b] secs == 80
' the clock has not been initialised so lets set it
' this will demonstrate hour & day roleover.
ds1307object.settime(23,59,45) ' 23:59:45
ds1307object.setdate(1,1,5,06) ' 1/5/2006 - day 1
' run for approx 30 secs
[b]repeat[/b] 30
' get and display the TIME
text.out(0)
text.[b]str[/b]([b]string[/b]("TIME: "))
'lcdObject.positionlcd(1,7)
ds1307object.gettime
text.dec (ds1307object.getHours)
text.[b]str[/b]([b]string[/b](":"))
text.dec (ds1307object.getMinutes)
text.[b]str[/b]([b]string[/b](":"))
text.dec (ds1307object.getSeconds)
' get and display the DATE
'lcdObject.clearline(2)
text.[b]str[/b]([b]string[/b](13,"DATE: "))
'lcdObject.positionlcd(2,7)
ds1307object.getdate
text.dec (ds1307object.getDays)
text.[b]str[/b]([b]string[/b]("/"))
text.dec (ds1307object.getMonths)
text.[b]str[/b]([b]string[/b]("/"))
text.dec (ds1307object.getYears)
' wait a tick or two
[b]waitcnt[/b](60_000_000+[b]cnt[/b])
I have figured out what the problem is.... I'm a moron. To put it more politely, "A technical problem existed between the keyboard and chair". I looked at the wiring diagram again to discover that I did not connect any pull-up resistors to the SCL and SDA lines. All seems to be functioning properly now. Thank you for all of your help.
Also, you might consider next time just using the existing I2C bus on pins 28&29 (that connect to the EEPROM).
That way you don't use any extra pins and there's already the pullups you need...
Comments
Post a link to the object you are looking at and I'll do it again..
It's not tough. Most of the .out and .str commands are directly
compatible with the text object. IIRC, I converted them nearly
straight across and removed the LCD specific stuff.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with a Propeller Protoboard?
Check out: Introduction to the Proboard & Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
I am trying to do this on my Prop Demo Board and have the 1307 SCL connected to P5 and SDA connected to P6.
It will either work perfectly or get you in the ballpark.. [noparse]:)[/noparse]
I've added a text : "tv_text" to the CON, and move the LCD to an unused pin.
Complete file is attached.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with a Propeller Protoboard?
Check out: Introduction to the Proboard & Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
or
it just freezes and none of the remaining code runs. If I comment out both lines it "runs" but obviously without the DS1307
Double check the SDA, SCL connections.. Make sure we match your actual connection.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with a Propeller Protoboard?
Check out: Introduction to the Proboard & Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
http://forums.parallax.com/showthread.php?p=691564
Also, you might consider next time just using the existing I2C bus on pins 28&29 (that connect to the EEPROM).
That way you don't use any extra pins and there's already the pullups you need...