; 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:
Starting and generating systems:Solenoids
Insulating Oils, Fluids, and Gases:Insulating Oil
Criteria and Tools for Evaluating Wind Power Converter:Classification and Approach for the Thermal St...
COMBINED HEAT AND POWER:HISTORICAL BACKGROUND FOR COMBINED HEAT AND POWER USAGE
Circuit-Level Transient Suppression:Protecting Low-Voltage Supplies.
COMBINED HEAT AND POWER:CHP TECHNOLOGY
Principles of electrical safety:Precautions against electric shock and contact burn injuries.
The Current Situation and Perspectives on the Use of Wind Energy for Electricity Generation:Finland
Air systems:Air cleaners
Medium-Voltage Switchgear and Circuit Breakers:Electrical Switchgear Testing
Low-Voltage Switchgear and Circuit Breakers:Low-Voltage Switchgear
Motors and Generators:DC Generators
Low-Voltage Switchgear and Circuit Breakers:Electrical Factors
ELECTRICITY GENERATION AND THE ENVIRONMENT:LIFE-CYCLE ASSESSMENT
Summary of Promising Topologies and Power Devices for Wind Power Converter