Announcement

Collapse
No announcement yet.

ITPS reprogramming ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ITPS reprogramming ?

    Hello,

    i will reprogrammning my iTPS device, then 45 seconds is for me to fast.

    is my new programm right or id there a ather way to programming the turn of secuence make to 13 for switch shutdown and 15min for hard power off ?

    my programm

    ONDELAY equ .5 ;power on delay 1 seconds
    ONDELAY2 equ .5 ;wait 1 second until push button
    BUTTON equ .1 ;push button for 400 ms
    OFFDELAY equ .3900 ;shut down 13 minuten after ignition off
    HARDOFF equ .4500 ;hard off after 15 minuten



    Old programm

    ONDELAY equ .20 ;power on delay 4 seconds
    ONDELAY2 equ .5 ;wait 1 second until push button
    BUTTON equ .1 ;push button for 400 ms
    OFFDELAY equ .25 ;shut down 5 s after ignition off
    HARDOFF equ .225 ;hard off after 45 seconds


    Thanks

    Naruto

  • #2
    Originally posted by naruto
    OFFDELAY equ .3900 ;shut down 13 minuten after ignition off
    HARDOFF equ .4500 ;hard off after 15 minuten

    I dont know what version of firmware you have but what you propose wont work. The program wont take in more than 255 for the delay because its only working within a single byte.

    You will need to add code such that it will loop a much longer delay. Or make a delay that take in 2 bytes values up to 65535 delay value.

    Im sure theres a modified ITPS firmware that do this, ask around

    Comment


    • #3
      i search the forum before and the only was i found is from brooksware2000 that he will post a programm this was at june
      Or a Power ON/OFF Programm from you

      My problem is i have no programming knowlage to programming the ITPS complete new with a loop.

      When there is a FW that has a longer shutdown sequence please sent me the HEX file.

      THX
      Naruto

      P.S. my Firmware what i use was the FW from itps3.zip

      Comment


      • #4
        I cant remember the name of the user who got hold of the modified firmware from the ITPS company.

        The firmware is supposed to have a longer time delay.

        Start a thread or something...or else mail the ITPS guy for the longer delay version of their firmware. Im 99% it does exist

        Comment


        • #6
          Hi,

          i progged with RedZac from another forum a modified fw over a variable there is a shutdown time from 1min to ..... min

          THX

          Naruto

          Comment


          • #7
            What forum was that? Any more details?

            Comment


            • #8
              Hi,

              this forum http://www.car-pc.info/phpBB2/viewforum.php?f=5

              when you need the programm, please send me a pn with your email and i sent you this programm,

              i dont know of right it alowed to put the fw on the forum ?

              The FW has a new variable for min shut down easy way for all times 1 min to xx

              cu

              Naruto

              Comment


              • #9
                Thanks, unfortunately my German is a little rusty

                I also dont know about the legality of posting the firmware; but others have posted firmwares before... Anyway, i sent you a PM...

                Comment


                • #10
                  OK here is the source

                  ;
                  ; Ituner power sequencer
                  ; Modifiziert von Michael Forter und Naruto
                  ; pd 030611 initial code

                  LIST p=12F629 ;Target processor
                  #include "P12F629.INC" ;Header file for target processor

                  ; GP0 = VSW12 input 1 = ignition turned on
                  ; GP1 = ON output 1 = turn power on
                  ; GP2 = MBON# o.d. 0 = power button pressed
                  ; GP3 = n.c. input
                  ; GP4 = MBON2# o.d. 0 = power button pressed (parallel out,
                  ; makes connector flip-tolerant)
                  ; GP5 = n.c. output 0 = terminate unused pin

                  ; Schutdown Zeit einstellen die länge kannst du im wait3 oder im wait2 ändern
                  ; wait1 ist ca. 250ms
                  ; wait2 multipliziert mit 255. also 255 mal 250ms
                  ; und wait3 das ganze nochmals mal timeoff

                  ; Equates

                  PWR_OFF equ 0x00 ;power off state
                  PWR_ON equ 0x02 ;power on state

                  SW_ON equ 0x09 ;direction for switch on
                  SW_OFF equ 0x1d ;direction for switch off

                  ONDELAY equ .5 ;power on delay 1 seconds
                  ONDELAY2 equ .2 ;wait 800ms second until push button
                  BUTTON equ .1 ;push button for 400 ms
                  OFFDELAY equ .5 ;shut down 5 s after ignition off (nicht mehr so wichtig wg Timer)
                  HARDOFF equ .225 ;hard off after 45 seconds

                  timeoff equ D'10' ;ca. 10min Pause 1= 1,02 min HIER ÄNDERN FÜR ABSCHALTDAUER !!!

                  ; Register variables

                  cntr equ 0x20 ;state counter
                  cntr2 equ 0x21
                  waitl equ 0x22 ;delay counter low
                  waitm equ 0x23 ;delay counter mid
                  waith equ 0x24 ;delay counter high
                  loops Equ 0x25 ; Zähler für Warteschleife
                  loops1 Equ 0x26 ; Zähler für Warteschleife
                  loops2 Equ 0x27 ; Zähler für Warteschleife
                  loops3 Equ 0x28 ; Zähler für Warteschleife


                  ; reset entry

                  org 0
                  goto reset

                  ; interrupt entry

                  org 4
                  retfie

                  reset
                  banksel OSCCAL ;get oscillator calibration
                  call 0x3ff
                  movwf OSCCAL & 0x7f

                  movlw b'100000' ;enable weak pull-up on
                  movwf WPU & 0x7f ;GP5 (doesn't seem to work...)

                  movlw b'00001101' ;set option register
                  ;enable weak pull-ups
                  ;timer0 internal clock, positive edge
                  ;prescaler -> WDT, 1:32 -> ~0.5s
                  movwf OPTION_REG & 0x7f

                  reset2
                  banksel TRISIO
                  movlw SW_ON ;set pin directions
                  movwf TRISIO & 0x7f

                  banksel GPIO
                  movlw PWR_OFF ;set initial state
                  movwf GPIO

                  movlw 7
                  movwf CMCON ;disable comparator

                  clrwdt ;clear watchdog




                  ; initial state - wait until ignition is on for ONDELAY

                  initial
                  banksel GPIO
                  movlw ONDELAY ;initial power on
                  movwf cntr

                  initwait call delay200 ;wait
                  btfss GPIO,0 ;ignition on ?
                  goto initial ;no: clear counter
                  decfsz cntr,f ;initial time-out
                  goto initwait




                  ; turn power on, wait ONDELAY2

                  turnon movlw PWR_ON
                  movwf GPIO
                  movlw ONDELAY2 ;wait for ONDELAY2
                  movwf cntr
                  turnon1 call delay200 ;wait
                  decfsz cntr,f
                  goto turnon1
                  btfss GPIO,0 ;ignition on ?
                  goto reset2 ;no: turn off again



                  ; push the system board power button

                  banksel TRISIO
                  movlw SW_ON ;push the button
                  movwf TRISIO & 0x7f
                  banksel GPIO
                  movlw BUTTON ;wait for BUTTON
                  movwf cntr
                  button1 call delay200 ;wait
                  decfsz cntr,f
                  goto button1
                  banksel TRISIO
                  movlw SW_OFF ;release the button
                  movwf TRISIO & 0x7f
                  banksel GPIO


                  ; power on state - shut down if ignition off for OFFDELAY


                  onstate movlw OFFDELAY
                  movwf cntr
                  onstate1 call delay200
                  btfsc GPIO,0 ;ignition on ?
                  goto onstate ;yes: reset timer
                  decfsz cntr,f
                  goto onstate1



                  ; Warteschleife für Power OFF


                  Wait3
                  movlw timeoff ; zeit wie Variabel
                  movwf loops3


                  Wait2
                  movlw D'255' ; 63,75s Pause
                  movwf loops2


                  Wait1
                  movlw D'125' ; 250 ms Pause
                  movwf loops1

                  Wai
                  movlw .220 ; Zeitkonstante für 1ms
                  movwf loops
                  Wai2 nop
                  nop
                  nop
                  nop
                  nop
                  clrwdt ;Watchdog reseten
                  decfsz loops, F ; 1 ms vorbei?
                  goto Wai2 ; nein, noch nicht
                  ;
                  decfsz loops1, F ; 250 ms vorbei?
                  goto Wai ; nein, noch nicht

                  decfsz loops2, F ; 63,75s vorbei?
                  goto Wait1 ; nein, noch nicht

                  decfsz loops3, F ; 14.875min vorbei?
                  goto Wait2 ; nein, noch nicht

                  ; power on state - shut down if ignition off for OFFDELAY

                  onstate3 movlw OFFDELAY
                  movwf cntr
                  onstate2 call delay200
                  btfsc GPIO,0 ;ignition on ?
                  goto onstate ;yes: reset timer
                  decfsz cntr,f
                  goto onstate2

                  ; shut down - push the system board power button

                  banksel TRISIO
                  movlw SW_ON ;push the button
                  movwf TRISIO & 0x7f
                  banksel GPIO
                  movlw BUTTON ;wait for BUTTON
                  movwf cntr
                  button2 call delay200 ;wait
                  decfsz cntr,f
                  goto button2
                  banksel TRISIO
                  movlw SW_OFF ;release the button
                  movwf TRISIO & 0x7f
                  banksel GPIO



                  ; turn-off state - turn off power after HARDOFF
                  ; go back to restart after ONDELAY

                  movlw HARDOFF
                  movwf cntr
                  movlw ONDELAY
                  movwf cntr2
                  shut1 call delay200
                  btfss GPIO,0 ;ignition on ?
                  goto shut2 ;:no
                  decfsz cntr2,f
                  goto turnon ;go turn-on if ignition on for ONDELAY
                  goto shut3

                  shut2 movlw ONDELAY ;ignition off - restart on timer
                  movwf cntr2
                  shut3 decfsz cntr,f
                  goto shut1 ;keep waiting
                  goto reset2 ;do hard power off

                  ; retlw 0 ; das Warten hat ein Ende




                  ; 200 ms delay routine

                  delay200 clrwdt ;tickle the watchdog
                  movlw .1 ;note count is +1 (decfsz !)
                  movwf waith
                  movlw .0
                  movwf waitm
                  clrf waitl
                  del1 decfsz waitl,f ;delay loop - 3 us per iteration
                  goto del1
                  decfsz waitm,f
                  goto del1
                  clrwdt
                  decfsz waith,f
                  goto del1
                  retlw 0



                  ; oscillator calibration - comment out for production !!!

                  ; org 0x3ff
                  ; retlw 0x94




                  ; define configuration bits

                  __config _MCLRE_OFF & _CP_OFF & _WDT_ON & _PWRTE_ON & _INTRC_OSC_NOCLKOUT

                  ; external reset off
                  ; code protection off (not read protected)
                  ; note: if code protection is switched from on to off, OSCCAL
                  ; value is erased too !!!
                  ; watchdog timer enabled
                  ; data memory protection off (not used)
                  ; internal RC oscillator
                  ; brown-out detect enable
                  ; power-up timer enable

                  END

                  Comment

                  Working...
                  X