PDA

View Full Version : DS1307; alt. ctrl pins failing



verobel
05-19-2006, 08:10 AM
Fellow Stampers..
I am working with the BS2pe and the DS1307 RTC on the Prof.Dev.Board.· I use code like:
·...
·GOSUB Get_Clock

·Get_Clock:
· I2CIN SDA, DS1307, 0, [STR secs\7]······ ' read secs->year
· hrs = hrs & $3F·························· ' mask unused bits
· DEBUG CRSRXY, 0, 2,
· HEX2 hrs, ":", HEX2 mins, ":", HEX2 secs, " ict:", DEC3 ict
· RETURN

in 2 separate program. In the first I have SDA=PIN0, SCL=PIN1 and it works ok. In the second I have SDA=PIN7, SCL=PIN8 and it doesn't work. I have tested·to see if the pins 7 & 8 are working using code below.. .

start:
·OUTPUT 7
·OUTPUT 8
·PAUSE 2000
·TOGGLE 7
·TOGGLE 8
·GOTO start

they look ok..led's toggle on/off
What is wrong with using different pin assignment for the DS1307 clock?
Thanks..in advance, John

Chris Savage
05-19-2006, 09:54 AM
The I2C commands only work on P0/P1 or P8/P9 as per the manual/help file.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

verobel
05-19-2006, 10:05 AM
OK, thanks for the tip.. I guess I cut a few corners by just clipping from another eg. prog. and not reading the manual completely. Are there any other commands that only work on fixed pins?
Thanks, John

Chris Savage
05-19-2006, 10:07 AM
Yes, the LCD commands also work on specific pin groups.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

verobel
05-19-2006, 10:44 AM
Well, what do ya know.. I happen to be using the 2x16 serial LCD so I guess I better be carefull before changing pins. I'm using: SEROUT 14,84, [133, DEC1 prog] ie pin 14; but pg 466 quick facts table for BS2pe says pins 0-15 ok. What did you mean by LCD commands being fixed pin groups and does that apply to SEROUT?

One last question.. for max speed to the LCD what should the second parameter be? (assuming we are connecting BS2pe pin 14 to rx/tx on 2x16 serial LCD)

In my latest circuit/code/experiment I am trying to get a a handle on scan times..how long it takes to perform certain operations (measure temp, read time, read a/d, write LCD), so that in designing applications I will know if speed is an issue... whether a dedicated micro like SX28 would be required to run certain functions in support of BS2pe controller.

SSteve
05-19-2006, 03:40 PM
verobel said...
What did you mean by LCD commands being fixed pin groups and does that apply to SEROUT?

The LCD commands are LCDCMD, LCDIN, and LCDOUT. If you're using SEROUT and SERIN to communicate with your LCD, you won't be affected.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows

Chris Savage
05-19-2006, 09:02 PM
verobel,

·· LCD Commands are for Parallel LCDs only...Yours is serial and does not use the LCD commands.· As for the maximum speed that depends on the LCD.· You did not state which one you were using.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)