打印

哪位大侠帮我看看,PIC10F200的程序问题,郁闷死了

[复制链接]
2649|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
wgq000321|  楼主 | 2007-5-16 18:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
下面是我用PIC10F200写的一个简单的程序,但始终没有波形输出
主要就是在上电的时候输出一个脉冲波形
我又检查不出来什么问题
好几年没有用过PIC单片机了,哪位大侠帮帮忙!



    list      p=10F200            ; list directive to define processor
    #include <p10F200.inc>        ; processor specific variable definitions

    __CONFIG   _MCLRE_ON & _CP_OFF & _WDT_OFF

; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file. 
; See respective data sheet for additional information on configuration word.


;***** VARIABLE DEFINITIONS
temp    EQU     0x10
temp1    EQU     0x11
     
   

;**********************************************************************
;    ORG     0xFF             ; processor reset vector

; Internal RC calibration value is placed at location 0xFF by Microchip
; as a movlw k, where the k is a literal value.
    

    ORG     0x00             ; coding begins here
init
    ;IO初始化,设置GP0/GP1输出0,GP2/GP3为输入
    MOVLW    0x00
    MOVWF   OSCCAL           
    MOVLW    0xc0
    OPTION
    MOVLW    0x0C
    TRIS    GPIO
    MOVLW    0x00
    MOVWF    GPIO

start
    ;延时20ms
    CALL    delay10ms
    CALL    delay10ms
    ;GP0输出高
    MOVLW    0x01        
    MOVWF    GPIO
    ;延时70ms
    CALL    delay10ms
    CALL    delay10ms
    CALL    delay10ms
    CALL    delay10ms
    CALL    delay10ms
    CALL    delay10ms
    CALL    delay10ms
    CALL    delay10ms
    ;GP1输出高
    MOVLW    0x03        
    MOVWF    GPIO
    ;延时10ms
    CALL    delay10ms
    ;GP1输出低
    MOVLW    0x01        
    MOVWF    GPIO
    ;延时10ms
    CALL    delay10ms
    ;GP1输出高
    MOVLW    0x03        
    MOVWF    GPIO

    ;延时10ms
    CALL    delay10ms
    SLEEP

done
    NOP
    GOTO done


delay10ms
    MOVLW    0x0e
    MOVWF    temp
d2
    MOVLW     0xed
    MOVWF    temp1
d1
    DECFSZ    temp1,1
    GOTO    d1
    DECFSZ    temp,1
    GOTO    d2
    RETLW    0    



    END                       ; directive 'end of program'


沙发
兰天白云| | 2007-5-17 20:41 | 只看该作者

把GP0设为输出口

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

1

帖子

1

粉丝