12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    What happens if the @SLEEP below is commented?
    Code:
    WHILE COUNTER < 2      ' 4.608sec Loop time (Loop for 30 mins = 781)
         @ SLEEP
         COUNTER=COUNTER+1
         'IF  GPIO.3= 0  THEN COUNTS 'Bird at box (it's not dark) so continue counting
    WEND
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    What happens if the @SLEEP below is commented?
    It TX's straight away and the led on the Pickit1 (receiver) flashes three times (as intended). There is no 5 sec delay from the timing loop though.

    It's as if the timing loop COUNT is just being bypassed, have I set it up right?

    Dave
    Last edited by LEDave; - 4th April 2011 at 23:11.

  3. #3
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    If I press and hold down push button GP4 on the transmitter, the receiver flashes the led continually. I would have thought / was expecting that when the push button on GPIO.4 was pressed and held down you would get a four / five second delay before the receiver received anything and started to flash.

    Tonights silly question:

    How does setting the OPTION reg and WDT then become associated with the loop COUNTER? The WDT has a period of 18ms so setting the bits 111 gives 128*18ms =2.304secs the COUNTER loop should run twice giving a delay of 4.608secs right? But if the program doesn't read COUNTER as being associated with the WDT it's going to count to two in a flash and it will appear that the TX sends the data instantly(which is what is happening). Should the WDT and COUNTER be 'joined' via a 'SYMBOL statement in the program under SYMBOL? or something like this?

    Dave
    Last edited by LEDave; - 5th April 2011 at 00:30.

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


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    Just guessing as I have not done this before...
    Code:
    WHILE COUNTER <= 2      ' 4.608sec Loop time (Loop for 30 mins = 781)
          INTCON.0 = 0
         @ SLEEP
         COUNTER=COUNTER+1
         'IF  GPIO.3= 0  THEN COUNTS 'Bird at box (it's not dark) so continue counting
    WEND
    I hope someone else will jump in on this...
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    Hi mackrackit,

    I've made the changes and the Transmitter lights the it's reference led about once every nine seconds but doesn't transmit at all (doesn't seem to get that far).

    I still can't get my head around how the WDT associates with the loop COUNTER, plus the more I read on this it seems that if the WDT isn't reset back to zero before it reaches FF+1 (I think) it then reboots the program which makes sense....Mmm, more reading and thinking to do, interesting though.

    Dave

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    First let me say, this is an awesome thread. I have been meaning to read it from the beginning, but I am a slow reader.

    LEDave, WDT in the snippet you just posted works like this:
    Assuming PBP knows you are using the WDT, clear WD is sprinkled around the program for you to keep from resetting the chip. But to get to these, the program must run.

    @sleep basically stops the program and the chip just, well sleeps. Because of this, the WDT never gets cleared. The WD can wake up the PIC, so when WDT overflows, the PIC wakes up and resumes where it left off. So this is how the WDT is associated with the counter.

    Hope this helps
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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


    Did you find this post helpful? Yes | No

    Default Re: 12f675_fuse_about_to_blow!

    Bert,
    will this make it work as expected?
    Code:
    WHILE COUNTER <= 2      ' 4.608sec Loop time (Loop for 30 mins = 781)
          INTCON.0 = 0
         @ SLEEP
        CLEARWDT
         COUNTER=COUNTER+1
         'IF  GPIO.3= 0  THEN COUNTS 'Bird at box (it's not dark) so continue counting
    WEND
    Dave
    Always wear safety glasses while programming.

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