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

    I am on the road again with a small display but what I can see looks good!

    I take you have ran it a few times and it is working as expected?
    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

    I take you have ran it a few times and it is working as expected?
    I've got a bug (it maybe a small infestation!)...(I could have swore it worked earlier!)

    I spoke too soon, 'Mission' incomplete. I'll try and debug it later tonight.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    I added a couple things, messes up your averaging part (never gets there now) but maybe this will help.
    Other than that it is looking good!!!!
    Code:
    MC_S:                     'MC Starts subroutine
    READ 12, M_s              'Read current number of M/C Starts
    LET M_S = M_S + 1         'Increment value by one
    '#######
    IF M_S > 5 THEN
    M_S = 0
    ENDIF
    '#######
    WRITE 12, M_S             'Save new value
    READ 12, M_s              'Read latest value
    pause 150                 'Give LCD a chance to Power_up
    LET M_S = M_S             'Set value to display
    LCDOUT $FE,$C0, "Machine Starts=",DEC M_S 'Display M/C Starts on LCD from EEPROM
    RETURN
    
    Power_up:                 'Power_up subroutine
    Read 0, Total.HIGHBYTE      ' Read high byte
    Read 1, Total.LOWBYTe     ' Read low byte  
    '#######
    IF TOTAL > 5000 THEN
    TOTAL = 0
    ENDIF
    '#######
    LET Total = Total         'Set Total to value set in EEPROM Memory
    pause 150                 'Give LCD a chance to Power_up
    LCDOUT $FE,2,"Total=",DEC Total 'At Power_up display Total on LCD from EEPROM
                              'Memory which has been stored since Power_down                      
    return
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit

    Thanks for the 'addins' I've run the program and apart from 'Total' (when the program starts for the first time after compiling not equalling zero) I reckon it works, even the Av_Parts_Run works if you subtract that spurious 'Total' figure, so well pleased.

    What do you reckon?

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Set things up so when a pin is held HIGH at start-up the EEPROM is re-set to zeros. Then you should have a complete counting/storage system that can be re-set.

    Now we have to think of something else for you to do
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Set things up so when a pin is held HIGH at start-up the EEPROM is re-set to zeros. Then you should have a complete counting/storage system that can be re-set.
    Gotcha......

    Now we have to think of something else for you to do"
    How about this for a quick diversion: How are we on using a PIC to drive a servo motor?

    We've been getting a visitor to our garden late at night (we think it's a Badger) and would like to film it. I've got a FUTABA FP-5148 servo that I'd like to link up to a cable release to press the record button on a video camera after receiving an input from a PIR to the PIC.

    The sequence is this:

    1/ PIR 'beam' get broken by 'Creature'.
    2/ PIC activates servo to move cable release out and turn camera on.
    3/ PIC waits 10 secs while camera boots up.
    4/ PIC activates servo again moves cable release out turns camera record on (same button).

    The camera will record on it's own for 10 mins then powers down.

    5/ If PIR been is still broken (creature still there) after 9min:30secs servo presses record button again.

    6/ PIR beam 'closes' creature has gone, camera powers down.

    What do you think mackrackit?

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Sounds like fun...
    But what do you do when you find out it is a badger... or not

    Do you have the data sheet for the servo? PIR?
    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