Problems with PIC12CE674


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2008
    Posts
    14

    Default Problems with PIC12CE674

    I have only connected de main supply at the the PIC12CE674, because in the configuration word you can chooce to turn on the 4MHz clock inside and the reset internally connected to VDD.

    So i think there is nothing wrong with the hardware.

    For the program:
    'Register Initializations'
    TRISIO.0 = 1
    TRISIO.1 = 0
    TRISIO.2 = 0
    TRISIO.3 = 1
    TRISIO.4 = 1
    TRISIO.5 = 1


    'Variabelen
    Input_1 VAR GPIO.4
    Input_2 VAR GPIO.5
    Output_1 VAR GPIO.1
    Output_2 VAR GPIO.2
    Memory_1 var bit
    Memory_2 VAR bit
    Max_Pulsen VAR WORD
    Pulsen_1 VAR WORD
    Pulsen_2 VAR WORD



    Max_Pulsen = 100

    Main: if (Input_1=1 & Memory_1=0) then
    Pulsen_1 = Max_pulsen
    Memory_1 = 1
    ENDif

    if (Input_2=1 & Memory_2=0) then
    Pulsen_2 = Max_pulsen
    Memory_2 = 1
    ENDif

    if (Pulsen_1 > 0) then
    Toggle Output_1
    else
    Memory_1 = 0
    output_1 = 0
    endif

    if (Pulsen_2 > 0) then
    Toggle Output_2
    else
    Memory_2 = 0
    output_2 = 0
    endif

    pause 1000 'pause van 1sec
    goto main
    end

    The thing i i'm not sure about are the ID locations. I left them at FFFF

    Thanxs at advance

  2. #2
    Join Date
    Nov 2008
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    Sorry forgot to mention the problem .

    The PIC12CE674 doesn't do anything.

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


    Did you find this post helpful? Yes | No

    Default

    First off, I can't believe you're using a 12CE674
    Well, if you must ...
    Here's a few pointers.

    1: ID locations don't matter. They don't have an effect on the processors functions.

    2: Turn off the Analog pin functions.
        ADCON1 = 7

    3: Move factory calibration to OSCCAL
        DEFINE OSCCAL_2K 1

    4: For ease of use, put the Configs in your program.
    Code:
    @  device INTRC_OSC ; Internal Oscillator
    @  device MCLR_OFF  ; Turn OFF Master Clear Reset
    @  device WDT_OFF   ; Turn OFF WatchDog Timer
    5: Initialize variables at the beginning of the program.
        Reasoning: When the program gets to Main:, the state of Memory_1 is not known.
    Code:
    Main: if (Input_1=1 & Memory_1=0) then
    You can either set each variable to a specific value, or just put a CLEAR statement at the top of the program, and everything will start off at 0.

    6: Initialize your output states before setting TRISIO.
        CLEAR does not initialize the PIN states. So you have to do those manually.
    Code:
    GPIO = 0
    TRISIO = %111001
    HTH,
    DT

  4. #4
    Join Date
    Nov 2008
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    The PIC12CE674 has the right amount of pins that's why i choose this one.

    I will try your advice now.

    Thanxs alot.

  5. #5
    Join Date
    Nov 2008
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    It's working thanxs for your help Darrel.

Similar Threads

  1. Problems with U2 programmer C30 compiled code
    By minimii in forum Off Topic
    Replies: 0
    Last Post: - 5th November 2009, 09:43
  2. Problems programming
    By Lionheart in forum General
    Replies: 4
    Last Post: - 7th December 2008, 16:51
  3. Problems with 16F876 on interrupts an WRITE / READ
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2005, 14:38
  4. Goto inside a gosub??? Problems...
    By leonel in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th October 2005, 12:17
  5. HSEROUT Problems
    By SergioRM in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th April 2005, 23:17

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