Menu

12f508 tmr0 prescaler

Help
salvo
2012-02-21
2013-05-30
  • salvo

    salvo - 2012-02-21

    hi guys

    i need to assign a 1/8 prescaler to TMR0 (osc = XT) on this chip,
    but when i do with set up tmr button it doesn't work at all
    even if i try to set off the wdt.
    any idea?
    thank you very much
    salvo

     
  • salvo

    salvo - 2012-02-21

    sorry i forgot to add the basic code
    here it is:
    ;Chip Settings
    #chip 12F508,4
    #config WDT=OFF, OSC=XT

    ;Defines (Constants)
    #define rcin gpio.3
    #define fw gpio.0
    #define rw gpio.1

    ;Variables
    Dim rcvalue As byte
    InitTimer0 Osc, PS0_1/8
    Dir rcin In
    Dir fw Out
    Dir rw Out

    start:
    Wait Until rcin on
    ClearTimer 0
    Wait Until rcin off
    rcvalue = tmr0
    If rcvalue > 150 Then
    set fw on
    else
    set fw off
    End If
    rcvalue = 0
    goto start

    thank you

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.