flashing a led with TMR0


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

    Default flashing a led with TMR0

    Hello everybody

    I want to flash a led all the seconds I would like to use the TMRO and the prescaler at 256 and a routine of interruption browsed 8 x
    With one 16f84 4 Mhz
    Can you help me?

  2. #2
    TONIGALEA's Avatar
    TONIGALEA Guest


    Did you find this post helpful? Yes | No

    Question

    i couldn't really figure out what you want to do.
    could you kindly break it down..
    do you want to flash an led once a second ?
    Not quite sure what you want


    Toni

  3. #3
    ely's Avatar
    ely Guest


    Did you find this post helpful? Yes | No

    Default

    Hello Toni

    The purpose:
    to flash an led once a second--> temporization of 500 ms
    By using the TMR0 and the prescaler configured in 256

    calculation:
    if my PIC run 4 Mhz
    An interruption--> all 256 us

    prescaler configured in 256
    An interruption--> all 256*256=65536 us

    I must use a interrupt routine
    500000/65536=7.63-->8X


    sorry for my poor englich

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Did somebody set this as Homework?

    I'm not getting involved in this thread, other than to say would it not be more sensible to consider using TMR1 prescaled by 8 and preloaded with $0BDC? I'll let you figure the maths and the rest from the Datasheet...

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 2

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