Just can't get started


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2015
    Posts
    17

    Default Just can't get started

    Hi All,
    I am a brand newbie to PICs as far as software goes, but I have about 30 years experience on the hardware side. I am having a devil of a time just getting an LED to blink with a 16F887. The LED is connected to port D bit 0; pin 19. I am trying to run blinkx.pbp from the melabs website; http://melabs.com/samples/LABX1-16F887/blinkx.htm. I have MicroCode Studio 4 with PicBasicPro v2.6 compiler. Here is the code:

    ANSEL = %00000000
    ANSELH= %00000000
    LED var Portd.0
    mainloop:
    High LED
    pause 500

    low led
    pause 500

    goto mainloop

    end

    This gives syntax errors on lines 11 and 12 (ANSEL and ANSELH), and a bad data type error on line 13 (LED var Portd.0). I am really buffaloed by these errors. As I said, this example came right off of the microEngineering labs website. Any help would be appreciated.
    Thanks in advance.
    Regards,
    mike

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Just can't get started

    Compiles without issue for me.
    Check to be SURE you have selected the correct PIC in Microcode studio, If that's not correct you will see those errors.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: Just can't get started

    Hi Archangel,
    I have the correct PIC selected. I was looking around at the menus, and inadvertently told it to find automatically the PBP compiler under View, Compile and Program Options. It reselected C:\pbp, so nothing has changed. But I still get these 3 compile errors. Any other ideas?
    regards,
    mike

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Just can't get started

    Quote Originally Posted by mikejp56 View Post
    Hi Archangel,
    I have the correct PIC selected. I was looking around at the menus, and inadvertently told it to find automatically the PBP compiler under View, Compile and Program Options. It reselected C:\pbp, so nothing has changed. But I still get these 3 compile errors. Any other ideas?
    regards,
    mike
    Name:  sucess.png
Views: 326
Size:  70.5 KBName:  sucess.png
Views: 326
Size:  70.5 KB
    Sorry I copy pasted your code, see the image. Now if you select a chip WITHOUT ansel you will error out.
    Last edited by Archangel; - 10th October 2015 at 03:35.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Mar 2005
    Location
    Cocoa, Florida
    Posts
    42


    Did you find this post helpful? Yes | No

    Red face Re: Just can't get started

    HIGH and LOW do not require any port setup. They set as output automatically, see the manual.
    You don't need the ANSELs.

  6. #6
    Join Date
    Sep 2015
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: Just can't get started

    Hi Archangel and kenif,
    I uninstalled MCS and PBP, and reinstalled both programs, and now it works.
    Thanks for your time.
    regards,
    mike

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Just can't get started

    I have PBPX 3.0.7.1 and is compiles OK - an obvious mistake is to select 16F877 when you mean 16F887. Maybe the syntax is different in 2.6? Anyone with 2.6?

    Among the more common things that got wrong (does not apply to your immediate problem) clock not running, incorrect setting of fuses and not turning off comparators. Suggest you have a look at anything by Darrel Taylor and in particular his ALLDIGITAL and FUSE CONFIGURATION programs.

    George

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517


    Did you find this post helpful? Yes | No

    Default Re: Just can't get started

    HIGH and LOW do not require any port setup. They set as output automatically, see the manual.
    You don't need the ANSELs.
    That is only partly correct!

    HIGH/LOW manages the TRIS register for you but it does NOT manage ANSEL, CMCOM or any other registers which may prevent a digital pin from functioning as an output.

    /Henrik.

Similar Threads

  1. Need help getting started.
    By TheOldFart in forum PBP3
    Replies: 3
    Last Post: - 1st January 2015, 11:18
  2. Help Getting Started
    By doggitz in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 25th August 2009, 22:30
  3. getting started
    By cunninghamjohn in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th November 2008, 19:42
  4. Getting started... again...
    By Neosec in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 31st May 2008, 03:09
  5. getting started
    By rmow in forum Schematics
    Replies: 1
    Last Post: - 21st March 2008, 04:06

Members who have read this thread : 1

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