Skip to content

Commit 1d49b2a

Browse files
committed
Initial commit
0 parents  commit 1d49b2a

File tree

7 files changed

+354
-0
lines changed

7 files changed

+354
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
*.d
2+
*.pre
3+
*.p1
4+
*.lst
5+
*.sym
6+
*.obj
7+
*.o
8+
*.sdb
9+
*.obj.dmp
10+
html/
11+
nbproject/private/
12+
nbproject/Package-*.bash
13+
build/
14+
nbbuild/
15+
dist/
16+
debug/
17+
nbdist/
18+
nbactions.xml
19+
nb-configuration.xml
20+
funclist
21+
nbproject/Makefile-*
22+
disassembly/
23+
*.map

Makefile

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
#
2+
# There exist several targets which are by default empty and which can be
3+
# used for execution of your targets. These targets are usually executed
4+
# before and after some main targets. They are:
5+
#
6+
# .build-pre: called before 'build' target
7+
# .build-post: called after 'build' target
8+
# .clean-pre: called before 'clean' target
9+
# .clean-post: called after 'clean' target
10+
# .clobber-pre: called before 'clobber' target
11+
# .clobber-post: called after 'clobber' target
12+
# .all-pre: called before 'all' target
13+
# .all-post: called after 'all' target
14+
# .help-pre: called before 'help' target
15+
# .help-post: called after 'help' target
16+
#
17+
# Targets beginning with '.' are not intended to be called on their own.
18+
#
19+
# Main targets can be executed directly, and they are:
20+
#
21+
# build build a specific configuration
22+
# clean remove built files from a configuration
23+
# clobber remove all built files
24+
# all build all configurations
25+
# help print help mesage
26+
#
27+
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28+
# .help-impl are implemented in nbproject/makefile-impl.mk.
29+
#
30+
# Available make variables:
31+
#
32+
# CND_BASEDIR base directory for relative paths
33+
# CND_DISTDIR default top distribution directory (build artifacts)
34+
# CND_BUILDDIR default top build directory (object files, ...)
35+
# CONF name of current configuration
36+
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
37+
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
38+
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
39+
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
40+
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
41+
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
42+
#
43+
# NOCDDL
44+
45+
46+
# Environment
47+
MKDIR=mkdir
48+
CP=cp
49+
CCADMIN=CCadmin
50+
RANLIB=ranlib
51+
52+
53+
# build
54+
build: .build-post
55+
56+
.build-pre:
57+
# Add your pre 'build' code here...
58+
59+
.build-post: .build-impl
60+
# Add your post 'build' code here...
61+
62+
63+
# clean
64+
clean: .clean-post
65+
66+
.clean-pre:
67+
# Add your pre 'clean' code here...
68+
# WARNING: the IDE does not call this target since it takes a long time to
69+
# simply run make. Instead, the IDE removes the configuration directories
70+
# under build and dist directly without calling make.
71+
# This target is left here so people can do a clean when running a clean
72+
# outside the IDE.
73+
74+
.clean-post: .clean-impl
75+
# Add your post 'clean' code here...
76+
77+
78+
# clobber
79+
clobber: .clobber-post
80+
81+
.clobber-pre:
82+
# Add your pre 'clobber' code here...
83+
84+
.clobber-post: .clobber-impl
85+
# Add your post 'clobber' code here...
86+
87+
88+
# all
89+
all: .all-post
90+
91+
.all-pre:
92+
# Add your pre 'all' code here...
93+
94+
.all-post: .all-impl
95+
# Add your post 'all' code here...
96+
97+
98+
# help
99+
help: .help-post
100+
101+
.help-pre:
102+
# Add your pre 'help' code here...
103+
104+
.help-post: .help-impl
105+
# Add your post 'help' code here...
106+
107+
108+
109+
# include project implementation makefile
110+
include nbproject/Makefile-impl.mk
111+
112+
# include project make variables
113+
include nbproject/Makefile-variables.mk

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Microprocessors
2+
Repository for Physics Year 3 microprocessors lab
3+
4+
A simple assembly program for PIC18 microprocessor, that counts to 100, putting the current count value out onto PORTB

