how to interface an external timer and changing the value at runtime

Discussion in 'Embedded Systems and Microcontrollers' started by devmania, Aug 27, 2010.

  1. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    Hello Everyone,

    I want change the timer value during run time. How should i do that? I also wanted to see timer value on LCD module ? How should i do that? Suppose initially i had given timer value as 10sec and later on during run time i want to change the timer value to 20sec, and these values i have to see on the LCD . Please help in me doing it.
     
  2. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    Hello ,

    I will try to explain you what am working on, There are two motor initially i will give some 10 sec delay between both the motor and this delay should be displayed on lcd. Then after some time i need to set timer for 30 sec between these motor which will also be displayed on lcd. This is like HMI ( human machine interface ) externally i want to change the timer according to my need.
     
  3. AMIT_GOHEL

    Member

    Jul 13, 2010
    67
    7
    First tell me which controller you suppose to use for your project..
     
  4. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    I am thinking to go with pic controller or at89c51 . which one you suggest?
     
  5. AMIT_GOHEL

    Member

    Jul 13, 2010
    67
    7
    I've worked with 89c51,but not worked on pic(planning to learn) yet.so any expert may ans this question..

    But about one thing i'm sure that you can do your project wih 89c51 easily..
    use port 1 and few pins of port 2 for LCD and port 0 for motor(via relay) or other thing u suppose to connect...
     
  6. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    Thanks Amit ,
    But my requirement is something different from what you replied ..
     
  7. AMIT_GOHEL

    Member

    Jul 13, 2010
    67
    7
    At port 0 connect keypad or somthing which can change port pin 0/1 .
    make program in such a way that it continousely cheaks the value of that pin/pins,and according to that it loads the value of Th0 and Tl0,which are actualy responsible for the delay you are going to provide..
     
  8. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    can i use a pot ? and i want the value should be displayed on LCD
     
  9. AMIT_GOHEL

    Member

    Jul 13, 2010
    67
    7
    Ans1. POT is only to set the contrast of LCD..

    Ans2. First move the data of T0 to reg A,then from A to port u suppose to use for dataline of LCD..
     
  10. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    Thanks Amit ,

    I will start trying it , if i get stuck i will contact you again .
    Thanks yaar.
     
  11. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
    Hello,

    If the microcontroller has an ADC, you can connect a pot to it.
    You can read the ADC value to change the timer setting.

    Bertus
     
  12. devmania

    Thread Starter New Member

    Aug 22, 2010
    17
    0
    Hello ,

    i will tell you what exactly i want to do -
    my aim is to switch on and off of a valve . initially there will be some delay let say 10 sec of delay between two valve. so when my system is on i will be able to see the delay value on the LCD. The process will continue. Now after some time i want to increase or decrease the timer value with the help of a push button , this value will be shown on the LCD. this is the total task .

    Now what should i do. i am thinking for AT89c51 microcontroller and i will write the program in C language.
     
Loading...