DS1307 Demo
Jon Williams
Posts: 6,491
If you've got a PDB and have been wanting to connect to that DS1307 that's next to the SX28, this program will probably save you a bit of time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 10/26/2005 11:19:51 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 10/26/2005 11:19:51 PM GMT
SXB
13K
Comments
CRLF:
· DATA 13, 10, 0
... and then change:
· TX_BYTE CR
... to:
· TX_STR CRLF
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Since I'm learning SX/B, I thought I would post these as examples for converting a BS2p program to SX/B.
I can't remember if the original BS2p program was a Nut's and Volts article, one of Chris's, or Jon's examples.
The SX/B programs demonstrate how to use ANSI codes to mimic the BS2p's Debug statement, and allows the user to set the clock's time and date for battery backed operation of the DS1307.
Attached is the original BS2p program. The program converted to SX/B running on a SX28 on the PDB. And a version for the SX48/52 Proto Board. The SX/B examples use a MAX232 RS-232 driver for serial output.
Note: In the SX-Key Editor, I have TABs set to 4, change this setting to have the comments in the SX/B listings "line up"·
Schematics of the PDB I2C and RS-232 Attached
Mike
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
Post Edited (Mike Cook) : 2/2/2006 11:22:29 PM GMT
·· I think the original was Jon's...I tend to lean toward the DS1302.· Nice work, BTW!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Jon, how is this intended to be interfaced to a PC?
is a ttl ->232 conversion necessary? or can the baud become "N9600"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
i was getting ??:??:?? in the terminal, switched out the xtal & caps(for the ds1307) and now i'm getting 00:00:00 in the terminal
i'm prototyping on an sx48 protoboard with an smt ds1307
any advice?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
Post Edited (Mike Cook) : 2/2/2006 10:41:27 PM GMT
i tried with 12pf smts and 25pf through hole.
i noticed +2v on x0 so i'm making another prototype w/ 10k pullups, like the prodevboard.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
I've got the PDB board and a proto board that has the DS1307, did not use caps on the Proto board, used xtals from here:
http://www.mouser.com/index.cfm?&handler=data.listcategory&D=*695cfs206327kbb*&terms=695-cfs206-327kbb&Ntt=*695cfs206327kbb*&Dk=1&Ns=SField&N=0&crc=true
They are 6pf, have not noticed any problems.
·
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
Post Edited (Mike Cook) : 2/2/2006 11:04:13 PM GMT
thx guys
nickb
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]
Other features (borrowed, of course, from several of Jon's programs!) include:
-- LCD Panel is·set to 4 bit mode
-- the ability to position the cursor anywhere on the panel (LCDPos)
--·a little different BCD display routine
--·use of arrays
I did not use Jon's TX_MON_LONG routine that takes a number and displays the full name of the month because·I was trying to be brief in my lesson plan but I highly recommend you all look at that routine.· It is Brilliant!
.. program updated with more comments.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Post Edited (John Couture) : 2/17/2008 12:28:02 AM GMT
I looked over that program -- it's a golden oldie, and in serious need of an update. While waiting on a friend to arrive, that's exactly what I did. The version that's attached lives up to 1.51.03 standards and is expanded in that it allows the user to select display style from the terminal when the program first starts.
In the last couple of classes we have been having trouble with some PDB's and·getting the SX to recognize keyboard input.· Our setup is as follows:
Using your program unmodified and the Prof Dev Board we connect:
RA.0 to the TX pin of the RS-232 DCE (PDB schematic, pg 6 connextor X13, #2)
RA.1 to connector X13, #4
RA.2 to SDA (and a 4.7K resistor from there to +5V)
RA.3 to SCL (and a 4.7K resistor from there to +5V)
took the plastic tab out of the battery on the DS1307.
USB for programming, another USB->Serial to connect to the DB9 on the PDB (near the X13 connector)
=========================================
What Happens:
Load·your program (4mhz).
Start up HyperTerminal, set to 38400, 8n1,·· Flow Control None.
Prompt comes up and it displays the "Menu" and then ">>"
But then it does not respond to any keypress.· We tried "s" and "S".
Now sometimes it works if you just hold the key down.
=========================================
QUESTION:
Do we need to trigger CTS or RTS in order to get that crazy thing to work smoothly?·
Is Hyperterminal not the most ideal program to use for this application?
When the MCU is off trying to read the clock it seems that a keypress would also not work.· As always, it is something simple that I am missing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
I only ever connect RX and TX, and HyperTerminal is all I ever use for general purpose testing. I'm sure it is something simple, but at the moment I can't think of anything.
Update: I just connected everything again and it runs fine. What I don't have is the additional pull-ups (they're on the PDB). I don't see why this should make a difference, but you might want to remove them just to give yourself a chance to review the connections.
Post Edited (JonnyMac) : 3/8/2008 3:37:15 AM GMT