Shop OBEX P1 Docs P2 Docs Learn Events
End-of-Line and missing colon error — Parallax Forums

End-of-Line and missing colon error

adobejoeadobejoe Posts: 17
edited 2010-02-22 04:19 in BASIC Stamp
Okay, I know this is probably a lame question, but I am getting an error code 129 "Expected ':' or end-of-line on my program, and I do not know what is going on. Any ideas? Program attached.

Andy

Comments

  • Adrian SchneiderAdrian Schneider Posts: 92
    edited 2010-02-18 09:57
    First, you should use {$PBASIC 2.5} instead of {$PBASIC 2.0} to use the PIN declaration.
    Second, the variable decNum in line 51 is not declared and never used any more.

    Regards
    Adrian
  • adobejoeadobejoe Posts: 17
    edited 2010-02-19 04:30
    Adrian,

    I had no idea I needed to change the PBASIC from 2.0 to 2.5 in the second line. Thanks! I found some other undefined variables, and have edited a bit. Now I am getting a "Undefined symbol" on the READ BURST command in my subroutine Get_Time:. NOw, there is also a RdBurst command, so I am a bit confused of which is correct? I assume this is the command to read a time/date stamp from the DS1302.

    Andy
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-19 05:47
    There is nothing defined for BURST and "READ BURST" doesn't make any sense. "RdBurst" is a command sent to the DS1302, but I'd have to look at the datasheet to figure out how it's used. Where did you get your "Get_Time" routine?
  • adobejoeadobejoe Posts: 17
    edited 2010-02-21 02:27
    When I read the datasheet it describes burst mode as being able to go to either the clock/calender registers or the RAM (random access memory), I guess depending upon bit address. Bit 0 specifies read or write (1/0) and address bits 1 to 5 = logic 1. My Get_Time routine came from a demo by Chris Savage, and I notice that "READ BURST" in the subroutine probably should not be there. I removed it. I understand in theory the whole idea of 8 bits to a byte, nibbles being half a byte (4 bits) and BCD binary coded decimal, and of course HEX is base 16, and I understand the logic of DO loops, IF Then statements, etc, but I really do not understand exactly what the code is doing. At least I know what I want it to do, as in my first comments.

    Andy
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-21 03:20
    The way to understand code is to break it into pieces small enough so you can understand each piece. If you don't understand a statement, you read its description in the Manual and look at known working examples until you understand them. It's often helpful to work through small examples on paper. If you have specific questions or don't understand something in the Manual, do ask, but just saying you don't understand doesn't help.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-02-21 03:22
    Get_Time:
    · READ BURST··························· ' DS1302 Burst Read <<<<<<.......This is not need
    · HIGH CS1302·························· ' Select DS1302
    · SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]RdBurst]
    · SHIFTIN DataIO, Clock, LSBPRE, [noparse][[/noparse]secs, mins, hrs, date, month, day, year] 'clock activated,and will read at each loop
    · LOW CS1302··························· ' Deselect DS1302

    DEBUG HOME, HEX2 hrs, ":", HEX2 mins, ":", HEX2 secs·

    RETURN

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

    ·
    ·
    ·
    ·
    Sam
  • adobejoeadobejoe Posts: 17
    edited 2010-02-22 04:19
    Sam,

    ·Okay I modified file and it is now going through the DEBUG interaction, taking date month, etc input but it kind of stalls at the hours/minutes/seconds input. Your change noted, except where to place the "DEBUG HOME......" line?· I understand my subroutines, in order of operation to be something like

    1) Set_Mode --this takes user input on date, time, etc to initialize values to DS1302 (RAM?)

    2)Set_Time--this must do a burst write to the DS1302, and start the clock?

    3)RTC_Out--this must be Real-Time-Clock, something to do with the DS1302 clock

    4)Get_Time--this must do a burst read of time,date data from DS1302

    5)Advance--this is a routine to switch or advance pin 4 for 3 seconds, advancing a linear actuator.

    6)Retract--this is a routine to switch or retract pin 6 for 24 seconds, retracting a linear actuarot.

    Am getting there, I think. comments appreciated.

    Andy
Sign In or Register to comment.