12f675_fuse_about_to_blow!


Results 1 to 40 of 929

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit, everyone.

    I've been doing a lot of reading trying to figure out what's actually going within your Timer / Interrupt program. So here's my interpretation (he typed as he makes a fool of himself again).....!

    Code:
     INTCON.5 = 1    'ENABLE TMR0
    Setting the Interrupt_Control pin.5 = 1 simply enables the Timer0 interrupt.

    Code:
    OPTION_REG = %10000101  '16BIT 1:64 PRESCALE
    First of all you set the Global Interrupt Enable bit.7 =1.
    Then bits 0 = 1 & bit 2 = 1 sets the PRESCALE value 1/64 of the system clock.
    4MHZ or the instruction clock 1MHZ (not 100% sure on that one) This divided down figure is then sent to the TIMER0 register (incremented count from the prescaler).

    When the count goes from FF(HEX) +1 (255 decimal,it over-runs back to zero).

    So (wild assumption here) when the count overflows passed 255 the INTERRUPT occurs and the program jumps to the Label TLOOP. The LED blinks, then INTCON.2 pin is the reset to 0 and it does it all again.

    So basically to my (small) mind the LED would blink every 1/64th of 1MHZ.

    Anywhere warm on this one?

    Dave
    Last edited by LEDave; - 22nd March 2010 at 17:20.

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