DS18B20 interfers with Timer 2 interrupts


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Great minds.... I was just in the process of longer times between interrupts given all the math and I/O and conversion. I will look into Timer1 and the other tricks. But I still find it a mystery why the clock runs FASTER with the DS. If I'm missing interrupts without it, adding the DS should make it worse.

    Thanks for all the pointers and I will update when i actually figure it out (if not sooner).

    John

  2. #2
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    ok what i did was to use Timer 1 (16 bit) with a prescale of 1:8 at 4 MHz. This gives me 1usec*65K*8 or about 0.5sec interrupt period.

    Now with or without DS readout I get the same clock speed, and get the calculated interrupt period. So looks like this will work. Trick is to also be sure all lengthy PAUSE statements are broken into DO loops of 1msec PAUSEs and no other "WAIT" options. The readout of the DS doesn't seem to be a problem since I issue a convert command, then test for BUSY bit in a loop, so it can be interrupted.

    If I had a 32 KHz xrystal I would run an external clock, but don't right now. Can get een longer interrupts that way (including a realtime clock).

    The biggest reason in going to Timer 1 from 2 was the 16 bit count registers for 1 vs 8 bit for 2 (even though you can adjust the clock)...win some and loose some.

    So this fixes my problems. Thanks for the good suggestions.

Similar Threads

  1. PICkit 2 and RBC interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 4th April 2009, 02:33
  2. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  3. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  4. Totally Baffled with Elapsed Timer
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th June 2008, 21:01
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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