How to use symbolic names for bits within registers?


Results 1 to 3 of 3

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Hi again Dwayne,

    When you compile a PBP program, it first goes through PBPW or PBPL.exe which generates an ASM file.
    The ASM file is then passed on to either PM.exe or MPASM.exe to be assembled into a .hex file.

    The bit names you are referring to are only defined at the ASM level, but since PBP compiles first ... it has no idea what those bits are. And due to the way PBP optimizes code space, it needs to know where the bits are when it compiles.

    So you actually have to look up the bits in the datasheet.

    Then you just ...
    Code:
    GO_DONE   VAR ADCON0.1
    
    GO_DONE = 1
    WHILE GO_DONE : WEND
    ; get result
    Unfortunately, there's no way to change bit locations according to the chip being compiled for within PBP.

    Of course, you could always read the ADC at the ASM level, in which case you could use the predefined constants.
    Or use ADCIN and not worry about it.

    hth,
    Last edited by Darrel Taylor; - 10th December 2009 at 06:16.
    DT

Similar Threads

  1. LCD's with Shift Registers, and LCDOUT
    By Darrel Taylor in forum PBP Extensions
    Replies: 11
    Last Post: - 3rd April 2015, 14:34
  2. Replies: 1
    Last Post: - 2nd November 2006, 23:24
  3. Use the PIC 16f877 or 877A instead of shift registers.
    By tsanders in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2006, 17:23
  4. Set the UCFG register or registers in general
    By eDub in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 23rd July 2006, 19:46
  5. Problem with communications & registers and LCD
    By mpavlica in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th December 2004, 09:38

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