Timer PIC16F57


Closed Thread
Results 1 to 26 of 26

Thread: Timer PIC16F57

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Hi, leonel

    At each interrupt, you increment ( or easier decrement !!! ) a counter ...which (inc) rements another counter if the first overflows ... which ( inc ) rements ...

    etc. etc.

    Permits to do something else during blinking ... ( isn't it Dwayne ??? )

    can be done with PBP or directly with assembler ... ( No, ... i didn't tell it ... my doctor said: no shock on the head, ... )

    Alain

    PS : No interrupt ... so you poll for TMR0 overflow !!!
    Last edited by Acetronics2; - 29th June 2005 at 18:05.

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Alain,

    Alain >>Permits to do something else during blinking ... ( isn't it Dwayne ??? )<<

    Don't know <smile>. Simple program to blink a light?

    With change of Chips? With no info on the final project, With no intended purpose but to blink a light, and "Simple example"? I can only assume a Blinky Light...Hopefully He will have it running, and if the info we gave him doesn't pan out, He can give us more info, so that we can become a little more detailed <g>.

    Like What Ralph posted on the FAQ...

    Need chip #, Code, details, Projects purpose, and other things.
    I rememeber a while back, a person asked to change a 4 (separate) byte Hex to Decimal...I gave him the code, then his example had 5 (separate) bytes coming in, and he wondered why it didn't give him the right answer<g>.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Feb 2005
    Location
    Portugal
    Posts
    79


    Did you find this post helpful? Yes | No

    Default Pause command

    Using pause command i donīt see if any other input. What i want is put my output high during 20s but at the same time see if other input goes high. If it goes high i will start over again, my time goes to 0s, and i will start counting 20s

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, leonel ...

    Don't shout at me but I did something like that with a resettable 555 and some CD4000 logic ... it was in one of my prior lives.

    Said honestly, the 16F57 is not really the best Choice here ...

    Alain

  5. #5
    Join Date
    Feb 2005
    Location
    Portugal
    Posts
    79


    Did you find this post helpful? Yes | No

    Default Space problems

    Yes, i know thatīs not the best choice, but itīs what i have i know that with some logic i can do that, but i have 8 inputs and mixing all together i will need "some CD4000" and i have space problems (in my box i have to put 8 relays, and all electronic...), thatīs why i want to use a cheaper PIC...

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Your project looks like a quizz box ...

    20 second to answer ... who's the quickest of 8 !!!

    we REALLY need to know a lot more about your top secret weapon. ...

    if you really want help, of course

    Alain

  7. #7
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Loenel,

    How accurate does it have to be on blinking every 20 seconds?
    We now have concluded that there is muching going on, thus, it is not just a simple "Blink" a light.

    1. How long of a pause is allowed?

    For example: Untested... but the idea is there...

    Code:
      Counter1 var word
      Counter2 Var word
      Loop:
      Counter1=0
      Counter2=0
      Loop2:
       if Counter1< 20
         if Counter2 <1000
             Pause 1  'Pause 1/1000 of a second
             CheckButtons....
             Do stuff...
             CheckButtons....
             Do Stuff
                if CheckButtons==Pushed then goto Loop
             Counter2=Counter2+1;
         Endif
         
         if(Counter2>=1000)
           Counter1=Counter1+1;
           counter2=0;
         endif
       endif
       if Counter1<20 goto Loop2
    
      Blink light = on
      Pause 200  'pause 1/5 of a second to light up the light.
      Blink Light = off
      goto Loop:
    Granted, this is a "oversimplification" of code. But it is a generic program that will allow lights to be blinked and still scan keys once ever 1/1000 of a second (with the exception of a blinky light.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  8. #8
    Join Date
    Feb 2005
    Location
    Portugal
    Posts
    79


    Did you find this post helpful? Yes | No

    Default My secret weapon ;)

    Ok, i'll explain my secret weapon
    I have 8 buttons that will control relays. One button corresponds to one relay. If itīis pressed i turn on the relay and stays on for 20s or 40s (depending the position of a switch). If one button is pressed while one relay is on the time goes to begin and the two relays stays on again 20s or 40s. On led is on if one relay is on...
    Hereīs my secret weapon
    It was simple if i was using PIC16F872 (thatīs the PIC i know better...)
    My pulse itīs 200ms and the time itīs not critical (if i have 17s instead 20s thatīs ok)

Similar Threads

  1. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 17:39
  2. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  3. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  4. Timer interrupt frequency
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th January 2009, 23:49
  5. timer interupt help 16f73
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd July 2005, 08:41

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