Simple1.asm

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include p18f87k22.inc
2+
3+
code
4+
org 0x0
5+
goto start
6+
7+
org 0x100 ; Main code starts here at address 0x100
8+
9+
start
10+
movlw 0x0
11+
movwf TRISB, ACCESS ; Port C all outputs
12+
bra test
13+
loop movff 0x06, PORTB
14+
incf 0x06, W, ACCESS
15+
test movwf 0x06, ACCESS ; Test for end of loop condition
16+
movlw 0x63
17+
cpfsgt 0x06, ACCESS
18+
bra loop ; Not yet finished goto start of loop again
19+
goto 0x0 ; Re-run program from start
20+
21+
end

config.asm

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
; PIC18F87K22 Configuration Bit Settings
2+
3+
; Assembly source line config statements
4+
5+
#include "p18f87k22.inc"
6+
7+
; CONFIG1L
8+
CONFIG RETEN = ON ; VREG Sleep Enable bit (Enabled)
9+
CONFIG INTOSCSEL = HIGH ; LF-INTOSC Low-power Enable bit (LF-INTOSC in High-power mode during Sleep)
10+
CONFIG SOSCSEL = DIG ; SOSC Power Selection and mode Configuration bits (Digital IO selected)
11+
CONFIG XINST = OFF ; Extended Instruction Set (Disabled)
12+
13+
; CONFIG1H
14+
CONFIG FOSC = HS1 ; Oscillator (HS oscillator (Medium power, 4 MHz - 16 MHz))
15+
CONFIG PLLCFG = ON ; PLL x4 Enable bit (Enabled)
16+
CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor (Disabled)
17+
CONFIG IESO = OFF ; Internal External Oscillator Switch Over Mode (Disabled)
18+
19+
; CONFIG2L
20+
CONFIG PWRTEN = OFF ; Power Up Timer (Disabled)
21+
CONFIG BOREN = SBORDIS ; Brown Out Detect (Enabled in hardware, SBOREN disabled)
22+
CONFIG BORV = 3 ; Brown-out Reset Voltage bits (1.8V)
23+
CONFIG BORPWR = ZPBORMV ; BORMV Power level (ZPBORMV instead of BORMV is selected)
24+
25+
; CONFIG2H
26+
CONFIG WDTEN = SWDTDIS ; Watchdog Timer (WDT enabled in hardware; SWDTEN bit disabled)
27+
CONFIG WDTPS = 1048576 ; Watchdog Postscaler (1:1048576)
28+
29+
; CONFIG3L
30+
CONFIG RTCOSC = SOSCREF ; RTCC Clock Select (RTCC uses SOSC)
31+
CONFIG EASHFT = ON ; External Address Shift bit (Address Shifting enabled)
32+
CONFIG ABW = MM ; Address Bus Width Select bits (8-bit address bus)
33+
CONFIG BW = 16 ; Data Bus Width (16-bit external bus mode)
34+
CONFIG WAIT = OFF ; External Bus Wait (Disabled)
35+
36+
; CONFIG3H
37+
CONFIG CCP2MX = PORTC ; CCP2 Mux (RC1)
38+
CONFIG ECCPMX = PORTE ; ECCP Mux (Enhanced CCP1/3 [P1B/P1C/P3B/P3C] muxed with RE6/RE5/RE4/RE3)
39+
CONFIG MSSPMSK = MSK7 ; MSSP address masking (7 Bit address masking mode)
40+
CONFIG MCLRE = ON ; Master Clear Enable (MCLR Enabled, RG5 Disabled)
41+
42+
; CONFIG4L
43+
CONFIG STVREN = ON ; Stack Overflow Reset (Enabled)
44+
CONFIG BBSIZ = BB2K ; Boot Block Size (2K word Boot Block size)
45+
46+
; CONFIG5L
47+
CONFIG CP0 = OFF ; Code Protect 00800-03FFF (Disabled)
48+
CONFIG CP1 = OFF ; Code Protect 04000-07FFF (Disabled)
49+
CONFIG CP2 = OFF ; Code Protect 08000-0BFFF (Disabled)
50+
CONFIG CP3 = OFF ; Code Protect 0C000-0FFFF (Disabled)
51+
CONFIG CP4 = OFF ; Code Protect 10000-13FFF (Disabled)
52+
CONFIG CP5 = OFF ; Code Protect 14000-17FFF (Disabled)
53+
CONFIG CP6 = OFF ; Code Protect 18000-1BFFF (Disabled)
54+
CONFIG CP7 = OFF ; Code Protect 1C000-1FFFF (Disabled)
55+
56+
; CONFIG5H
57+
CONFIG CPB = OFF ; Code Protect Boot (Disabled)
58+
CONFIG CPD = OFF ; Data EE Read Protect (Disabled)
59+
60+
; CONFIG6L
61+
CONFIG WRT0 = OFF ; Table Write Protect 00800-03FFF (Disabled)
62+
CONFIG WRT1 = OFF ; Table Write Protect 04000-07FFF (Disabled)
63+
CONFIG WRT2 = OFF ; Table Write Protect 08000-0BFFF (Disabled)
64+
CONFIG WRT3 = OFF ; Table Write Protect 0C000-0FFFF (Disabled)
65+
CONFIG WRT4 = OFF ; Table Write Protect 10000-13FFF (Disabled)
66+
CONFIG WRT5 = OFF ; Table Write Protect 14000-17FFF (Disabled)
67+
CONFIG WRT6 = OFF ; Table Write Protect 18000-1BFFF (Disabled)
68+
CONFIG WRT7 = OFF ; Table Write Protect 1C000-1FFFF (Disabled)
69+
70+
; CONFIG6H
71+
CONFIG WRTC = OFF ; Config. Write Protect (Disabled)
72+
CONFIG WRTB = OFF ; Table Write Protect Boot (Disabled)
73+
CONFIG WRTD = OFF ; Data EE Write Protect (Disabled)
74+
75+
; CONFIG7L
76+
CONFIG EBRT0 = OFF ; Table Read Protect 00800-03FFF (Disabled)
77+
CONFIG EBRT1 = OFF ; Table Read Protect 04000-07FFF (Disabled)
78+
CONFIG EBRT2 = OFF ; Table Read Protect 08000-0BFFF (Disabled)
79+
CONFIG EBRT3 = OFF ; Table Read Protect 0C000-0FFFF (Disabled)
80+
CONFIG EBRT4 = OFF ; Table Read Protect 10000-13FFF (Disabled)
81+
CONFIG EBRT5 = OFF ; Table Read Protect 14000-17FFF (Disabled)
82+
CONFIG EBRT6 = OFF ; Table Read Protect 18000-1BFFF (Disabled)
83+
CONFIG EBRT7 = OFF ; Table Read Protect 1C000-1FFFF (Disabled)
84+
85+
; CONFIG7H
86+
CONFIG EBRTB = OFF ; Table Read Protect Boot (Disabled)
87+
88+
end

