Single event data logger wth LCD


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    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.

  2. #2
    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

  3. #3
    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.

  4. #4
    Join Date
    Jan 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    if secs = 10 then
    mins = mins + 1

    Did you mean:-

    if secs = 60 then
    mins = mins + 1

    ... Steve

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scarroll01 View Post
    if secs = 10 then
    mins = mins + 1
    Did you mean:-
    if secs = 60 then
    mins = mins + 1
    ... Steve
    Nope...if the O/P put 10 and his minutes are 10 seconds long, then great...
    Besides...if you're making something, and something else isn't working...I don't know about you, but I'd rather wait 10 seconds to see if something doesn't work rather than 60 of them seconds.
    Can always change it later...

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


    Did you find this post helpful? Yes | No

    Smile Data logger

    Too right 10 seconds is for test purposes.
    I have tried your code skimask and it does do something..however a bit strange, is there a way of posting scope waveforms on this forum? I think my scope will produce either jpg or bitmap, I'll check it out.
    Rgds
    Mike

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by med2007 View Post
    Too right 10 seconds is for test purposes.
    I have tried your code skimask and it does do something..however a bit strange, is there a way of posting scope waveforms on this forum? I think my scope will produce either jpg or bitmap, I'll check it out.
    Rgds
    Mike
    I'm guessing here...'cause I don't see ALL of your code...just a couple of ideas...

    You're probably seeing jitter caused by ON INTERRUPT.

    The ON INTERRUPT is probably being triggered at different points in the code and might have a different amount of clock cycles before it actually gets into the interrupt code.
    The number of cycles it takes to get to the interrupt code might be different between the 'dummy = dummy + 1' part and the 'goto main' part.

    WDT on? If it is, might be timing out causing the PIC to reset, resetting all the variables, therefore screwing up the timing overall.

    EDIT: Forgot to mention that using DT's Fast Interrupt routines would most likely solve any interrupt latency issues.
    Last edited by skimask; - 23rd January 2008 at 15:08.

Similar Threads

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