Shop OBEX P1 Docs P2 Docs Learn Events
Need help with writing to EEPROM — Parallax Forums

Need help with writing to EEPROM

ArchiverArchiver Posts: 46,084
edited 2004-06-18 17:14 in General Discussion
Hi,

I have a BS2 and the program I am trying to make isn't working. I
knwo there is a way to do it but my knowledge of PBASIC isn't that
vast and I was hoping someone could point me in the right
direction. What I am trying to do it to take a numerical value
(ASCII, Binary, Decimal...) and store it temporarily in the stamp.
When 4 numbers are received I need to recall all of them and send
them at the same time to an output pin on the stamp. I know how to
write numbers using the write command but how can I write a value
like an analog value from an input pin? Also, when I want to recall
that number, what command do I use to do this?

Thanks in advance for any help,

Chris

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-06-18 15:35
    Chris,

    Can you be more specific? What are your inputs (are you using an A2D?)?
    What are your outputs? Displays? LEDs? Do you want an analog output?


    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: christopher41877 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9QKNUFAOOO3d26HNmT_KgvBsrF7zI0PkhQ3O9IAT5YQYKEoSMlNQbJ1Zu0XHhoup8TdHm1NO-OJi3pm0fYS6ooOwvqGl]CHRIS@R...[/url
    Sent: Friday, June 18, 2004 9:25 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Need help with writing to EEPROM


    Hi,

    I have a BS2 and the program I am trying to make isn't working. I
    knwo there is a way to do it but my knowledge of PBASIC isn't that
    vast and I was hoping someone could point me in the right
    direction. What I am trying to do it to take a numerical value
    (ASCII, Binary, Decimal...) and store it temporarily in the stamp.
    When 4 numbers are received I need to recall all of them and send
    them at the same time to an output pin on the stamp. I know how to
    write numbers using the write command but how can I write a value
    like an analog value from an input pin? Also, when I want to recall
    that number, what command do I use to do this?

    Thanks in advance for any help,

    Chris
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-18 15:40
    Hi Chris,

    You can Write a Byte to a specified location in EEPROM and then Read it back
    to RAM, again specifying its location.

    So, 'Write' and 'Read' are the keywords, you can find the specific use of
    them in the (online) Help function.

    Klaus
    Original Message
    From: "christopher41877" <CHRIS@R...>
    To: <basicstamps@yahoogroups.com>
    Sent: Friday, June 18, 2004 4:24 PM
    Subject: [noparse][[/noparse]basicstamps] Need help with writing to EEPROM


    > Hi,
    >
    > I have a BS2 and the program I am trying to make isn't working. I
    > knwo there is a way to do it but my knowledge of PBASIC isn't that
    > vast and I was hoping someone could point me in the right
    > direction. What I am trying to do it to take a numerical value
    > (ASCII, Binary, Decimal...) and store it temporarily in the stamp.
    > When 4 numbers are received I need to recall all of them and send
    > them at the same time to an output pin on the stamp. I know how to
    > write numbers using the write command but how can I write a value
    > like an analog value from an input pin? Also, when I want to recall
    > that number, what command do I use to do this?
    >
    > Thanks in advance for any help,
    >
    > Chris
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-18 16:39
    --- In basicstamps@yahoogroups.com, "christopher41877" <CHRIS@R...>
    wrote:
    > Hi,
    >
    > I have a BS2 and the program I am trying to make isn't working. I
    > knwo there is a way to do it but my knowledge of PBASIC isn't that
    > vast and I was hoping someone could point me in the right
    > direction. What I am trying to do it to take a numerical value
    > (ASCII, Binary, Decimal...) and store it temporarily in the stamp.
    > When 4 numbers are received I need to recall all of them and send
    > them at the same time to an output pin on the stamp. I know how to
    > write numbers using the write command but how can I write a value
    > like an analog value from an input pin? Also, when I want to
    recall
    > that number, what command do I use to do this?
    >
    > Thanks in advance for any help,
    >
    > Chris


    Hi Chris,

    Seems like you put a whole lot into the post.

    To bring in any value, it is either a 1 or 0 that would be the state
    of the pin.

    If you start with things like POT or RCtime, you can get more than a
    bit, you can get a byte or a word.

    Once you decide HOW you bring in your data, it is stored in a
    variable that you use for that command.

    Read a little on RCtime to get the idea.

    Also, you mentioned the word "analog" This may be a simple RCtim
    sort of input that offers a kinda-sorta analog input or it could be
    from an analog to Digital converter ADC chip which is external and
    uses a serial connection.

    But, for you to read the port, you have to have a variable set aside
    for it and your reading will be stored until you read a new reading
    or lose power.

    Dave
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-18 16:43
    I am taking DTMF tones in, converting it with external hardware, and
    then sending it to the stamp. I believe the output from the
    hardware is ASCII but I don't have it yet. So, the stamp receives
    one ASCII number and stores it, the does it three more times for a
    total of four. Once the four numbers are received it will go back
    to the memory and recall the numbers, like a 4 digit pin. Now, it
    has the numbers and then I will assign a DTMFOUT command to the
    number. I would like to use "if then" statements because they are
    easy. If there is another way I can do this or an easier way I
    would appreciate any comments.

    Thanks,

    Chris


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > Chris,
    >
    > Can you be more specific? What are your inputs (are you using an
    A2D?)?
    > What are your outputs? Displays? LEDs? Do you want an analog
    output?
    >
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: christopher41877 [noparse][[/noparse]mailto:CHRIS@R...]
    > Sent: Friday, June 18, 2004 9:25 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Need help with writing to EEPROM
    >
    >
    > Hi,
    >
    > I have a BS2 and the program I am trying to make isn't working. I
    > knwo there is a way to do it but my knowledge of PBASIC isn't that
    > vast and I was hoping someone could point me in the right
    > direction. What I am trying to do it to take a numerical value
    > (ASCII, Binary, Decimal...) and store it temporarily in the
    stamp.
    > When 4 numbers are received I need to recall all of them and send
    > them at the same time to an output pin on the stamp. I know how
    to
    > write numbers using the write command but how can I write a value
    > like an analog value from an input pin? Also, when I want to
    recall
    > that number, what command do I use to do this?
    >
    > Thanks in advance for any help,
    >
    > Chris
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-18 17:14
    You could use an array to store your values, then play them back. What
    you need to figure out, of course, is what your incoming DTMF values are
    going to be. If you get lucky, they will be decimal values that
    correspond to the telephone keypad. If that's the case, you can use an
    array of nibbles.

    This is off the top of my head -- use for guidance only.

    key VAR Nib(4)
    idx VAR Nib

    Main:
    GOSUB Get_Keys

    ' do something else

    FOR idx = 0 to 3
    ' output slowly on P0
    DTMFOUT 0, 500, 100, [noparse][[/noparse]key(idx)]
    NEXT
    END


    Get_Keys:
    idx = 0
    FOR idx = 0 TO 3
    ' wait for key from hardware -- assign value to key(idx)
    NEXT
    RETURN







    Original Message
    From: christopher41877 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=BYL2X5THYC8dBZv4aMlS-7MqIMIlNo2mlBCgTV1HuB0EZKlqbRcprmGGMU_j5yRr4hIztqZSImWy2XJWOdWxVWtr]CHRIS@R...[/url
    Sent: Friday, June 18, 2004 10:44 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: Need help with writing to EEPROM


    I am taking DTMF tones in, converting it with external hardware, and
    then sending it to the stamp. I believe the output from the
    hardware is ASCII but I don't have it yet. So, the stamp receives
    one ASCII number and stores it, the does it three more times for a
    total of four. Once the four numbers are received it will go back
    to the memory and recall the numbers, like a 4 digit pin. Now, it
    has the numbers and then I will assign a DTMFOUT command to the
    number. I would like to use "if then" statements because they are
    easy. If there is another way I can do this or an easier way I
    would appreciate any comments.

    Thanks,

    Chris


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > Chris,
    >
    > Can you be more specific? What are your inputs (are you using an
    A2D?)?
    > What are your outputs? Displays? LEDs? Do you want an analog
    output?
    >
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
    >
    Original Message
    > From: christopher41877 [noparse][[/noparse]mailto:CHRIS@R...]
    > Sent: Friday, June 18, 2004 9:25 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Need help with writing to EEPROM
    >
    >
    > Hi,
    >
    > I have a BS2 and the program I am trying to make isn't working. I
    > knwo there is a way to do it but my knowledge of PBASIC isn't that
    > vast and I was hoping someone could point me in the right
    > direction. What I am trying to do it to take a numerical value
    > (ASCII, Binary, Decimal...) and store it temporarily in the
    stamp.
    > When 4 numbers are received I need to recall all of them and send
    > them at the same time to an output pin on the stamp. I know how
    to
    > write numbers using the write command but how can I write a value
    > like an analog value from an input pin? Also, when I want to
    recall
    > that number, what command do I use to do this?
    >
    > Thanks in advance for any help,
    >
    > Chris



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
Sign In or Register to comment.