12F675 code sample


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    marad73's Avatar
    marad73 Guest


    Did you find this post helpful? Yes | No

    Talking Thanks all!

    Steve, thanks for all your help - really appreciated.
    One more thing I've got to do is:
    When the reset (mclr) is pulled low, (pushbutton) this thing goes into a reset routine, which I can write with no problem. This routine must reset (or stop) the wdt cycle, turn on a couple of outputs in sequence and run the ADs each time until they are equal. Then, it has to engage the wdt again and go to sleep for 2 minutes or so. (outputs actually running motors until ADs are equal)
    Without pushing mclr putton, it needs to then wake up from sleep every 2 minutes, run the ADs, then turn on the outputs, recheck ADs until equal, then go to sleep again for another 2 minutes.
    These two functions are baffling to me because I find no info about how to use the wdt or mclr to reset as above, in the manual at all. If you can help with some sample code to do this, or tell me where to find it, that will be REALLY appreciated.
    Thanks all!
    Ron
    PS This thing, times 2, is for an azimuth drive for my telescope-in case you are curious! As mentioned before, it operates most of the night, totally off of sunlight it gets during the day.
    PPS I understand seeing stars better than PIC code!!!

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


    Did you find this post helpful? Yes | No

    Default

    Section 9.6 watch dog timer, have to be your friend now. Set the right prescaller in OPTION register and use the TO bit of STATUS.

    This should be something good enough to start.
    Steve

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

Similar Threads

  1. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. 18F8722 sample code
    By George in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th June 2008, 13:42
  5. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44

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