Noobie Question


Closed Thread
Results 1 to 20 of 20

Thread: Noobie Question

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    O.K.
    whe you program your PIC, your device programmer software MUST allow you to set the configuration fuse somewhere. Find it first..

    Got it?

    Now it must have at least 1 place to configure the MCLR pin and one other for the Oscillator

    YES... set it to I/O, INTRC, or something else than MCLR or RESET.

    This is a ScreenShot of PICSTART (MPLAB)
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=942&stc=1&d=1151464220 ">

    This is a screenshot of BK precision 844a
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=941&stc=1&d=1151464220 ">


    About now?
    Attached Images Attached Images   
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    In addition to Steve's comments ...

    Does your LED blink while waiting for PIR to go high? (i.e., Is your PIC alive - are you sure the PIC is working.)

    What happens if you hardwire GP3 high – does your IF THEN catch it and turn on your camera?

    Have you measured GP3 with a meter to make sure it really goes high when the PIR is triggered?

    Is there a chance you could be missing the PIR high signal? Your loop only looks for high signal once (for a singe uS) every ½ second.

    You have not initialized b1 to zero at the beginning of your code. It gets set later but you should set it early as well.

    Is this the same program you used with your axe?

    I just need to know how to configure the GP3 pin
    you have no choice it is auto configured as an input, which is what you want.

    Out of interest, what are you going to film? A guy a few weeks ago set one of these up to video hedgehogs.

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  3. #3
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier
    you have no choice it is auto configured as an input, which is what you want.
    Only if you set the config fuse to disable MCLR and make GPIO.3 an input.
    Attached Images Attached Images  
    Last edited by dhouston; - 28th June 2006 at 12:37.

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Red face

    Quote Originally Posted by dhouston
    Only if you set the config fuse to disable MCLR and make GPIO.3 an input.
    For clarity, I guess I should have added the bold to my original comment so that it read

    "if GP3 is set as MCLR internal you have no choice since it is auto configured as an input, which is what you want."

    With Steve's discussion above and before mine, I thought this was clear but after rereading my response this morning, I see that it was not - good catch.

    Paul

  5. #5
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Paul,

    It gets confusing because all of the various programmers use different terminology to refer to the MCLR config setting so it's hard to create a universal "how to".

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    and more, pretty bad that PBC don't allow to set the config fuses in the code.. that would be so much convenient. Yet another real limitation of PBC.
    Code:
        @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
             ' Internal Oscillator
             ' Enable watch dog timer
             ' Enable power up timer
             ' Disable MCLR pin
             ' Enable brown out detect
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mister_e
    and more, pretty bad that PBC don't allow to set the config fuses in the code.. that would be so much convenient. Yet another real limitation of PBC.
    Code:
        @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
             ' Internal Oscillator
             ' Enable watch dog timer
             ' Enable power up timer
             ' Disable MCLR pin
             ' Enable brown out detect
    Without PBC, I cannot test or look at the "supplied" files but if the fuses are not dropped in by a .inc file like they are in PBP, I wonder if the user could include them in the following manner (at the top of their program):

    ASM
    device pic12F675, intrc_osc_noclkout, wdt_off, mclr_0ff, protect_off
    ENDASM

    I do remember that PBC supports inline ASM – shouldn't this work?.

    (I use MPASM - I am not sure if the format for PM is correct above).

    If it does work, I think this would be easier than having to edit the .inc file like we do in PBP. Thoughts?

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  8. #8
    Join Date
    Jun 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default

    Thanks for all the help, the program is working like a champion. My resistor on GP3 pulling to ground was not pushed into proto board all the way.
    Also for Paul, I'm using this to run a digital camera to photograph deer.THANKS again for everybody's help. I'm sure you'll be hearing from me again, as I'm building a solar charger for this camera setup, just not sure what I want it to do yet.

Similar Threads

  1. Extreme Noobie question 12F675
    By Jeff in forum mel PIC BASIC
    Replies: 11
    Last Post: - 22nd September 2009, 02:13
  2. noobie to PICs and PBPro... Programming question.
    By mcphill in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th October 2007, 19:35
  3. noobie question
    By 02GF74 in forum General
    Replies: 1
    Last Post: - 29th November 2006, 19:47
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 10:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 07:49

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