首 页文档资料下载资料维修视频包年699元
请登录  |  免费注册
当前位置:精通维修下载 > 文档资料 > 家电技术 > 单元电路介绍 > 其它电路
ADC0832转换程序
来源:本站整理  作者:佚名  2011-02-05 21:46:03



ADC0832转换程序                

                   CLK     bit P1.6
                   DATA_I  bit P1.4
                   DATA_O  bit P1.5
                   CS      bit P1.2
           org 0000h
           ajmp start
           org 0020h
           
adc0832:                           ;;A/D处理主程序
               CLR   A                           
                    MOV    R7,A                         
                   CLR   CS                         
                   SJMP  adc_wait   ;;判断A/D是否准备好?                    
wait_loop:         JNB   DATA_O,adc_process                 
adc_wait:          SETB  CLK                        
                   NOP                               
                   NOP                               
                   CLR   CLK                         
                   NOP                               
                   NOP                                
                   SJMP  wait_loop                        
adc_process:       CLR   A             ;;A/D处理子程序                       
                    MOV    R6,A                         
pro_loop:          SETB  CLK                         
                   NOP                                
                   NOP                               
                   CLR   CLK                         
                   NOP                                
                   NOP                                
                    MOV    A,R7                         
                   ADD   A,ACC                        
                    MOV    R7,A                         
                    MOV    C,DATA_O                       
                   CLR   A                            
                   RLC   A                            
                   ORL   A,R7                        
                    MOV    R7,A                         
                   INC   R6                           
                   CJNE  R6,#08H,pro_loop                
                   SETB  CS                         
                   RET                                
;==========================================================================
;主程序
start:         
                   LCALL adc0832                       
                    MOV    P0,R7                        
                   SJMP  start                        
                   END


关键词:

·上一文章:93C46的读写实验程序
·下一文章:4键六位数显示程序

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分)
Copyright © 2007-2017 down.gzweix.Com. All Rights Reserved .
页面执行时间:19,140.63000 毫秒