interupt & Sleep Problem - HELP!!


Closed Thread
Results 1 to 4 of 4
  1. #1
    Santana's Avatar
    Santana Guest

    Question interupt & Sleep Problem - HELP!!

    Hello People
    I have a problem i have being trying toget my head round over the past 4 nights andhave come up with no solution so your help would be very much appreciated.

    THE Design
    =========
    i am designing a data logger around the PIC18F452 as i would need 3 interupt sources

    1. RB0 To wakeup the pic then take a reading
    2. RB1 To wakeup the pic then take and take user setting( ie
    Reading interval etc)
    3. RB2 To be used as countdown timer using the 1Hz output
    from a DS1307 RTC

    THE Problem
    =========

    My PIC is asleep at least 99% of time , but RB2 interupt wakes it up when the 1hz pulse is applied
    Is there another way i can count the pulses from the RTC without waking the PIC Or is there another way i can do this without using interupt on RB2?

    The first two interupts works perfectly but i need to include a countdown timer so that i can check when 12 months has elasped


    Please Help as i am slowly runningout of time

    Best Regards

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    You could use Timer1(or 3) configured as a counter and count the external 1Hz pulses. This way you could count pulses for up to six days without waking the pic. If you configure the counter with a prescaler 1:8 and preset it with 11536(65536-54000) you will count 8*54000=432000secs, that's exactly 5 days. When you have had this interrupt 73 times, exactly one year(365days) have passed.

    /Ingvar

  3. #3
    Santana's Avatar
    Santana Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Ingvar
    Thats a good idea have you got any example on how tp set this up

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    I haven't used this pic before but i can't see any major difficulties in setting it up. You already seem to be able to start and service interrups so i won't deal with that. Initialize the timer with ....

    TMR1L = $10
    TMR1H = $2D 'Start timer with 65536-54000=11536
    T1CON = %00110111
    ' here you should input code to enable the interrupt

    ..... in your ISR you should reset the timer to $2D10 again, increment your fivedaycounter and reset the interruptflag.

    Perhaps it would be easier if you posted your code and i'll make the changes that are needed.

    /Ingvar

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 08:21
  2. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  3. UP/down counter & shiftout interupt problem
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd July 2007, 15:56
  4. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21
  5. Wierd sleep issue
    By orca in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th March 2006, 22:06

Members who have read this thread : 1

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