PICKIT2 - PBC Pro - PIC16F88 TROUBLE


Closed Thread
Results 1 to 16 of 16

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Here is your code with the configs added in. The PBP inc file has been commented out.
    I even programmed a chip. I named the file "invent"
    Code:
    '************************************************* ***************
    '* Name : CONTROLLER.BAS *
    '* Author : Giorgio Rossi *
    '* Notice : Copyright (c) 2008 Invento S.r.l. *
    '* : All Rights Reserved *
    '* Date : 26/11/2008 *
    '* Version : 1.0 *
    '* Notes : *
    '* Chip : PIC16F88 *
    '************************************************* ***************
    Asm
        ERRORLEVEL -306
        ERRORLEVEL -205  
    Endasm
    INCLUDE "MODEDEFS.BAS"
    @__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF &_XT_OSC
    
    TRISA = %00000001 'RA0 Input
    TRISB = %00000000 'all PORTB output
    
    ANSEL = %00000001'only porta.0 is analogue
    ADCON1 = 7'right justify the result(top bits are read as zero)
    CMCON = 7 'Turn off comparators
    
    
    adval VAR BYTE
    i var BYTE
    RPM VAR BYTE
    
    ' Define ADCIN parameters
    Define ADC_BITS 8 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uS
    PAUSE 500
    
    loop:
    ADCIN 0,adval
    
    serout PORTB.6,n2400, [$FE, 1]
    serout PORTB.6,n2400, [$FE, 2, "pressione ", #adval]
    serout PORTB.6,n2400, [$FE, $C0, "giri", #rpm]
    
    IF adval < 90 THEN
    HIGH PORTB.4
    endif
    
    IF adval > 120 THEN
    LOW PORTB.4
    endif
    
    COUNT PORTA.2,250,RPM
    for i = 1 to rpm
    toggle PORTB.5
    PAUSE 25
    NEXT i
    LOW PORTB.5
    GOTO loop 'repeat
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3041&stc=1&d=122833886 7" />
    Attached Images Attached Images  
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Nov 2008
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,
    thanks a lot

    please send me the file, so I can try.

    What's the first line in assebler?

    giorgio

  3. #3
    Join Date
    Nov 2008
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Hi Dave, I've look that you use MPASM,
    please post me this file (16f88.inc)

    thanks a lot

    giorgio

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


    Did you find this post helpful? Yes | No

    Default

    The file in the previous post is complete, just copy paste.

    Quote Originally Posted by inventosrl View Post
    Hi Dave, I've look that you use MPASM,
    Yep, I do not use anything else.
    please post me this file (16f88.inc)
    This is what it looks like.
    Code:
         NOLIST
        ifdef PM_USED
            LIST
            include 'M16F88.INC'	; PM header
            device  pic16F88, hs_osc, wdt_on, lvp_off, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 16F88, r = dec, w = -302
            INCLUDE "P16F88.INC"	; MPASM  Header
       ;     __config _CONFIG1, _HS_OSC & _WDT_ON & _LVP_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    The ASM stuff
    -306
    Stops this message
    Crossing page boundary -- ensure page bits are set.
    Not needed for your code, just habit

    -205
    Takes care of
    Found directive in column 1.
    This is just a warning, but it is irritating.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2008
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Very thanks Dave,
    tomorrow morning I'm on duty.

    nice night

    giorgio

Similar Threads

  1. using pbp pro with mplab and pickit2
    By rackflot in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th January 2010, 15:17
  2. Trouble with PIC16F88 (chip hangs up)
    By nobner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2009, 09:23
  3. ADC trouble with PIC16F88
    By inventosrl in forum mel PIC BASIC
    Replies: 9
    Last Post: - 3rd December 2008, 12:56
  4. Replies: 8
    Last Post: - 7th December 2006, 15:42
  5. Need help converting to PB Pro from Mbasic Pro
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 11th February 2004, 07:43

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