Shop OBEX P1 Docs P2 Docs Learn Events
Reading eeprom error — Parallax Forums

Reading eeprom error

pcrobotpcrobot Posts: 103
edited 2006-06-14 16:26 in BASIC Stamp
OK, I ran the program change9.bsp, then ran the program reader1.bsp. It debugged:

S



That's all. Any ideas what is wrong?

Thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Robotics
ro-bot-ics (noun)
the science or technology of robots, their design, manufacture, application, use, etc.

Comments

  • Invariant1Invariant1 Posts: 9
    edited 2006-06-09 16:44
    The first thing you do in the program is go to setinfo. There you use the variables month, day, hour, and minute before they have any initial values. Try initializing them to 0. Also, in setinfo your first IF condition has no ELSE case so "month" could be left still undefined. Similarly, the other IFs have corresponding ELSEIF's testing whether the input is > the range, but what if the input is < the desired range? Don't know if this is relevant to your problem but regardless you might want to clean that up.
  • pcrobotpcrobot Posts: 103
    edited 2006-06-10 12:03
    OK, I added the initializing to 0. I hadn't added the ESLEIF just because I can see what I typed, and if it's wrong then I just restart the program. I will be adding that later though.

    I'm still getting the S debug... confused.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Robotics
    ro-bot-ics (noun)
    the science or technology of robots, their design, manufacture, application, use, etc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-11 00:41
    Hello,

    ·· The following conditional in your code will never be true because the range cannot be both above and below the specified value of 4.
      IF ((day > 04) AND (day < 04)) AND IN3 = 0 THEN 'enter app. day number
        WRITE eeAddr + eeOffset, month, day, hour, minute
      eeOffset = eeOffset + 4
      ENDIF
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • pcrobotpcrobot Posts: 103
    edited 2006-06-11 18:20
    Thanks Chris. blush.gif

    I'm still getting the error though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Robotics
    ro-bot-ics (noun)
    the science or technology of robots, their design, manufacture, application, use, etc.
  • SSteveSSteve Posts: 808
    edited 2006-06-11 22:28
    In change9.bsp, you are initializing eeaddr to 1 so your writes begin at memory address 1. In reader1.bsp you aren't initializing eeaddr so it gets the default value 0 so your read begins at memory address 0. Make sure eeaddr starts at the same value in each program.

    In change9.bsp, I'd suggest adding a DEBUG statement after your WRITE statement to make sure that the WRITE statement is being called. As it is now, it will only happen if IN3 is 0 at the moment the FOR/NEXT loop ends.

    If you have another question, you should post the change you made to change9.bsp in response to the error that Chris found.

    And this wouldn't affect your program, but on what planet do you get 65 seconds in a minute and 65 minutes in an hour? I could get a whole lot more done in a day there. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • pcrobotpcrobot Posts: 103
    edited 2006-06-14 01:23
    SSteve said...
    In change9.bsp, you are initializing eeaddr to 1 so your writes begin at memory address 1. In reader1.bsp you aren't initializing eeaddr so it gets the default value 0 so your read begins at memory address 0. Make sure eeaddr starts at the same value in each program.
    OK, thanks. I also noticed that I never initated eeOffset, so I initiated it to 0 in both programs.
    SSteve said...
    And this wouldn't affect your program, but on what planet do you get 65 seconds in a minute and 65 minutes in an hour? I could get a whole lot more done in a day there. smile.gif
    Thank you for pointing out yet aother error. The seconds are only supposed to be 65, not the minutes. 5 extra seconds every minute help keep the "clock" on time.

    So, with all of these adjustments, you'd think it would work. But no, it still debugs nothing. I've attached the files again...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Robotics
    ro-bot-ics (noun)
    the science or technology of robots, their design, manufacture, application, use, etc.
  • SSteveSSteve Posts: 808
    edited 2006-06-14 16:07
    In reader1 you forgot to add a formatter before the variable names. When you just use "DEBUG month" it sends the binary value of month to the debug window. You need to use "DEBUG ? month" or "DEBUG DEC month".

    And since there's no loop in reader1, it will only show the first set of values written.

    In change9, why are you adding setmo to month? You could wind up with a value of 24 in month that way. The same for all the other values.

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

    links:
    My band's website
    Our album on the iTunes Music Store
  • SSteveSSteve Posts: 808
    edited 2006-06-14 16:26
    Also, try the attached change9.bsp. I added a DEBUG statement after your WRITE command. Make sure you see the output from the DEBUG statement to verify that the program wrote something to the eeprom.

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

    links:
    My band's website
    Our album on the iTunes Music Store
Sign In or Register to comment.