Writing and reading bits and memory


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    (stuff removed)

    Ok, it's all in my edits now.

    Robert


    EDIT: You said your previous version worked, did you have a delay in that version and then took it out?

    EDIT SOME MORE: Is there a particular reason why you use those GOTO at the end of both WHILE RECORD=0?

    EDIT YET AGAIN: by the way, byte[29] will create elements 0 thru 28. Writing element 29 will write "somewhere", but most likely not where you want.

    EDIT ONE LAST TIME: I'm curious, just how fast are you on those buttons anyways? You loop 29 times with a 10th of a second each loop, you gotta be pretty quick! That's just under 3 seconds to enter all those key presses isn't it? (or did I miss something?)
    Last edited by Demon; - 30th January 2012 at 03:20.

  2. #2
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Hi Dave,

    Tried the pause after each write command and now it's behaving even worse.

    Hi Demon,

    My last version I used wrote to bytes and not bits. Only got about 20 seconds (max) of record time. Was trying to extend it by writing to bits. I chose 29 bytes (about 24 seconds worth of recording) because I wanted to test the max out feature and was saving time by setting a lower limit. Once the code works, then I will increase the time.

    As for the goto; you know, that is kind of redundant. It automatically does that with the while..wend loop. I must have done that for some other code in the past and just didn't think anything about it. I will correct that and see if it does anything.

    I will fix the 29 bytes address, however, that should only be an issue when you max out the count, correct? If I only record for 3 seconds, I shouldn't get the playback I'm getting. Will fix that as well.

    As for the 29 bytes and 100ms pauses; I'm trying to record inputs of varying lengths. The best way I know how is to test the inputs multiple times per second. That way if I press the left input or right input or both at varying lengths, it should be able to repeat that the left button was held for 7/10 of a second while the right was held for 9/10 of a second. 1/10 of a second come out to 8/10 of a second per byte. 29 bytes is 24 seconds. I will be increasing that time by increasing the bytes being used, however limited the time for testing purposes. That, at least, was my logic.

    Tony

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Robert, The last time I did the math, 30 x 8 x .1 is more than 3 seconds....
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Tony, Is what you are showing us the complete code? Do you have any interrupts enabled?
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Quote Originally Posted by Dave View Post
    Tony, Is what you are showing us the complete code? Do you have any interrupts enabled?
    Yes it is. No interrupts. The only thing I noticed is that the "%00" was removed from my Initialization screen. Per the recommendations, L_state and R_state have been changed to 30 bytes and Counter has been changed to 31 instead of 30 in the program loop and pause 6 has been added after the write commands.

    The removal of the two goto's did help fix some irratic behavior, but still having the same problem of not playing back correctly.

    Tony

  6. #6
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Just a random thought here.

    I'm very new to PBP (but not to microcontrollers, or BASIC for that matter), but I really don't see anywhere that you are debouncing your switches. Could this be as simple as garbage getting in from bounce?

    Or am I missing something (usually the case.....)

  7. #7
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    True, but that does not explain when holding down one button for a constantly lit LED that both will flash. I used this setup on my other program that wrote to bytes instead of bits, and it worked flawlessly.

  8. #8
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Tony, Please attach the entire program in 1 segment for our viewing from configs to end...
    Dave Purola,
    N8NTA
    EN82fn

  9. #9
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Writing and reading bits and memory

    Quote Originally Posted by Dave View Post
    Robert, The last time I did the math, 30 x 8 x .1 is more than 3 seconds....
    Bingo!

    I forgot the FOR loop.

    Robert

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts