打印

三星单片机主程序只跑一次就停了,why?

[复制链接]
2142|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
fenaniu|  楼主 | 2012-9-3 11:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
.public         main
        .public         start     
        .include         "S3C8275.reg"



;//==============define symbol==============
page0to0          equ    00h
page1to1          equ    11h
page0to2          equ    20h
page1to2          equ    21h
page2to0          equ    02h
powerkey          equ    0fah   ;;//

; ==================intterupt define=====================
;;       vector 00f6h, watch_timer_int   ;// irq2 watch timer vector
        org    0100h
         jp     start

;;//=============reset===================================        

start:
        nop
        nop
        ld     spl,# 0ffh     
        call   init_hardware


;//=========main program=================================
       org     200h
main:     

        sb0
  ;     ld     p4,#0ffh
        ld     r0,#0
        ld     r1,#1
        ldb    p0.3,r0
        call   delay   
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay


        ldb    p0.3,r1

        call   delay
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay
        call   delay


        jp     main   


;;//=================================================sub

init_hardware:   
        di                              
;//------------chen xu chu shi hua
        ld     btcon,# 10100011b  ;//disable WATCH DOG         
        ld     clkcon,# 00011000b ;fxx

        ld     imr,#00000101b    ;.3bit external inter(P0.0) ;.2bit  watchtime ;.0bit Timer1
        ld     sym,# 01h
        ld     pp,# page0to0
;//------------sb0------------------------------------
        sb0
        ld     osccon,# 04h  ;//main oscillator select
        ld     stpcon,# 10100101b

        ld     p0conh,# 00000010b
        ld     p0conl,# 10101010b
        ld     p0pur,# 0ffh

         ld     p0,# 0ffh

   ;     ld     p1conh,# 00h
   ;     ld     p1conl,# 00h
  ;      ld     p1,# 0ffh
   ;     ld     p1pur,# 0ffh


;        ld     p2conh,# 00h
;        ld     p2conl,# 00h

  ;      ld     p2pur,# 0ffh

;        ld     p3conl,# 00h
;        ld     p3conh,# 00h
   ;     ld     p3,# 7fh
;        ld     p3pur,# 0ffh

;        ld     extipnd,# 00h     ;//清除中断标志位
;        ld     exticonh,# 00h
;        ld     exticonl,#00000001b  ;p00 set falling edge into inter

;//------------sb1--------------------------
        sb1
        ld     wtcon,# 01001110b    ;;//0.91ms 中断;  
;        ld     tadata,# 0ffh
;        ld     tbdata,# 0ffh
        ld     tacon,# 10111110b    ;set fxx/8

  ;      ld     p4conh,# 0aah
  ;      ld     p4conl,# 10101010b
;        ld     p4,#0ffh

;        ld     p5conh,# 10101010b
;        ld     p5conl,# 10101010b
;        ld     p5,00h

;        ld     p6con,# 000h
;       ld     lcon,# 01100001b
;//------------clear ram------------------------
        sb0
        ld     pp,#page0to0
   ;     call   rampage0clr


        ei


         ret


;//================delay================================

delay:
      
push
pp

push
r0


ld
pp,#00h
                ld      r0,#16-3
d50:

nop

djnz
r0,d50

pop
r0

pop
pp
                ret

        END

相关帖子

沙发
fenaniu|  楼主 | 2012-9-3 11:25 | 只看该作者
有谁用过三星827x系列的单片机?上面程序main只跑一次就没反应了。程序的功能是实现p0.3口灯的闪烁,现在灯只亮一次就灭了再无反应。p0.3=1时灯灭,0时亮

使用特权

评论回复
板凳
Ryanhsiung| | 2012-9-3 17:13 | 只看该作者
你的程序有问题!!!!!!!!!!!
  请检查程序

使用特权

评论回复
地板
hp34401a| | 2012-9-3 18:14 | 只看该作者
不懂汇编(X86的反而会),不懂3*, 帮顶吧。

使用特权

评论回复
5
Dick00| | 2012-9-3 18:20 | 只看该作者
额,完全不懂,大学就单片机挂了,帮顶下

使用特权

评论回复
6
ningling_21| | 2012-9-3 21:13 | 只看该作者
用仿真器调试运行,看看程序到底跑到哪里去了...

使用特权

评论回复
7
阿南| | 2012-9-4 09:48 | 只看该作者
看程序,很大原因是产生中断了而没有相应的处理代码。

使用特权

评论回复
8
zhang7676050| | 2012-9-5 11:32 | 只看该作者
估计是中断里的程序没有处理好   汇编好久没有用过了

使用特权

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

本版积分规则

1

主题

6

帖子

0

粉丝