Switch to full style
PIC Assembly Articles
Post a reply

The Digital to Analogue converter DAC writer

Thu May 16, 2013 3:41 pm

The Digital to Analogue Converter
Code:

TITLE 
"Write DAC"
liat p 16f877
include <pl6f877.inc>
DELAY_LO EQU H'30'
COUNT EQU H'32'
ORG H'00'
NOP
GOTO START
;THE ROUTINES START HERE 
ORG 0x20
START BCF STATUS
,RP0 ;BANK 0
CLRF PORTD 
;-INITIALIZE PORTC By CLEARING OUTPJT DATA
LATCHES
BSF STATUS
,RP0 ;SELECT BANK1
MOVLW 0X00 
;W REG =00
MOVWF TRISD 
;SET RD AS oUTPUTS
BCF STATUS
,RP0 ;BANK 0
CLRF COUNT 
;COUNT 0

MAIN MOVF COUNT
,;GET COUNT
MOVWF PORTD 
;OUTPUT W REG TO PORTB
CALL DELAY
CALL DELAY
INCF COUNT 
;COUNT COUNT 1
GOTO MAIN
;SUBROUTINES

DELAY
  MOVLW 0X01
SET DELAY TIME
  MOVWF DELAY_LO
  
WAIT 
   INCFSZ DELAY_LO
,1COUNT DOWN
    GOTO WAIT 
    
RETURN 
    
END




Post a reply
  Related Posts  to : The Digital to Analogue converter DAC writer
 ramp Counter ANALOGUE TO DIGITAL CONVERSION (ADC)     -  
 SUCCESSIVE APPROXIMATION ANALOGUE TO DIGITAL CONVERSION     -  
 digital watermark on image     -  
 C to C++ converter     -  
 PST Converter Pro     -  
 need help doing Universal Converter     -  
 PHP srt to xml subtitle converter     -  
 Number system converter (C++)     -  
 infix to postfix converter     -