pic Basic Pro 2.50a & debug statement


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Yeah, saw that too, changed define to DEFINE both times (double checked with Notepad).
    No joy.
    I'm just going to stick with Serout2 for now - it's less painful! I'll sort out DEBUG later.
    Thanks for all your posts!
    Phil.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Phil Moore View Post
    Yeah, saw that too, changed define to DEFINE both times (double checked with Notepad).
    No joy.
    I'm just going to stick with Serout2 for now - it's less painful! I'll sort out DEBUG later.
    Thanks for all your posts!
    Phil.
    Keep trying...you're almost on top of it...
    Show your code as it stands. You're....like....stepping in it....
    Read the 3rd paragraph in that section again...and then again...and then re-read it again...
    Then take a look at Page 56...and look at it closely...
    Last edited by skimask; - 9th March 2008 at 09:56.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Change DEFINE DEBUG_Bit 1 to DEFINE DEBUG_BIT 1 and it should work.

    Having the last 2 characters in lower case was making pin RA0 an output VS RA1.

    At least is was in MPSIM. I don't have a 737 to test, but this works fine in MPSIM once
    I change Bit to BIT.
    Code:
      @ __config _CONFIG1, _INTRC_IO & _MCLR_OFF & _DEBUG_OFF & _WDT_OFF & _CP_OFF
    
    
    ' Defines
    DEFINE OSC 8
    DEFINE DEBUG_REG PORTA
    DEFINE DEBUG_BIT 1    ' note it's all UPPER CASE
    DEFINE DEBUG_BAUD 9600
    DEFINE DEBUG_MODE 1   ' 1 = inverted
    
        ' System Constants
        OSCCON = $F0  ' set 8MHz internal
        ADCON1 = $0F  ' all digital
        CMCON = 7     ' comparators disabled
    
    ' Code start
    Init:
        PAUSE 100 ' let things settle
        DEBUG "Start",10,13
        GOTO Init
        
        END
    There's a section in the library that sets up default values, and if something isn't
    DEFINED, the value will be whatever the default is. In this case it's 0.

    ifndef DEBUG_BIT ; Debug pin bit
    DEBUG_BIT EQU 0

    If wasn't seeing DEBUG_Bit as DEBUG_BIT so the default was RA0.
    Last edited by Bruce; - 9th March 2008 at 16:03.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Aaaaarrrrggggghhhhhh!

    That was it - thanks Bruce & Skimask - make sure WHOLE DEFINE is in UPPERCASE.

    Mutter, mutter, mutter! Too many IDEs, too many languages, not enough grey cells!

    Again, thanks!

    Phil.

Similar Threads

  1. About timing in pic basic pro
    By din_kt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th October 2007, 03:09
  2. MElabs PIC BASIC Pro
    By Minestorm in forum Adverts
    Replies: 13
    Last Post: - 17th March 2007, 09:55
  3. USB Pics, ICD2, pic basic pro
    By vacpress in forum USB
    Replies: 34
    Last Post: - 20th January 2007, 20:50
  4. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  5. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07

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