summaryrefslogtreecommitdiffstats
path: root/test/gputils/blinker18
diff options
context:
space:
mode:
Diffstat (limited to 'test/gputils/blinker18')
-rw-r--r--test/gputils/blinker18/blinker_18.asm59
-rw-r--r--test/gputils/blinker18/blinker_18.piklab52
2 files changed, 111 insertions, 0 deletions
diff --git a/test/gputils/blinker18/blinker_18.asm b/test/gputils/blinker18/blinker_18.asm
new file mode 100644
index 0000000..4a00daf
--- /dev/null
+++ b/test/gputils/blinker18/blinker_18.asm
@@ -0,0 +1,59 @@
+; LIST p=18F452 ;PIC18F452 is the target processor
+ INCLUDE "p18f452.inc" ;Include file with register defines
+
+ ;Programming Configuration Information
+ __CONFIG _CONFIG1H, _XT_OSC_1H ;XT HS PLL (10MHz XTAL)
+ __CONFIG _CONFIG2L, _BOR_ON_2L & _PWRT_ON_2L ;Power-Up timer ON, Brown-out at 2.7V
+
+ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_1_2H ;WDT OFF for debug
+ __CONFIG _CONFIG3H, _CCP2MX_OFF_3H ;CCP Module Off
+ __CONFIG _CONFIG4L, _LVP_OFF_4L & _DEBUG_OFF_4L
+
+ ;UnProtect entire device program space for DEBUG
+ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L
+ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
+ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L
+ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
+
+;Assorted miscellaneous general-purpose registers
+DlyRegA equ 0x3D ;Temp register for delay
+DlyRegB equ 0x3E ;Temp register for delay
+DlyRegC equ 0x3F ;Temp register for delay
+
+STARTUP CODE 0x000
+ nop ;Required for ICD Debugging
+ nop
+ goto Main
+
+Main
+ clrf BSR,A ;Ensure BSR register points to first block
+ clrf TRISB,A
+ movlw 0x7
+ movwf PORTB,A
+
+Loop
+ bsf PORTB,0 ;Turn the LED on
+ call LongDelay
+ bcf PORTB,0 ;Turn the LED off
+ call LongDelay
+ goto Loop
+
+;A long delay
+LongDelay
+ movlw H'10' ;Adjust to produce a suitable time delay
+ movwf DlyRegA
+ldelayc movlw H'10'
+ movwf DlyRegB
+ldelayb movlw H'FF'
+ movwf DlyRegC
+ldelaya decfsz DlyRegC,f ;Inner Loop
+ goto ldelaya
+ decfsz DlyRegB,f ;Middle Loop
+ goto ldelayb
+ decfsz DlyRegA,f ;Outer Loop
+ goto ldelayc
+ return
+
+ END
+
+
diff --git a/test/gputils/blinker18/blinker_18.piklab b/test/gputils/blinker18/blinker_18.piklab
new file mode 100644
index 0000000..c1582de
--- /dev/null
+++ b/test/gputils/blinker18/blinker_18.piklab
@@ -0,0 +1,52 @@
+<!DOCTYPE piklab>
+<piklab>
+ <general>
+ <device>18F452</device>
+ <files>
+ <item>blinker_18.asm</item>
+ </files>
+ <watched_ios>
+ <item>3969</item>
+ </watched_ios>
+ <description/>
+ <version>0.1</version>
+ <tool>gputils</tool>
+ <opened_files>
+ <item>blinker_18.asm</item>
+ </opened_files>
+ </general>
+ <assembler>
+ <custom_options/>
+ <warning_level>0</warning_level>
+ <has_custom_arguments>false</has_custom_arguments>
+ <custom_arguments>
+ <item>-c</item>
+ <item>-I$(SRCPATH)</item>
+ <item>-w0</item>
+ <item>%I</item>
+ <item>-g</item>
+ </custom_arguments>
+ <includes>
+ <item>$(SRCPATH)</item>
+ </includes>
+ </assembler>
+ <linker>
+ <custom_options/>
+ <format>inhx32</format>
+ <custom_libraries/>
+ <has_custom_arguments>false</has_custom_arguments>
+ <custom_arguments>
+ <item>-o%O</item>
+ <item>-c</item>
+ <item>-ainhx8m</item>
+ <item>-m</item>
+ <item>-I$(SRCPATH)</item>
+ <item>$LKR(-s%LKR)</item>
+ <item>%OBJS</item>
+ <item>%LIBS</item>
+ </custom_arguments>
+ <includes>
+ <item>$(SRCPATH)</item>
+ </includes>
+ </linker>
+</piklab>