nbproject/configurations.xml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configurationDescriptor version="65">
3+
<logicalFolder name="root" displayName="root" projectFiles="true">
4+
<logicalFolder name="HeaderFiles"
5+
displayName="Header Files"
6+
projectFiles="true">
7+
</logicalFolder>
8+
<logicalFolder name="LinkerScript"
9+
displayName="Linker Files"
10+
projectFiles="true">
11+
</logicalFolder>
12+
<logicalFolder name="SourceFiles"
13+
displayName="Source Files"
14+
projectFiles="true">
15+
<itemPath>Simple1.asm</itemPath>
16+
<itemPath>config.asm</itemPath>
17+
</logicalFolder>
18+
<logicalFolder name="ExternalFiles"
19+
displayName="Important Files"
20+
projectFiles="false">
21+
<itemPath>Makefile</itemPath>
22+
</logicalFolder>
23+
<itemPath>README.md</itemPath>
24+
</logicalFolder>
25+
<projectmakefile>Makefile</projectmakefile>
26+
<confs>
27+
<conf name="default" type="2">
28+
<toolsSet>
29+
<developmentServer>localhost</developmentServer>
30+
<targetDevice>PIC18F87K22</targetDevice>
31+
<targetHeader></targetHeader>
32+
<targetPluginBoard></targetPluginBoard>
33+
<platformTool>Simulator</platformTool>
34+
<languageToolchain>MPASMWIN</languageToolchain>
35+
<languageToolchainVersion>5.81</languageToolchainVersion>
36+
<platform>4</platform>
37+
</toolsSet>
38+
<packs>
39+
<pack name="PIC18F-K_DFP" vendor="Microchip" version="1.0.40"/>
40+
</packs>
41+
<compileType>
42+
<linkerTool>
43+
<linkerLibItems>
44+
</linkerLibItems>
45+
</linkerTool>
46+
<archiverTool>
47+
</archiverTool>
48+
<loading>
49+
<useAlternateLoadableFile>false</useAlternateLoadableFile>
50+
<parseOnProdLoad>false</parseOnProdLoad>
51+
<alternateLoadableFile></alternateLoadableFile>
52+
</loading>
53+
<subordinates>
54+
</subordinates>
55+
</compileType>
56+
<makeCustomizationType>
57+
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
58+
<makeCustomizationPreStep></makeCustomizationPreStep>
59+
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
60+
<makeCustomizationPostStep></makeCustomizationPostStep>
61+
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
62+
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
63+
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
64+
</makeCustomizationType>
65+
<MPASMWIN-AS>
66+
<property key="cross.reference.file" value=""/>
67+
<property key="default.radix" value="HEX"/>
68+
<property key="enable.case.sensitivity" value="true"/>
69+
<property key="hex.output.format" value="INHX32"/>
70+
<property key="preprocessor.macros" value=""/>
71+
<property key="warning.level" value="0"/>
72+
</MPASMWIN-AS>
73+
<MPASMWIN-LD>
74+
<property key="cod-file" value="false"/>
75+
<property key="extra-lib-directories" value=""/>
76+
<property key="hex-output-format" value="INHX32"/>
77+
<property key="map-file" value="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map"/>
78+
</MPASMWIN-LD>
79+
<mpasmsuite>
80+
<property key="absolute-mode" value="false"/>
81+
<property key="eeprom-width" value="8"/>
82+
<property key="extended-mode" value="false"/>
83+
<property key="extended-mode-mpasm" value="false"/>
84+
<property key="extended-mode-mplink" value="false"/>
85+
</mpasmsuite>
86+
</conf>
87+
</confs>
88+
</configurationDescriptor>

nbproject/project.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://www.netbeans.org/ns/project/1">
3+
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
4+
<configuration>
5+
<data xmlns="http://www.netbeans.org/ns/make-project/1">
6+
<name>Simple1</name>
7+
<creation-uuid>365f4bb0-f88d-4b90-a2ad-2bf533a59236</creation-uuid>
8+
<make-project-type>0</make-project-type>
9+
<c-extensions/>
10+
<cpp-extensions/>
11+
<header-extensions/>
12+
<asminc-extensions/>
13+
<sourceEncoding>ISO-8859-1</sourceEncoding>
14+
<make-dep-projects/>
15+
</data>
16+
</configuration>
17+
</project>

0 commit comments

Comments
 (0)