; program 10
list p=16f628, r=hex ; declare processor,
; specyfying the radix
#include p16f628.inc ; include register label
; definitions
config h'3f10' ; configuration
; information
; for selected processor
; 3f10 HVP (High Voltage Programming)
; 3f90 LVP (Low Voltage Programming)
#define czas .8
l1 equ h'20'
l2 equ h'21'
d0 equ b'00111111' ; digit 0 d1 equ b'00000110'
d2 equ b'01011011'
d3 equ b'01001111' d4 equ b'01100110' d5 equ b'01101101' d6 equ b'01111101' d7 equ b'00000111' d8 equ b'01111111' d9 equ b'01101111'
diga equ b'01110111' ; digit A
digb equ b'01111100'
digc equ b'01011000'
digd equ
b'01011110'
dige equ b'01111001'
digf equ b'01110001'
dig7 equ b'10000000' ; decimal point
movlw h'07' ;07 -> w
movwf cmcon ; w->cmcon,
; comparators off
bsf status, rp0 ;bank 1
bcf pcon, oscf ;internal gen.32 kHz,
; Tcm=108μs
clrf trisa ;PORTA for output clrf trisb ;PORTB for output
bcf status, rp0 ;bank 0
clrf porta ; clear PORTA output latches clrf portb ;initializes PORTB
bcf porta, 6 ;zgas LED
bcf porta, 2 ;LED 2 off bsf porta, 0 ; LED 0 on
bsf porta, 7 ; LED 7 on
bcf porta, 5 ; LED 5 off
bcf porta, 3 ; LED 3 off
bcf porta, 1 ; LED 1 off nop
movlw d0
movwf portb call przerwa
movlw d1
movwf portb
call przerwa
movlw d2
movwf portb
call przerwa
movlw d3
movwf portb
call przerwa
movlw d4
movwf portb
call przerwa
movlw d5
movwf portb
call przerwa
movlw d6
movwf portb
call przerwa
movlw d7
movwf portb
call przerwa movlw d8
movwf portb
call przerwa
movlw d9
movwf portb
call przerwa
movlw diga
movwf portb
call przerwa
movlw digb
movwf portb
call przerwa
movlw digc
movwf portb
call przerwa
movlw digd
movwf portb
call przerwa
movlw dige
movwf portb
call przerwa
movlw digf
movwf portb
call przerwa movlw dig7
movwf portb
call przerwa
goto $ ; go to self
; loop here forever
przerwa
movlw czas movwf l1 clrf l2
spr nop
decfsz l2,f goto spr decfsz l1,f goto spr
return end
Related posts:
Fundamentals of Distribution Systems:Differences between European and North American Systems
Mechanical and duty cycle considerations.
Low-Voltage Switchgear and Circuit Breakers:Assessing Service Life of Low-Voltage Breakers
The Current Situation and Perspectives on the Use of Nuclear Energy for Electricity Generation:Nucle...
Capacitor Application
Low-Voltage Switchgear and Circuit Breakers:Low-Voltage Switchgear
Generators:Main generator types.
SOLAR POWER:PHOTOVOLTAIC DEVICES
Capacitor Application:Local Controls
Reliability-Cost Models for the Power Switching Devices of Wind Power Converters:Thermal Impedance M...
The Current Situation and Perspectives on the Use of Biomass in the Generation of Electricity:United...
The Current Situation and Perspectives on the Use of Solar Energy for Electricity Generation:Italy
WIND POWER:WIND FARMS
Testing and Commissioning of Protective Relays and Instrument Transformers:Event Reporting
The Current Situation and Perspectives on the Use of Hydropower for Electricity Generation:Czech Rep...