1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Problem with PIC code

Discussion in 'Code Repository' started by SumitRanjan, May 3, 2013.

  1. SumitRanjan

    SumitRanjan New Member

    Joined:
    May 3, 2013
    Messages:
    4
    Likes:
    0
    Location:
    Bangladesh
    I have recently burn a pic 16f690. But the chip is not giving desirable output. It is not not for any I/P and giving garbage value like a counter. But it should take I/P and give O/P according to I/P.
    I think the problem is in the given part of the code below. I am using 4MHz oscillator and 22pf booster. If anybody can help I will be really thankful to him.

    "
    #include<pic.h>
    #define _XTAL_FREQ 4000000 //4MHz Crystal

    __CONFIG (INTIO & WDTDIS & PWRTEN & MCLREN & UNPROTECT & UNPROTECT & BORDIS & IESODIS & FCMDIS); "
     
  2. SumitRanjan

    SumitRanjan New Member

    Joined:
    May 3, 2013
    Messages:
    4
    Likes:
    0
    Location:
    Bangladesh
    I have used MPLAB and HITECH complier.
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,141
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    You need to post the whole code..
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,007
    Likes:
    316
    Location:
    Brisbane Australia

    If you are using an external crystal then your config needs state XT oscillator. However, I doubt that is your problem and, as Ian says, you need to post your code.

    Mike.
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,141
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Oh Yeah... Missed that... However that usually causes the pic not to run atall, I've never tried to run a pic like that so it'll be guesswork
     
  7. SumitRanjan

    SumitRanjan New Member

    Joined:
    May 3, 2013
    Messages:
    4
    Likes:
    0
    Location:
    Bangladesh
    Thanks guys. Here is my code
     
    Last edited: May 5, 2013
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,141
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Yet!!!!

    __CONFIG (INTIO & WDTDIS & PWRTEN & MCLREN & UNPROTECT & UNPROTECT & BORDIS & IESODIS & FCMDIS);
     
  9. SumitRanjan

    SumitRanjan New Member

    Joined:
    May 3, 2013
    Messages:
    4
    Likes:
    0
    Location:
    Bangladesh
    thanx Ian...
     
  10. remon7

    remon7 Active Member

    Joined:
    Aug 3, 2013
    Messages:
    122
    Likes:
    55
    Location:
    Malaysia
    @Ian Rogers super genious carry on. usually i have no vast knowledge on coding/ programming etc. just i have basic knowledge on it.
    Thanks All
     

Share This Page