JAL (compiler)
Encyclopedia
JAL is a Pascal-like programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 and compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 that generates executable code for PIC microcontroller
PIC microcontroller
PIC is a family of Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument's Microelectronics Division...

s. It is a free-format language with a compiler that runs on Linux, MS-Windows and MS-DOS (OSX support). 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
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

 under the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

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 (true, true)

forever loop—convert analog on a0 to digital
resist = ADC_read_low_res(0)

-- run measurement through flash memory
program_eeprom_write(2000,resist)
program_eeprom_read(2000,resist)

-- run measurement through data memory
data_eeprom_write(10,resist)
data_eeprom_read(10,resist)

-- 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(resist)
delay_100ms(1)
-- set actual PWM duty cycle
PWM_Set_DutyCycle (resist, resist)

end loop
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK