1st Project Dspic Basic
1st Project Dspic Basic
1st Project Dspic Basic
MCLR
AVDD
RB0
AVSS
RB1
RB9
RB2
RB10
RB5
LD0
LD1
LD2
LD3
LD4
LD5
LD6
LD7
RB6
1K
RB7
1K
RB8
VDD
1K
VSS
OSC1
1K
1K
1K
1K
1K
X1
10MHz
OSC2
RC13
C1
22pF
C2
22pF
RC14
RB11
RB12
RD0
RD1
VCC
Reset
RB4
dsPIC30Fxxxx
RB3
10K
VCC
dsPIC MCU
(PIC30F4013)
VDD
VSS
RF0
RF1
RF4
RF5
RF2
RF3
RA11
RF6
RD9
RD8
RD3
RD2
VSS
VDD
New Project.
page
making it simple...
page
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
making it simple...
File:
Page:
program Led_blinking
main:
while TRUE
TRISB = 0
LATB = %11111111
while true
LATB = not PORTB
delay_ms(1000)
wend
wend
end.
ProjName.dbas
1 od 1
Note: If you want to try another port, just replace each instance of LATB and TRISB in code with
your port, e.g. LATC/TRISC.
Step 6: Build!
Now its time to build our project. First, save your file by clicking on the Save Icon, or click Ctrl+S.
Select Project > Build from the drop-down menu, or click the Build Icon. You can also use the shortcut Ctrl+F9.
Build.
Compiler will generate output files in the project folder. There should be 4 new files: ProjectName.asm,
ProjectName.lst, ProjectName.mcl, and
ProjectName.hex. The last one will be used to
program the microcontroller directly.
page
making it simple...