help with pic16f887


Closed Thread
Results 1 to 40 of 61

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    The 887 has analog inputs on PORTB.
    So you need to enable Digital Inputs for the LCD to work on those pins ... or the I2C (RB1,RB2).

    Code:
    ANSELH = 0
    DT

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI, thanks for the help, I am getting a little bit further I have change my define section:

    '/////////////////////////
    '// Define section //
    '/////////////////////////

    @ device pic16F887, HS_OSC
    Define OSC 8 ' Set clock speed
    ANSELH = 0


    Here is the error:
    Executing: "C:\PBP2.60\PBPMPLAB.BAT" -ampasmwin -k# -p16F887 "C:\PBP2.60\eeprom.bas"
    Executing: "C:\PBP2.60\PBPW.EXE" -ampasmwin -k# -p16F887 "C:\PBP2.60\eeprom.bas"
    PICBASIC PRO(TM) Compiler 2.60A, (c) 1998, 2010 microEngineering Labs, Inc.
    All Rights Reserved.

    ERROR: Unable to execute mpasmwin.Warning[207] C:\PBP2.60\EEPROM.ASM 170 : Found label after column 1. (device)
    Error[122] C:\PBP2.60\EEPROM.ASM 170 : Illegal opcode (pic16F887)
    Warning[202] C:\PBP2.60\EEPROM.MAC 132 : Argument out of range. Least significant bits used.
    Halting build on first failure as requested.
    BUILD FAILED: Tue Nov 30 06:53:30 2010

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I just tested the same code I posted within Windows XP- Dos window. using the command pbp -p16F887 eeprom.bas.. I worked as it did yesterday. At home I have Windows 7, so I had to use Mplab and the same problem free program under windows XP is not compilable under windows 7...
    any thoughts

    .... the code under XP compiles with or without ANSELH = 0


    K

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Code:
    @ device pic16F887, HS_OSC
    Is not correct for MPASAM.
    Try
    Code:
    @ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
    OSCCON = %01110000 '8 Mhz
    DEFINE OSC 8
    Last edited by mackrackit; - 30th November 2010 at 13:58. Reason: Setup for internal OSC
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Hi,
    thats the same line from the Inc file: 16F887.INC except for the oscillation.
    Why doesn't it work in MPlab ??? does it read the INC files ??? maybe there a configuration that I need to point to that file ??

    K

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Why doesn't it work in MPlab ???
    Because @ DEVICE is for PM
    The inc file tells you that.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Ooo yes in the comment on top I will try this . I would rather learn MPlab then installing XP on my Win 7 machine.

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