Shop OBEX P1 Docs P2 Docs Learn Events
DS1307; alt. ctrl pins failing — Parallax Forums

DS1307; alt. ctrl pins failing

verobelverobel Posts: 81
edited 2006-05-19 14:02 in BASIC Stamp
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, [noparse][[/noparse]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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-19 02:54
    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
  • verobelverobel Posts: 81
    edited 2006-05-19 03:05
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-19 03:07
    Yes, the LCD commands also work on specific pin groups.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • verobelverobel Posts: 81
    edited 2006-05-19 03:44
    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, [noparse][[/noparse]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.
  • SSteveSSteve Posts: 808
    edited 2006-05-19 08:40
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-19 14:02
    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
Sign In or Register to comment.