User`s manual

mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
In this configuration, LED will emit light when voltage on pin is high (5V), and
will be off when voltage on pin is low (0V). We have to designate PORTB pins as
output, and change its value every second. Listing of program is below
program My_LED
main:
TRISB = 0
' configure pins of PORTB as output
eloop:
PORTB = $FF
' turn on diodes on PORTB
delay_ms(1000)
' wait 1 second
PORTB = 0
' turn of diodes on PORTB
delay_ms(1000)
' wait 1 second
goto eloop
' stay in a loop
end.
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
9
page
4MHz
LB7
LB6
LB5
LB4
LB3
LB2
LB1
LB0
+5V
+5V
PIC16F877
RA0/AN0
RA2/AN2/Vref-
RA3/AN3/Vref+
RA4/TOCKI
RA5/AN4
RE0/RD/AN5
RE1/WR/AN6
RE2/CS/AN7
Vdd
Vss
OSC1
OSC2
RCO/T1OSO
RC1/T1OSI
RC3
RD0/PSP0
RD1/PSP1
MCLR/Vpp/THV
RC2/CCP1
RA1/AN1
RB7/PGD
RB6/PGC
RB5
RB4
RB3/PGM
RB2
RB1
RB0/INT
Vdd
Vss
RD6/PSP6
RD7/PSP7
RD5/PSP5
RD4/PSP4
RC7/RX/DT
RC6/TX/CK
RC5
RC4
RD3/PSP3
RD2/PSP2
330R
330R
330R
330R
330R
330R
330R
330R
10K
Reset