Problem with PIC16F87


Closed Thread
Results 1 to 40 of 44

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Add CMCON=7 to your code.

    Al.
    All progress began with an idea

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Oops, i missed that off the list. I did try that after reading and old thread about a PIC16F877A. Im sure the PIC16F87 works with or without it but i had tried it anyway and still no luck
    Last edited by The Master; - 3rd September 2009 at 09:13. Reason: Fixed spelling mistake

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi,

    Your PIC config sequence ... just is missing !!!


    Try to add to your Code top

    Code:
    '******************************************************************************
    'Configuration
    '******************************************************************************
    
    'Program Configuration Register 1
    @		__CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_ON & _HS_OSC
    
    'Program Configuration Register 2
    @		__CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF
    
    ...
    
    ' Pour 16F88
    
    	ANSEL 	= 0
    	ADCON0	= 0
    	ADCON1 	= 0
    	CMCON	= 7
    	CVRCON	= 0
    	CCP1CON	= 0
    you just have to translate the config lines for MCS ... if you use it.

    Alain
    Last edited by Acetronics2; - 3rd September 2009 at 10:02.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    TRISB=%00000100
    From your code you have portB.2 set as an input but it seems not used. Is this input pin floating?

    Al.
    All progress began with an idea

  5. #5
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Acetronics: The fuses are set in micropro (the software that programs the chip). I will try adding all of the other lines to the code though.

    aratti: portB.2 is used as a serial input. Its not used in this test code but it will be eventually

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by The Master View Post
    The fuses are set in micropro (the software that programs the chip)
    Ayayaye ... Quel Malheur !!!

    . I will try adding all of the other lines to the code though.
    I do recommend you to succed adding those lines ... humour !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Ive tried adding those lines. It wouldnt compile with the first 3 so i commented those out. Its still not working properly. It does seem like its trying to work now and for a few seconds the lights flash at the right speed then they will start to hang in 1 state or flash rapidly.

    I think ive seen a chip do this before when the supply cable is faulty but ive replaced that. The PSU is one i always use for things like this and is working properly, there are capacitors on the board and ive even tried adding an extra external capacitor

    Im going to breadboard the circuit up with only an LED connected to see if i can get it working. Is there anything else i can check?

Similar Threads

  1. problem using GOSUB under interrupt
    By fobya71 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 5th March 2010, 19:52
  2. Problem to compile my program
    By wagner in forum Off Topic
    Replies: 5
    Last Post: - 7th July 2008, 20:17
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

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