Is this possible?


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I was thinking that at the beginning of the sequence you could put the length and the period just before the data. The entire sequence would have to be the same speed, but it saves a bunch of EEPROM.

    Code:
    ZigZag
                    DATA    12, 100       ; length, speed
                    DATA    Word %0000
                    DATA    Word %0001
                    DATA    Word %0010
                    DATA    Word %0100
                    DATA    Word %1000
                    DATA    Word %0000
                    DATA    Word %1000
                    DATA    Word %0100
                    DATA    Word %0010
                    DATA    Word %0001
                    DATA    Word %0000
                    DATA    Word %0000
    Then you do 12 loops with a PAUSE 100 in each loop.
    May be more limiting than what you have though.

    P.S. You can store the sequences in Flash memory instead of EEPROM, and you'll have a lot more room. (not much more with a 16F687 though)
    Last edited by Darrel Taylor; - 27th January 2010 at 05:19. Reason: P.S.
    DT

  2. #2
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default

    OK. That makes more sense. So, correct me if I'm wrong, but the chip writes ZigZag at a specific memory location (the next one available) and Marquee at the next available after ZigZag and so on. It is called up by referencing the name and not having to reference the location (i.e. read 0 or read 13...). The first line of DATA code is the seed for the loop (run this many times and delay this many milliseconds). Is this a correct interpretation?

    Also, when you wrote the code:
    Code:
    @       WritePort  _Pattern, MyPortPins    ; write pattern to Virtual Port
    This doesn't actually write to the chip does it? I only ask because, as you know, chips have only so many write functions and the patterns I am writing will meet that limit in a short time. I'm assuming NO, but you never know.

    Thanks,
    Tony

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Sounds like you've got it, on the first part.

    And WritePort just writes to the PINs.
    It doesn't write to Flash memory.

    Cheers,
    DT

  4. #4
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136


    Did you find this post helpful? Yes | No

    Default Posting code

    Darrel T

    I've noticed that when you post code here it is always neatly laid out - upper/lower case correct and tidily tabbed.

    When I cut/pase code here it looks a mess - the upper/lower case is what I typed and the tabs go adrift.

    How to you do it?

    Regards Bill Legge

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Seems I remember asking Melanie that very question some 6-7 years ago.
    Her answer was a little different, but this is what I do now.
    1. Never use TAB's. And set the editor to insert 4 spaces when you hit the tab key.
      <br>
    2. Set the right gutter to 76 and don't go past it.
      Gets rid of bottom scrollbar in code box.
      <br>
    3. Turn off the "Reserved Word Formatting" and capitalize things like FOR, SELECT, LCDOUT etc. as you type them in.
      <br>
    4. copy&paste variable names and labels, don't type them in each time.
      It helps to have a fast "Flywheel" on your mouse when copying.
      <br>
    5. And for those special occasions, highlight the code with this.
      http://www.darreltaylor.com/files/Sh...IC%20Forum.htm
    <br>
    hth,
    DT

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Turn off the "Reserved Word Formatting" and capitalize things like FOR, SELECT, LCDOUT etc. as you type them in.
    <br>
    Well, I have a question on this. DEFINEs should be in capital letters. If the capitalize in MCS is enabled, will the defines be in real capital characters? If the setting is returned to default, I notice that the keyword DEFINE is showed as define.

    Will this introduce a problem in the compiler?

    Ioannis

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Contrary to popular belief, the word "define" does not have to be all caps.
    DEFINE is a PBP statement, and PBP is NOT case sensitive.

    If you are using PM.exe, then none of it has to be in caps, because PM.exe is NOT case sensitive either.

    But, if you are using MPASM ... then what you are defining does have to be all caps.

    DEFINE OSC 20 <-- OK
    define OSC 20 <-- OK
    DEFINE Osc 20 < NOT correct


    And when MicroCode Studio changes the capitalization, it only changes the way it's displayed on-screen.
    It still saves it to the file with the same capitalization you typed in.
    If you copy and paste to the forum, you get what you typed, not what it looks like in MCS.

    Any changes that MCS makes, will not affect the way it compiles, because the compiler never see's those changes.

    hth,

    P.S. If you turn off case sensitivity for MPASM, then you don't have to capitalize anything.
    Last edited by Darrel Taylor; - 28th January 2010 at 11:21. Reason: p.s.
    DT

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