Timer PIC16F57


Closed Thread
Results 1 to 26 of 26

Thread: Timer PIC16F57

Hybrid View

  1. #1
    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...

  2. #2
    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)

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


    Did you find this post helpful? Yes | No

    Unhappy

    ok ..something usable now ...
    Last edited by Acetronics2; - 30th June 2005 at 10:29.

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