Making Program Code Space your playground...


Results 1 to 16 of 16

Threaded View

  1. #4
    Join Date
    Oct 2005
    Posts
    35


    Did you find this post helpful? Yes | No

    Question Playing at the Playground

    Hello,

    This project uses ports A-B and C to drive a display containing 21 LED's.
    To generate the patterns I started with arrays but quickly ran out of space. The following is a partial sample of an array pattern setup. Using binary helps to visualize what the pattern will look like.

    ARRAYDATA5:

    ARRAY5C[0]=%00000111:ARRAY5B[0]= %00000111:ARRAY5A[0]=%000001
    ARRAY5C[1]=%00001110:ARRAY5B[1]= %00001110:ARRAY5A[1]=%000011
    ARRAY5C[2]=%00011100:ARRAY5B[2]= %00011100:ARRAY5A[2]=%000111
    ARRAY5C[3]=%00111000:ARRAY5B[3]= %00111000:ARRAY5A[3]=%001110
    .
    .
    .
    .
    RETURN

    I looked at the code space playground thread and got some good results, but not perfect. I disabled the LCD code and instead have the data output to portb with led monitors. I put in a 2 second delay between each read.
    Decimal DB values give the expected display results however using binary values produces some extra bits within the expected pattern. I tried 14 bits and 8 bits and using the % symbol which the compiler dosen't like.


    test pattern does not work properly
    Asm
    CODE 7190
    DB 00000000000001
    DB 00000000000010
    DB 00000000000100
    DB 00000000001000
    DB 00000000010000
    DB 00000000100000
    DB 0
    endasm

    ........................................

    this code works
    Asm
    CODE 7190
    DB 1
    DB 2
    DB 4
    DB 8
    DB 16
    DB 0
    endasm

    Is there something wrong with entering binary values this way? I must be able to develop patterns in binary. It is just too hard to visualize decimal values.
    Maybe I could use the arrays just to develop the patterns then have some utility program convert binary to decimal and generate "DB (decimal}" code somehow. This would make things easier. Any ideas?


    Thanks

    "Weaseling out of things is important to learn. It's what separates us from the animals... Except the weasel."
    Last edited by Homerclese; - 8th October 2005 at 01:32.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  4. Need more code space
    By ghutchison in forum General
    Replies: 1
    Last Post: - 12th February 2005, 20:54
  5. oscillator code and placement within program
    By bartman in forum mel PIC BASIC
    Replies: 14
    Last Post: - 14th December 2004, 02:39

Members who have read this thread : 2

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