JAL (compiler)


JAL is a Pascal-like programming language and compiler that generates executable code for PIC microcontrollers. It is a free-format language with a compiler that runs on Linux, MS-Windows and MS-DOS. It is configurable and extendable through the use of libraries and can even be combined with PIC assembly language.

History

JAL was originally created by Wouter van Ooijen and released as free software under the GNU General Public License in 2003. In 2006, Stef Mientki initiated the development of a new version, JALV2, which was programmed by Kyle York and beta tested by an international user group.

Sample code

-- JAL 2.3
include 16f877_bert--define the variables
var byte resist--define the pins
pin_a0_direction = input--variable resistor
pin_d7_direction = input--switch
pin_c2_direction = output--pwm led--enable pulse width modulation
PWM_init_frequency
forever loop--convert analog on a0 to digital
resist = ADC_read_low_res
-- run measurement through flash memory
program_eeprom_write
program_eeprom_read
-- run measurement through data memory
data_eeprom_write
data_eeprom_read
-- if the switch is pressed return random value
if pin_d7 high then
resist = random_byte
end if--send resistance to PC
serial_sw_write
delay_100ms
-- set actual PWM duty cycle
PWM_Set_DutyCycle
end loop