12f629 config settings


Results 1 to 7 of 7

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Here is a sample using the MCLR pin as an input to blink LEDs on the 5 remaining pins.
    Code:
     DEFINE OSC 4
       @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
        CMCON=7 :TRISIO = %001000
        CHECK: GPIO = %000000
        IF GPIO.3 = 1 THEN  
        GOSUB RUN
        ENDIF :GOTO CHECK
        RUN:
        GPIO = %000001: PAUSE 50
        GPIO = %000010: PAUSE 50
        GPIO = %000100: PAUSE 50
        GPIO = %010000: PAUSE 50
        GPIO = %100000: PAUSE 50
        RETURN
    The weak pull-ups are automatically disabled on power up. Or when a pin is made an output.

    TRMO thing is for setting the duration of the timer. How often an interrupt triggered by the timer happens.

    The OSCCAL is just for fine tuning the internal OSC, I would say you only need to worry about it if you are doing some really time critical apps. But then you would be better off using an external OSC, needing more pins now, use different PIC....

    BTW... When you do a link, do not put it in a code tag. No longer clickable
    Last edited by mackrackit; - 1st December 2009 at 11:29.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 02:48
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd November 2008, 00:51
  3. Error 0X0000008E when connecting a 18F2550 USB HID
    By FranciscoMartin in forum USB
    Replies: 8
    Last Post: - 16th October 2008, 18:20
  4. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 16:26
  5. Installation sequence
    By Demon in forum General
    Replies: 23
    Last Post: - 11th July 2006, 04:56

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