summaryrefslogtreecommitdiffstats
path: root/test/pic30
diff options
context:
space:
mode:
Diffstat (limited to 'test/pic30')
-rw-r--r--test/pic30/standalone_test.s19
-rw-r--r--test/pic30/standalone_test_c.c18
-rw-r--r--test/pic30/test.piklab27
-rw-r--r--test/pic30/test.s19
-rw-r--r--test/pic30/test_c.c22
-rw-r--r--test/pic30/test_c.piklab103
6 files changed, 208 insertions, 0 deletions
diff --git a/test/pic30/standalone_test.s b/test/pic30/standalone_test.s
new file mode 100644
index 0000000..98a8d5c
--- /dev/null
+++ b/test/pic30/standalone_test.s
@@ -0,0 +1,19 @@
+ .title " Sample dsPIC Assembler Source Code"
+ .sbttl " For illustration only."
+ ; dsPIC registers
+ .equ CORCONL, CORCON
+ .equ PSV,2
+ .section .const,psv
+hello:
+ .ascii "Hello world!\n\0"
+ .text
+ .global __reset
+__reset:
+ ; set PSVPAG to page that contains 'hello'
+ mov #psvpage(hello),w0
+ mov w0,PSVPAG
+ ; enable Program Space Visibility
+ bset.b CORCONL,#PSV
+ ; make a pointer to 'hello'
+ mov #psvoffset(hello),w0
+ .end
diff --git a/test/pic30/standalone_test_c.c b/test/pic30/standalone_test_c.c
new file mode 100644
index 0000000..9e9be37
--- /dev/null
+++ b/test/pic30/standalone_test_c.c
@@ -0,0 +1,18 @@
+//#include <p30f2010.h>
+
+int main(void);
+unsigned int Add(unsigned int a, unsigned int b);
+unsigned int x, y, z;
+
+int main(void)
+{
+ x = 2;
+ y = 5;
+ z = Add(x,y);
+ return 0;
+}
+
+unsigned int Add(unsigned int a, unsigned int b)
+{
+ return(a+b);
+}
diff --git a/test/pic30/test.piklab b/test/pic30/test.piklab
new file mode 100644
index 0000000..9ec721d
--- /dev/null
+++ b/test/pic30/test.piklab
@@ -0,0 +1,27 @@
+<!DOCTYPE piklab>
+<piklab>
+ <general>
+ <device>30F6015</device>
+ <files>
+ <item>test.s</item>
+ </files>
+ <description/>
+ <version>0.1</version>
+ <tool>pic30</tool>
+ <opened_files>
+ <item>test.s</item>
+ </opened_files>
+ </general>
+ <compiler>
+ <includes>$(SRCPATH)</includes>
+ <custom_options/>
+ </compiler>
+ <assembler>
+ <includes>$(SRCPATH)</includes>
+ <custom_options/>
+ </assembler>
+ <linker>
+ <custom_options/>
+ <format>inhx32</format>
+ </linker>
+</piklab>
diff --git a/test/pic30/test.s b/test/pic30/test.s
new file mode 100644
index 0000000..98a8d5c
--- /dev/null
+++ b/test/pic30/test.s
@@ -0,0 +1,19 @@
+ .title " Sample dsPIC Assembler Source Code"
+ .sbttl " For illustration only."
+ ; dsPIC registers
+ .equ CORCONL, CORCON
+ .equ PSV,2
+ .section .const,psv
+hello:
+ .ascii "Hello world!\n\0"
+ .text
+ .global __reset
+__reset:
+ ; set PSVPAG to page that contains 'hello'
+ mov #psvpage(hello),w0
+ mov w0,PSVPAG
+ ; enable Program Space Visibility
+ bset.b CORCONL,#PSV
+ ; make a pointer to 'hello'
+ mov #psvoffset(hello),w0
+ .end
diff --git a/test/pic30/test_c.c b/test/pic30/test_c.c
new file mode 100644
index 0000000..5205e53
--- /dev/null
+++ b/test/pic30/test_c.c
@@ -0,0 +1,22 @@
+#include <p30f3010.h>
+_FOSC(XT_PLL16 & FRC & CSW_FSCM_OFF);
+_FWDT(WDTPSB_16 & WDTPSA_512 & WDT_OFF);
+_FBORPOR(PWRT_64 & BORV_20 & PBOR_ON & MCLR_EN);
+//_FGS(CODE_PROT_ON);
+
+void delay(void);
+
+int main (void)
+{
+int i = 0xFFFF;
+
+for (;;) {
+ delay();
+}
+}
+
+void delay()
+{
+int i;
+for (i = 0; i < 0xFFFF; i++) {;}
+}
diff --git a/test/pic30/test_c.piklab b/test/pic30/test_c.piklab
new file mode 100644
index 0000000..0985934
--- /dev/null
+++ b/test/pic30/test_c.piklab
@@ -0,0 +1,103 @@
+<!DOCTYPE piklab>
+<piklab>
+ <general>
+ <device>30F3010</device>
+ <files>
+ <item>test_c.c</item>
+ <item>test.s</item>
+ <item>libp30F3010-coff.a</item>
+ </files>
+ <description/>
+ <version>0.1</version>
+ <tool>pic30</tool>
+ <custom_linker_script/>
+ <is_library>false</is_library>
+ <opened_files>
+ <item>test_c.c</item>
+ </opened_files>
+ </general>
+ <sdcc>
+ <custom_options/>
+ <include_dir/>
+ </sdcc>
+ <assembler>
+ <warning_level>0</warning_level>
+ <custom_options/>
+ <include_dir/>
+ <has_custom_arguments>false</has_custom_arguments>
+ <custom_arguments>
+ <item>--ERRFORMAT</item>
+ <item>--WARNFORMAT</item>
+ <item>--MSGFORMAT</item>
+ <item>--CHIP=%DEVICE</item>
+ <item>--IDE=mplab</item>
+ <item>-Q</item>
+ <item>-C</item>
+ <item>--ASMLIST</item>
+ <item>-I$(SRCPATH)</item>
+ <item>%I</item>
+ <item>-D</item>
+ </custom_arguments>
+ <includes>
+ <item>$(SRCPATH)</item>
+ </includes>
+ </assembler>
+ <linker>
+ <hex_format>inhx32</hex_format>
+ <object_dir/>
+ <custom_options/>
+ <format>inhx32</format>
+ <custom_libraries/>
+ <has_custom_arguments>false</has_custom_arguments>
+ <custom_arguments>
+ <item>/k%LKR_PATH</item>
+ <item>%LKR_NAME</item>
+ <item>/l</item>
+ <item>/o%COFF</item>
+ <item>/m%MAP</item>
+ <item>%OBJS</item>
+ <item>%LIBS</item>
+ </custom_arguments>
+ <includes>
+ <item>$(SRCPATH)</item>
+ </includes>
+ </linker>
+ <compiler>
+ <custom_options/>
+ <has_custom_arguments>false</has_custom_arguments>
+ <warning_level>0</warning_level>
+ <custom_arguments>
+ <item>-S</item>
+ <item>$NO_AUTO_DEVICE(-mcpu=%DEVICE)</item>
+ <item>-I/home/nicolas/wine/Program Files/Microchip/MPLAB C30/support/h/</item>
+ <item>-g</item>
+ <item>%I</item>
+ </custom_arguments>
+ <includes>
+ <item>$(SRCPATH)</item>
+ </includes>
+ </compiler>
+ <bin_to_hex>
+ <has_custom_arguments>false</has_custom_arguments>
+ <custom_options/>
+ <custom_arguments>
+ <item>%I</item>
+ </custom_arguments>
+ </bin_to_hex>
+ <librarian>
+ <has_custom_arguments>false</has_custom_arguments>
+ <custom_options/>
+ <custom_arguments>
+ <item>-rc</item>
+ <item>%O</item>
+ <item>%LIBS</item>
+ <item>%OBJS</item>
+ </custom_arguments>
+ </librarian>
+ <editors>
+ <bookmarks>
+ <item>file:///home/nicolas/prog/trunk/piklab/test/pic30/test.s,9</item>
+ <item>file:///home/nicolas/prog/trunk/piklab/test/pic30/test_c.c,1</item>
+ </bookmarks>
+ </editors>
+</piklab>