microcontroller task- reaction timer+generating the delay of 1ms using TMR0

Discussion in 'Embedded Systems and Microcontrollers' started by GautamVK, Dec 5, 2010.

  1. GautamVK

    Thread Starter New Member

    Dec 5, 2010
    Hello there

    I have task to complete urgently.. and i am looking for codes for PIC16F628... If you have or if you come across the codes for the following task below! please forward it!


    By pressing SW1, user starts the operation of the program. It waits until SW1 is released by the user, and generates a random number RND in the range of 0..7 and displays it using LD3, LD2 and LD1 (this action would normally hidden from the user,or be used for an electronic dice) for 0.5s. The program then switches LD3, LD2 and LD1 off, and switches LD4 on for 0.5 + RND*0.2s. After that it measures time after which the user presses SW2, and displays the result using all the LEDs with the resolution of 10ms (or all LEDs if the time was over 1s)

    The preipheral program must use TMR0 to generate Pricise 1ms delay instead of the program provided.
    The interrupt program must set LD6 on when TMR0 interrupt occurs.
    The Question: Why you may want to use your program instead of the program provided.

    Thanks plenty!
    Last edited: Dec 5, 2010
  2. Markd77

    Senior Member

    Sep 7, 2009
    GautamVK likes this.
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    GautamVK likes this.
  4. GautamVK

    Thread Starter New Member

    Dec 5, 2010
    i am having a problem with the whole stuff indeed :(

    @t06afre- would wish for the code in assembler...