hi, i created a program in jalv2 , if i try to compile it , jal just
'stuck"
if i set the variable 'vacuum' as a byte , it compiles fine but the pic
doesn't stay in the forever loop, it keep's sending 'H' to my computer
if i set the variable 'vacuum'as a word it just stuck if i try to compil it.
this is the program :
include 16f1827 -- target PICmicro
pragma target clock 32_000_000 -- oscillator frequency
--
pragma target OSC HS -- crystal or resonator
pragma target PLLEN disabled -- PLL off
pragma target WDT DISABLED -- watchdog
pragma target BROWNOUT DISABLED -- brownout reset
pragma target FCMEN DISABLED -- clock monitoring
pragma target IESO DISABLED -- int/ext osc. switch
pragma target LVP DISABLED -- low voltage programming
pragma target MCLR EXTERNAL -- reset
enable_digital_io()
alias pin_TX is pin_TX_RB2
alias pin_RX is pin_RX_RB1
alias pin_TX_direction is pin_TX_RB2_direction
alias pin_RX_direction is pin_RX_RB1_direction
RCSTA_SPEN = TRUE
const serial_hw_baudrate = 19200
include serial_hardware
serial_hw_init()
const byte ADC_NVREF = ADC_NO_EXT_VREF
const word ADC_RSOURCE = 2_000
const bit ADC_HIGH_RESOLUTION = high
include adc
adc_init()
include print
--in / uit gangen
--pin_b1_direction = output
pin_a0_direction = input
pin_b4_direction = output
pin_a2_direction = input
pin_a3_direction = input
pin_an7_direction = input
pin_b3_direction = output
pin_a1_direction = input
PIN_B0_DIRECTION = OUTPUT
--pin_a5_direction = input
pin_b6_direction = output
pin_b7_direction = output
--aliassen
pin_b0 = low
pin_b3 = low
set_analog_pin(3)
set_analog_pin(4)
set_analog_pin(7)
alias knop is pin_a2
ALIAS GASKLEP IS PIN_A0
alias inj is pin_b0
alias injec is pin_b3
var byte intijd
pin_b4 = low
var byte extratijdgroot
var bit de
var word vacuum
-------------------------------------------------------->>>>> this one
VAR word TOERENTAL
var dword rpm
var word teller
var byte extratijd
var byte welke
var byte temp
var byte temperatuur
VAR BIT TRIGGER
rpm = 570
serial_hw_write("H")
serial_hw_write("H")
forever loop
while pin_a1 == low loop
rpm = rpm + 1
end loop
Teller = 0
while pin_a1 == high loop
teller = teller + 1
IF teller > 65000 THEN
teller = 3
END IF
if teller == 1 then
intijd = adc_read_low_res(3)
vacuum = adc_read_low_res(4)
temp = adc_read_low_res(7)
IF rpm < 700 THEN
print_Dword_dec(serial_hw_data,rpm)
print_crlf(serial_hw_data)
serial_hw_write("F")
serial_hw_write("O")
serial_hw_write("U")
serial_hw_write("T")
END IF
rpm = rpm * 100
rpm = rpm / 660
rpm = 6000000 / rpm
rpm = rpm / 2
EXTRATIJD = 0
IF KNOP == HIGH & TRIGGER == 1 THEN
print_word_dec(serial_hw_data,vacuum)
print_crlf(serial_hw_data)
print_dword_dec(serial_hw_data,rpm)
print_crlf(serial_hw_data)
end if
toerental = 0
TRIGGER = 0
IF KNOP == LOW THEN
TRIGGER = 1
END IF
if temp < 30 then
temp = 200
end if
---
----
-----
------
IF rpm > 600 & rpm < 1400 THEN
TOERENTAL = 1
END IF
IF rpm > 1400 & rpm < 1700 THEN
TOERENTAL = 2
END IF
IF rpm > 1700 & rpm < 2200 THEN
TOERENTAL = 3
END IF
IF rpm > 2200 & rpm < 2700 THEN
TOERENTAL = 4
END IF
IF rpm > 2700 & rpm < 3300 THEN
TOERENTAL = 5
END IF
IF rpm > 3300 & rpm < 3800 THEN
TOERENTAL = 6
END IF
IF rpm > 3800 & rpm < 4300 THEN
TOERENTAL = 7
END IF
IF rpm > 4300 & rpm < 4900 THEN
TOERENTAL = 8
END IF
IF rpm > 4900 & rpm < 5400 THEN
TOERENTAL = 9
END IF
IF rpm > 5400 & rpm < 5800 THEN
TOERENTAL = 10
END IF
IF rpm > 5800 & rpm < 6500 THEN
TOERENTAL = 11
END IF
--------
-----------
------------
if vacuum > 230 then
vacuum = 1
end if
if vacuum < 230 & vacuum > 210 then
vacuum = 2
end if
if vacuum < 210 & vacuum > 190 then
vacuum = 3
end if
if vacuum < 190 & vacuum > 170 then
vacuum = 4
end if
if vacuum < 170 & vacuum > 150 then
vacuum = 5
end if
if vacuum < 150 & vacuum > 130 then
vacuum = 6
end if
if vacuum < 130 & vacuum > 110 then
vacuum = 7
end if
if vacuum < 110 & vacuum > 90 then
vacuum = 8
end if
if vacuum < 90 & vacuum > 70 then
vacuum = 9
end if
if vacuum < 70 & vacuum > 50
then------------------------------------------> if i delete this 3 if 's ,
it compiles fine
vacuum = 10
end if
if vacuum < 50 & vacuum > 30
then------------------------------------------> if i delete this 3 if 's ,
it compiles fine
vacuum = 10
end if
if vacuum < 30 then------------------------------------------> if i delete
this 3 if 's , it compiles fine
vacuum = 10
end if
if vacuum == 1 then
extratijdgroot = 15
end if
if vacuum == 2 then
if TOERENTAL == 1 then
extratijdgroot = 20
end if
if TOERENTAL == 2 then
extratijdgroot = 15
end if
if TOERENTAL == 3 then
extratijdgroot = 10
end if
if TOERENTAL == 4 then
extratijdgroot = 6
end if
if TOERENTAL == 5 then
extratijdgroot = 2
end if
if TOERENTAL == 6 then
extratijdgroot = 2
end if
if TOERENTAL ==7 then
extratijdgroot = 5
end if
if TOERENTAL ==8 then
extratijdgroot = 6
end if
if TOERENTAL == 9 then
extratijdgroot = 7
end if
if TOERENTAL == 10 then
extratijdgroot = 8
end if
if TOERENTAL == 11 then
extratijdgroot = 9
end if
end if
--
---
----
if vacuum == 3 then
if TOERENTAL == 1 then
extratijdgroot = 17
end if
if TOERENTAL == 2 then
extratijdgroot = 14
end if
if TOERENTAL == 3 then
extratijdgroot = 12
end if
if TOERENTAL == 4 then
extratijdgroot = 1
end if
if TOERENTAL == 5 then
extratijdgroot = 2
end if
if TOERENTAL == 6 then
extratijdgroot = 3
end if
if TOERENTAL == 7 then
extratijdgroot = 4
end if
if TOERENTAL == 8 then
extratijdgroot = 5
end if
if TOERENTAL == 9 then
extratijdgroot = 6
end if
if TOERENTAL == 10 then
extratijdgroot = 7
end if
if TOERENTAL == 11 then
extratijdgroot = 9
end if
end if
--
---
----
if vacuum == 4 then
if TOERENTAL ==1 then
extratijdgroot = 8
end if
if TOERENTAL ==2 then
extratijdgroot = 6
end if
if TOERENTAL ==3 then
extratijdgroot = 4
end if
if TOERENTAL ==4 then
extratijdgroot = 2
end if
if TOERENTAL ==5 then
extratijdgroot = 2
end if
if TOERENTAL == 6 then
extratijdgroot = 2
end if
if TOERENTAL == 7 then
extratijdgroot = 2
end if
if TOERENTAL == 8 then
extratijdgroot = 3
end if
if TOERENTAL == 9 then
extratijdgroot = 4
end if
if toerental == 10 then
extratijdgroot = 5
end if
if toerental == 11 then
extratijdgroot = 7
end if
end if
--
---
----
if vacuum == 4 then
if toerental == 1 then
extratijdgroot = 5
end if
if toerental == 2 then
extratijdgroot = 0
end if
if toerental == 3 then
extratijd = 0
end if
if toerental == 4 then
extratijd = 0
end if
if toerental == 5 then
extratijd = 0
end if
if toerental == 6 then
extratijd = 0
end if
if toerental == 7 then
extratijd = 0
end if
if toerental == 8 then
extratijd = 50
end if
if toerental == 9 then
extratijd = 75
end if
if toerental == 10 then
extratijd = 100
end if
if toerental == 11 then
extratijd = 200
end if
end if
if vacuum == 5 then
if toerental == 1 then
extratijdgroot = 7
end if
if toerental == 2 then
extratijdgroot = 6
end if
if toerental == 3 then
extratijdgroot = 6
end if
if toerental == 4 then
extratijdgroot = 1
end if
if toerental == 5 then
extratijd = 50
end if
if toerental == 6 then
extratijd = 0
end if
if toerental == 7 then
extratijd = 0
end if
if toerental == 8 then
extratijd = 100
end if
if toerental == 9 then
extratijd = 250
end if
if toerental == 10 then
extratijdgroot = 4
end if
if toerental == 11 then
extratijd =
end if
end if
--
---
----
--
---
---
----
if vacuum == 6 then
if toerental == 1 then
extratijdgroot = 0
end if
if toerental == 2 then
extratijd = 50
end if
if toerental == 3 then
extratijd = 0
end if
if toerental == 4 then
extratijd = 0
end if
if toerental == 5 then
extratijd = 0
end if
if toerental == 6 then
extratijd = 0
end if
if toerental == 7 then
extratijd = 50
end if
if toerental == 8 then
extratijd = 20
end if
if toerental == 9 then
extratijd = 50
end if
if toerental == 10 then
extratijdgroot = 2
end if
if toerental == 11 then
extratijdgroot = 4
end if
end if
--
---
----
if vacuum == 7 then
if toerental == 1 then
extratijd = 100
end if
if toerental ==2 then
extratijd = 0
end if
if toerental ==3 then
extratijd = 0
end if
if toerental ==4 then
extratijd = 0
end if
if toerental == 5 then
extratijd = 0
end if
if toerental == 6 then
extratijd = 0
end if
if toerental == 7 then
extratijd = 0
end if
if toerental == 8 then
extratijd = 0
end if
if toerental == 9 then
extratijd = 0
end if
if toerental == 10 then
extratijd = 0
end if
if toerental == 11 then
extratijd = 0
end if
end if
--
---
----
if vacuum == 8 then
if toerental ==1 then
extratijd = 50
end if
if toerental == 2 then
extratijd = 20
end if
end if
--
---
----
if vacuum == 9 then
if toerental == 1 then
extratijd = 0
end if
end if
--
---\
----
if vacuum == 10 then
if toerental ==1 then
extratijd = 0
end if
if toerental ==2 then
extratijd = 0
end if
end if
--
---
----
IF GASKLEP == HIGH THEN
IF TOERENTAL > 1 THEN
DE = 1
END IF
END IF
if de == 1 then
serial_hw_write("D")
end if
if de == 0 then
IF WELKE == 2 THEN
INJEC = HIGH
WELKE = 0
END IF
IF WELKE == 1 THEN
INJ = HIGH
END IF
WELKE = WELKE + 1
DELAY_10US(INTIJD)
DELAY_10US(175)
DELAY_10US(EXTRATIJD)
DELAY_1MS(EXTRATIJDGROOT)
--DELAY_10US(TEMP)
-- ACCUSPANNING
end if
INJ = LOW
INJEC = LOW
de = 0
END IF
end loop
end loop
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.