pic 12F683 question


+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2010
    Location
    Belgium Taviers 5310
    Posts
    4

    Default pic 12F683 question

    Hello,
    Tanks to tell me why GPIO pins 5, 4 and 1 has no reaction with this instructions.




    ' p used : 12F683

    include "modedefs.bas"
    DEFINE LOADER_USED 1 '
    define OSCAL_2K 1 ' define oscal for 2 k devices
    DEFINE OSC 4 ' Oscillator speed in MHz: 3(3.58) 4 8 10 12 16 20 24 25 32 33 40
    '----------------------------------------------------------------------
    ANSEL=0
    TRISIO =0

    start:
    low 5
    low 4
    low 2
    low 1
    low 0
    pause 1000
    high 5 ' no reaction
    high 4 ' no reaction
    high 2 'ok
    high 1 no reaction
    high 0 'ok
    pause 1000
    goto start

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

    Default

    Try
    Code:
    HIGH GPIO.5
    PAUSE 1000
    LOW GPIO.5
    PAUSE 1000
    Dave
    Always wear safety glasses while programming.

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

    Wink Rtfm ...

    Ok,

    The answer is on page 24 & 30 of the manual ( v 2.60 ...)

    instead of

    Code:
    include "modedefs.bas"
    use
    Code:
    include "bs2defs.bas"
    Alain
    Last edited by Acetronics2; - 29th January 2010 at 13:07.
    ************************************************** ***********************
    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
    Jan 2010
    Location
    Belgium Taviers 5310
    Posts
    4

    Default 12F683 pins

    Thanks for the answer.
    But there is no evolution when i use
    HIGH GPIO.5
    PAUSE 1000
    LOW GPIO.5
    PAUSE 1000

    GPIO 4 and 5 still inactive

    A other suggestion ?
    Regards.
    Bouif2

  5. #5
    Join Date
    Jan 2010
    Location
    Belgium Taviers 5310
    Posts
    4

    Default Frozen pins

    I tested and the
    use of "include "bs2defs.bas"" did not bring live to the pins.
    Some other idea.?

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

    Default

    Now that I look at the data sheet I see GPIO.4 is analog.
    So add
    Code:
    ANSEL = 0
    Near the beginning of your code. That will make all pins digital.

    Other than that I do not see a problem.

    How are your configs set and how is it wired?
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jan 2010
    Location
    Belgium Taviers 5310
    Posts
    4

    Default Ansel = 0

    Thanks Dave for your anwer.
    But " ANSEL = 0 " did not bring a amelioration.
    Regards.
    Bouif2

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

    Default

    Yes ...

    a ( working ...) typical 12F683 INTOSC Header ...

    Code:
    @ __config _INTRC_OSC_NOCLKOUT &_FCMEN_OFF &_IESO_OFF & _WDT_ON &_PWRTE_ON & _MCLRE_OFF & _CP_OFF
    
     OSCCON = %01110111					' Internal Clock 8 Mhz
     
     CMCON0 = 7
     VRCON   = 0
     ADCON0 = 0
     ANSEL   = 0
    and NO "Define Osccal" to write ...

    You have [no]some[/no] LOTS OF good reading to do, this evening ... BEFORE sleeping.

    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 " !!!
    *****************************************

Similar Threads

  1. MXcom "C-BUS" interface to PIC question
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st May 2014, 03:59
  2. Pic Interference and Power Filter Question
    By Hylan in forum General
    Replies: 3
    Last Post: - 24th January 2008, 07:50
  3. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  4. 12F683 battery powered remote - energy consumption question
    By silentwol in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th April 2007, 13:23
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts