Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp Clock with date — Parallax Forums

Basic Stamp Clock with date

MicrocontrolledMicrocontrolled Posts: 2,461
edited 2009-07-11 00:49 in BASIC Stamp
I am designing a Basic Stamp Clock using the Parallax Serial LCD and a BS2. I have not finished tweeking it yet; but the clock should still work. It dosn't. The LCD displays the spacers inbetween the variables but not the number themselfs; it instead displays jibberish. this program has been modified. I originally had all the SEROUT command in one line instead of in seperate lines.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontrolled.

Comments

  • Mike2545Mike2545 Posts: 433
    edited 2009-05-27 00:31
    You probably need to initialize your LCD. Which one are you using?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-05-27 00:49
    I am using the Serial LCD With backlight (2X16) and my program is built on the Parallax LCD Template.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontrolled.
  • Mike2545Mike2545 Posts: 433
    edited 2009-05-27 00:53
    Post your program

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-05-27 01:06
    Well I ran your code at 8 CST 5/26/09 and thought damnhow'd he do that, coincidence can catch you off guard at times.

    Anyway when I tried this it was at 9600 baud and I had to adjust the variables. The variables need to be transmitted as ASCII characters this is how I adjusted them.
      SEROUT TX, LcdBaud, [noparse][[/noparse]hour10+48,hour+48,":"]
      SEROUT TX, LcdBaud, [noparse][[/noparse]minute10+48,minute+48,":"]
      SEROUT TX, LcdBaud, [noparse][[/noparse]second10+48,second+48]
      SEROUT TX, LcdBaud, [noparse][[/noparse]LcdCR,">"]
      SEROUT TX, LcdBaud, [noparse][[/noparse]month10+48,month+48,"/"]
      SEROUT TX, LcdBaud, [noparse][[/noparse]day10+48,day+48,"/"]
      SEROUT TX, LcdBaud, [noparse][[/noparse]year10+48,year+48]
    

    Jeff T.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-05-27 01:17
    Mike2545

    You need to tell it where you want it to display on your screen like this
    and you·are not telling what the·Baud Rate is ether

    Try this and see if this will work for you

    DispLightOn···· CON···· $11
    DispLightOFF··· CON···· $12
    LineOne0······· CON···· $80
    LineTwo0······· CON···· $94
    LineTwo4······· CON···· $98
    ClearScreen···· CON···· $0C
    Baud·············· ·CON···· 32············· ' baudmode constant for LCD Display


    ·SEROUT LCD, Baud, [noparse][[/noparse]Clearscreen]
    SEROUT LCD, Baud, [noparse][[/noparse]LineOne0, HEX2 month, HEX2 day]
    SEROUT LCD, Baud, [noparse][[/noparse]LineTwo0, HEX2 hrs,· HEX2 mins,· HEX2 secs]

    I hope this work for you

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 5/27/2009 1:22:21 AM GMT
  • Mike2545Mike2545 Posts: 433
    edited 2009-05-27 01:21
    sam_sam_sam said...
    Mike2545


    You need to tell it where you want it to display on your screen like this

    and you are not telling what the Baud Rate is ether



    Try this and see if this will work for you



    DispLightOn CON $11
    DispLightOFF CON $12
    LineOne0 CON $80
    LineTwo0 CON $94
    LineTwo4 CON $98
    ClearScreen CON $0C
    Baud CON 32 ' baudmode constant for LCD Display





    SEROUT LCD, Baud, [noparse][[/noparse]Clearscreen]
    SEROUT LCD, Baud, [noparse][[/noparse]LineOne0, HEX2 month, HEX2 day]
    SEROUT LCD, Baud, [noparse][[/noparse]LineTwo0, HEX2 hrs, HEX2 mins, HEX2 secs]





    I hope this work for you

    What did I say??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-05-27 01:31
    You do not have all the VAR· and CON for the DS1302 Time Chip if you are using it



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-05-27 01:34
    @Sam , the original post was from microcontrolled .
    ···· But the use of HEX instead of the addition of 48 is much better
      SEROUT TX, LcdBaud, [noparse][[/noparse]HEX minute10,HEX minute,":"]
      SEROUT TX, LcdBaud, [noparse][[/noparse]HEX second10,HEX second]
    

      etc etc
    

    I did not have to do anything with cursor position it worked fine just dropped the 2 off the end of HEX.

    Jeff T.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-05-27 01:58
    This should be all you need to display what you have

    SEROUT TX, LcdBaud, [noparse][[/noparse]LcdCls]
    SEROUT TX, LcdBaud, [noparse][[/noparse]LcdBLon]

    · PAUSE 5

    SEROUT TX, LcdBaud, [noparse][[/noparse]LineOne0, DEC2· hour, ":", DE2 minutes, ":",·DEC2 secs]
    SEROUT·TX, LcdBaud, [noparse][[/noparse]LineTwo0, ·DEC2·day,· "·/ " ,DEC2 month, "/", ·DEC2 year , CR]



    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-05-27 13:38
    @Mike2545: I DID Post my code!! It is attached to the starting Post!
    @Unsoundcode: I tryed your addition trick at 19200 baud and it just displayed / and : in where the numbers should have been.
    @sam_sam_sam: I am not using the Time chip just the Basic Stamps timing mechenism
    I will try the HEX command instead ASAP and see if it works any differently.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontrolled.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-05-28 03:08
    I will try the HEX command instead ASAP and see if it works any differently.

    You may want to also try the DEC one as well

    the Hex2 is for the Time chip

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • MoskogMoskog Posts: 554
    edited 2009-05-28 17:19
    microcontrolled..

    Just a question, how accurate do you expect such a clock to be?
    Why not rather go for the time chip DS1302, its very cheap and you find so many good programming examples on this forums too.

    KjellO
  • Steve AndruesSteve Andrues Posts: 29
    edited 2009-07-11 00:49
    I ran afoul of the displaying of garbage on a Parallax 2x16 LCD.· The BaudRate constant is a fudgefactor number that differs between stamp models.· As soon as I applied the correct fudgefactor everything played just fine!· All of the time data I was trying to display came from a DS1302.· I highly recommend it.
Sign In or Register to comment.