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

    Really sorry for the late reply, has been one of those days today.
    Days???
    I have been having one of those weeks
    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

    Hi mackrackit,

    I have been having one of those weeks
    Lol..... Nice to know I'm not alone, you do have my sympathy though.

    Here's what I thought was a silly question, now I'm not so sure it is:

    When you declare a VAR WORD, I thought that the value would automatically be set at zero, now I'm not so sure it is. Do you have to have to re-set it to zero before you start a count program or is it zero already?

    I know it's Friday tomorrow but I hope your week gets better.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Sometimes it will be zero at power up but you never know.

    You can use CLEAR, in the manual

    or

    VAR_IN_QUESTION = 0

    Not a stupid question at all
    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

    Not a stupid question at all
    Cheers mackrackit, I'm feeling better already I hope you are too!

    So probably good practice to set VAR_IN_QUESTION = 0 just in case.

    Hopefully I'll have moved the program on tomorrow, fingers x'd.

    Right, time for me bed.

    See you tomorrow.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Hint
    COUNT is for pulses in a time period.

    Maybe
    if switch goes high
    then
    var = var + 1
    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

    Hi mackrackit,

    Question: How long does it take LEDave to wire a push_button_switch to a PIC16F684?

    Answer: About 48hrs

    I think the program below should work ok:

    Code:
    Total var word
    clear
    
    MAIN:
    if PORTA.5 = 0  then  count_up:
    IF PORTA.5 = 1  THEN      MAIN: 
        
    Count_up:
    let Total = Total + 1 
    pauseus 25   
    LCDOUT $FE,1
    LCDOUT $FE,$C0,DEC Total
    PAUSE 500    
    GOTO MAIN:
    LEDave current status: Eyes going, mind boarderline!

    Dvae

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by LEDave View Post

    I think the program below should work ok:

    Code:
    Total var word
    clear
    
    MAIN:
    if PORTA.5 = 0  then  count_up:
    IF PORTA.5 = 1  THEN      MAIN: 
        
    Count_up:
    let Total = Total + 1 
    pauseus 25   
    LCDOUT $FE,1
    LCDOUT $FE,$C0,DEC Total
    PAUSE 500    
    GOTO MAIN:
    It looks good.
    LEDave current status: Eyes going, mind boarderline!

    Dvae
    Hey, that means you have passed the initiation and are a full codder now.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    So the next thing it to WRITE 'Total' to EEPROM address, then READ that value and put it back into 'Total'.

    The theory is that when the PIC power supply is turned off then restarted last 'Total' reappears on the LCD.

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Yup, that is the mission
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    From the manual:

    Code:
     WRITE Address,Value
    So looking at the 16F684.PDF it says:

    The PIC16F684 has 256 bytes of data EEPROM
    with an address range from 0h to FFh.
    So would:
    Code:
    WRITE 0h,Total
    work? Not quite as simple as that he says! For one thing these are EEPROM BYTES and 'Total' is a WORD two BYTES for a starter.

    Dvae

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