12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I changed the value to 1022 and the led lit and occasionally flicked off then back on, so right at the end of the 10bit conversion / pot sensitivity. At a value of 1 the led lit with some pot 'travel' still left. So pretty spot on I'd say:

    And for you project you may want to play with some averaging. Analog will tend to drift with a temperature flux (resistors) or more so for your application how sensitive you want the LDR (stray car lights?).
    Mmm, interesting. I want to transmit the data (days total count) when it's dark and the parents have stopped feeding the young for the day. Like you say though, I don't want say the garden PIR light (when the Badger arrives) to effect things so some averaging and tweaking / testing needed here.

    As ever a big thank you for the 8bit ADC program pointer mackrackit. When it came to doing the 10bit conversion I've learned a lot about setting REGISTER bits, I'm still painfully slow but I guess that will improve with time / practise really interesting learning though.

    Code:
    ADFM BIT1= right justified
    Just spotted that this should read ADFM BIT7=1= right justified

    And as for WEND, I suppose elegant would be the word.

    Dave
    Last edited by LEDave; - 11th August 2010 at 10:56.

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


    Did you find this post helpful? Yes | No

    Default

    Just spotted that this should read ADFM BIT7=1= right justified
    But your code was correct....

    Have you done a FOR/NEXT loop yet?
    Here is a snip from an 8 bit averaging. Pretty simple. Some like to throw out the first and last readings and only use the middle values. I guess it depends on the app..
    Code:
    GET_T:
      ADC_TEMP = 0
      FOR X_TEMP = 1 TO 20
      ADCON0=00000001
      GOSUB READ_AD
      S_TEMP = ADRESH
      ADC_TEMP = ADC_TEMP + S_TEMP
      PAUSE 250
      NEXT X_TEMP
      OUT_TEMP = ADC_TEMP / 20
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    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

    Quote Originally Posted by mackrackit View Post
    Here is another way.
    It's not fair you know, Derrel Taylor may have the same initials as me, even the same surname but his brain must be at least twice the size........at least!

    Very clever program (I'll fess up I had to WIKI hysteresis(I had heard of it though)).

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    I sometimes think DT is part machine The stuff he comes up with is invaluable around here. I am just happy that he shares his hard earned knowledge.

    The GUI from Bruce's site I think is written in Visual Basic. Here is something he has to offer.
    http://www.rentron.com/AD_LOG.htm

    Do you have a language for the PC that you use? You could make you own.
    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

    Quote Originally Posted by mackrackit View Post
    I sometimes think DT is part machine The stuff he comes up with is invaluable around here. I am just happy that he shares his hard earned knowledge.
    The same as that. Anyone who gives of their time / knowledge gets my appreciation. Maybe one day I'll be able to help someone out, hey maybe other 'lurker newbies' have been indireclty helped by the Q's I've asked, even the answers I given.

    The GUI from Bruce's site I think is written in Visual Basic. Here is something he has to offer.
    http://www.rentron.com/AD_LOG.htm
    Thanks for that mackrackit.

    Do you have a language for the PC that you use? You could make you own.
    Well I do swear at it from time to time I don't think I'm clever enough to make my own data_logger application though. Interestingly, when I was researching rfpic's, several times I came across Visual Basic being used in applications to store transmitted_data. For this project
    when the daily count is transmitted from rfpic - pic - to serial communicator it will need to be stored somewhere, so maybe a visual basic application could be the answer.

    I have got Microsoft VB 2008 Express Edition on my pc, also Visual C++

    Dave
    Last edited by LEDave; - 11th August 2010 at 15:25.

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


    Did you find this post helpful? Yes | No

    Default

    hey maybe other 'lurker newbies' have been indireclty helped by the Q's I've asked, even the answers I given.
    I would imagine they have been..

    VB 2008.. I hear it is not to bad. Does it have comms built in?
    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

    Have you done a FOR/NEXT loop yet?
    Yes, your good self and Henrik explained FOR/NEXT loop and LOOKUP when I was using a BCD driver to make a seven segment display count up and down from 0-9 and write my name. Seems like ages ago now, it was only February/March this year

    So your example adds the value S_TEMP to the stored value ADC_TEMP which is done 20 times, then the ADC_TEMP value is output as OUT_TEMP a 20 cycle average (I hope I've read this right).

    Now I'm thinking thermocouple / ADC / Seven segment display.....Another project!

    Ah, before I forget, from your ADC/rentron explanation link you posted earlier. The ADC conversion is displayed on a rather nice data logger display, is this logger included in the Microcode studio package the same as the Serial Communicator? Image below:

    Dave
    Attached Images Attached Images  

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