Skip to content

Commit

Permalink
Added missing blink samples defined in TORLEASE
Browse files Browse the repository at this point in the history
  • Loading branch information
RobJansen62 committed Jun 25, 2018
1 parent 5e297b4 commit db21267
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
61 changes: 61 additions & 0 deletions sample/18lf242_blink_hs.jal
@@ -0,0 +1,61 @@
-- ------------------------------------------------------
-- Title: Blink-a-led of the Microchip pic18lf242
--
-- Author: Rob Hamerling, Copyright (c) 2008..2018 all rights reserved.
--
-- Adapted-by:
--
-- Revision: $Revision$
--
-- Compiler:2.4q6
--
-- This file is part of jallib (https://github.com/jallib/jallib)
-- Released under the BSD license (http://www.opensource.org/licenses/bsd-license.php)
--
-- Description:
-- Simple blink-a-led program for Microchip pic18lf242
-- using an external crystal or resonator.
-- The LED should be flashing twice a second!
--
-- Sources:
--
-- Notes:
-- - Creation date/time: Sat Jun 16 16:04:12 2018
-- - This file is generated by 'blink-a-led.py' script! Do not change!
--
-- ------------------------------------------------------
--
include 18lf242 -- target PICmicro
--
-- This program assumes that a 20 MHz resonator or crystal
-- is connected to pins OSC1 and OSC2.
pragma target clock 20_000_000 -- oscillator frequency
--
pragma target OSC HS -- crystal or resonator
pragma target WDT CONTROL -- watchdog
pragma target DEBUG DISABLED -- no debugging
pragma target BROWNOUT DISABLED -- no brownout reset
pragma target LVP DISABLED -- no low voltage programming
--
-- The configuration bit settings above are only a selection, sufficient
-- for this program. Other programs may need more or different settings.
--
WDTCON_SWDTEN = OFF -- disable WDT
OSCCON_SCS = 0 -- select primary oscillator
--
enable_digital_io() -- make all pins digital I/O
--
-- A low current (2 mA) led with 2.2K series resistor is recommended
-- since the chosen pin may not be able to drive an ordinary 20mA led.
--
alias led is pin_A0 -- alias for pin with LED
--
pin_A0_direction = OUTPUT
--
forever loop
led = ON
_usec_delay(100_000)
led = OFF
_usec_delay(400_000)
end loop
--
66 changes: 66 additions & 0 deletions sample/18lf2480_blink_hs.jal
@@ -0,0 +1,66 @@
-- ------------------------------------------------------
-- Title: Blink-a-led of the Microchip pic18lf2480
--
-- Author: Rob Hamerling, Copyright (c) 2008..2018 all rights reserved.
--
-- Adapted-by:
--
-- Revision: $Revision$
--
-- Compiler:2.4q6
--
-- This file is part of jallib (https://github.com/jallib/jallib)
-- Released under the BSD license (http://www.opensource.org/licenses/bsd-license.php)
--
-- Description:
-- Simple blink-a-led program for Microchip pic18lf2480
-- using an external crystal or resonator.
-- The LED should be flashing twice a second!
--
-- Sources:
--
-- Notes:
-- - Creation date/time: Sat Jun 16 16:04:17 2018
-- - This file is generated by 'blink-a-led.py' script! Do not change!
--
-- ------------------------------------------------------
--
include 18lf2480 -- target PICmicro
--
-- This program assumes that a 20 MHz resonator or crystal
-- is connected to pins OSC1 and OSC2.
pragma target clock 20_000_000 -- oscillator frequency
--
pragma target OSC HS -- crystal or resonator
pragma target WDT CONTROL -- watchdog
pragma target XINST DISABLED -- do not use extended instructionset
pragma target DEBUG DISABLED -- no debugging
pragma target BROWNOUT DISABLED -- no brownout reset
pragma target FCMEN DISABLED -- no clock monitoring
pragma target IESO DISABLED -- no int/ext osc switching
pragma target LVP DISABLED -- no low voltage programming
pragma target MCLR EXTERNAL -- external reset
--
-- The configuration bit settings above are only a selection, sufficient
-- for this program. Other programs may need more or different settings.
--
WDTCON_SWDTEN = OFF -- disable WDT
OSCCON_SCS = 0 -- select primary oscillator
OSCTUNE_PLLEN = FALSE -- no PLL
--
enable_digital_io() -- make all pins digital I/O
--
-- A low current (2 mA) led with 2.2K series resistor is recommended
-- since the chosen pin may not be able to drive an ordinary 20mA led.
--
alias led is pin_A0 -- alias for pin with LED
--
pin_A0_direction = OUTPUT
--
forever loop
led = ON
_usec_delay(100_000)
led = OFF
_usec_delay(400_000)
end loop
--

0 comments on commit db21267

Please sign in to comment.