Single event data logger wth LCD


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20

    Question Single event data logger wth LCD

    Hi everybody, I am struggling most of the time with PICs, this is my first post...does anyone have an event logger design such that on a switch closure, count = 1, and measure time interval of closure, then log number of times switch has closed, with total time, and total number of switch closures, displayed on LCD module?
    range up to 256 for count and 24 hours. Please ask if this isn't clear.
    Cheers

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


    Did you find this post helpful? Yes | No

    Default

    Easy to do with almost all RTC and a external EEPROM, or skip the RTC and use ElapsedTimer example.
    Steve

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

  3. #3
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Question Single even data logger

    I don't understand your reply and is it not possible to impliment solution with a single chip?
    Do a 16F84 not have enough data space?
    Rgds

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by med2007 View Post
    I don't understand your reply and is it not possible to impliment solution with a single chip?
    Do a 16F84 not have enough data space?
    Rgds
    Sure it do (does...) have enough data space...
    If you want to record 64 events, each of which are only one byte wide data, or 32 events of 2 byte data, or 16 events of 4 byte data, or 8 events of 8 byte data, or 4 events of 16 byte data, or 2 events of 32 byte data, or one event of 64 byte data.
    See where I'm going with this?
    We don't know: what you are logging (A) and how often you are logging it (B).
    A x B = total data space required.

    Some simple math and a quick trip to the datasheets will answer all your questions.

  5. #5
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile Data logger

    As a complete NOOB I am struggling again, my interrupt handler doesn't work. It's for a timer
    and this code is only part of the complete project. It should pulse portb.0 and susequently portb.2 It does not work. Please help if you have the time. Rgds Mike

    'Using 16F628 4MHz crystal
    secs var byte
    mins var byte
    clear

    option_reg = %10000111
    intcon = %10110010

    test:
    on interrupt goto seconds
    goto test

    disable
    seconds: 'Interrupt Handler 'Disable interrupts during Handler
    secs=secs+1
    intcon.2=0 'interrupt bit 2 must be rest in software
    if secs=10 then
    mins=mins+1
    secs=0
    high portb.0
    pause 1
    low portb.0
    endif
    if mins=5 then gosub minutes
    resume test
    enable 'Re-enable interrupts after Handling

    minutes:
    mins=0
    intcon.2=0
    secs=0
    high portb.2
    pause 5
    low portb.2
    return

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    The setup is a bit goofy in my mind, but if it works for you, great...
    This is the way I'd do it (keep in mind I don't have my 'stuff' handy, so the register setup might be off)

    Code:
    secs var byte : mins var byte : dummycounter var byte
    clear
    option_reg = %10000111 : intcon = %10110010           
    goto skip_ints_and_subs
    on interrupt goto int_handle
    disable
    int_handle:
    intcon.2 = 0
    secs = secs + 1
    if secs = 10 then
         mins = mins + 1 : secs = 0 : high portb.0 : pause 1 : low portb.0
                                '1ms?  sure you'll see the pulse?
    endif
    if mins = 5 then
         mins = 0 : secs = 0 : high portb.2 : pause 5 : low portb.2
                                '5ms?  probably won't see this pulse either
    endif
    resume
    
    enable
    skip_ints_and_subs:
    dummycounter = dummycounter + 1
    goto skip_ints_and_subs
    Again, check your pulse length on the LED flash. Increase it maybe.

  7. #7
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile Single Event Data Logger with LCD

    Quote Originally Posted by mister_e View Post
    Easy to do with almost all RTC and a external EEPROM, or skip the RTC and use ElapsedTimer example.
    Thanks for your help with my project, it is now almost complete and working well enough.
    In the end I didn't use an Interrupt Handler, just counted until intcon.2=1, fairly accurate for what I want, about +-0.02%, according to my real time clock.
    I've packaged the result as a demo, hoping to strike up some interest with a few of my chums...you never know?
    Rgds
    Mike

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Nokia 3310 display text
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th August 2007, 03:39
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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