这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界» 论坛首页» 综合技术» 基础知识» AT90S1200 AT90S1200 怎么不工作?

共2条 1/1 1 跳转至

AT90S1200 AT90S1200 怎么不工作?

院士
2006-09-17 18:14:16 打赏
AT90S1200 AT90S1200 怎么不工作?



关键词: AT90S1200 怎么 工作

院士
2006-12-22 22:43:00 打赏
2楼
问 我是从89C51转型而使用 AVR 单片机的。我在用 AT90S1200作简单应用时遇到了困难,请高手指点。
下面是我设计的图与程序:编译通过,单步运行正常,程序写入芯片后,在实验板上就不能工作???我实在找不出原因了???
希望提出宝贵见意。谢谢!!!
编程器是用SP100A,但我也有双龙公司的串行与并行下载线。


程序:

;对 AT90S1200芯片的实验应用************************
;*
;*;***********************************************
.include "2313def.inc"
.def second =r31
.def status =r29
.def shuee =r28
.def temp =r25
;*****源代码段落
.cseg
.org 0
rjmp reset ;reset handle
reti ;unused int0
rjmp time_int ;timer0 interrupt
reti ;unused analogue interrupt handle
;****************************************************************************
;*
;* Main Program Register variables
;*
;****************************************************************************
;*
;*****Code
RESET: ldi temp,0xc0 ;0
mov r0,temp
ldi temp,0xf9 ;1
mov r1,temp
ldi temp,0xa4 ;2
mov r2,temp
ldi temp,0xb0 ;3
mov r3,temp
ldi temp,0x99 ;4
mov r4,temp
ldi temp,0x92 ;5
mov r5,temp
ldi temp,0x82 ;6
mov r6,temp
ldi temp,0xf8 ;7
mov r7,temp
ldi temp,0x80 ;8
mov r8,temp
ldi temp,0x90 ;9
mov r9,temp
ldi r30,0
;
ser temp
out DDRB,temp ;初始化B、D所有的为输出
out DDRD,temp ;初始化B、D所有的为输出
ldi temp,0xc0 ;数码管显示为"0"
out PORTB,temp ;
ldi temp,0x20 ;LED灯亮
out PORTD,temp ;
ldi temp,0x03 ;时钟1/64分频,晶振4MHZ
out TCCR0,temp ;
ldi temp,6 ;16us*250(TCNT0)*250(second)=1s
out TCNT0,temp ;
ldi temp,0x02 ;允许定时器0中断
out TIMSK,temp ;
wdr
ldi temp,0x0c ;看门狗256k,024s*4=0.96s
out WDTCR,temp
sei ;全局中断打开
;
loop: wdr
rjmp loop
;**********************
;*
;*
;*
;**********************
time_int: in status,SREG
ldi temp,6
out TCNT0,temp
inc second
mov temp,second
cpi temp,250 ;250
breq time1s ;250次数到
rjmp tend
time1s: clr second
inc r30 ;1s到
cpi r30,10
breq shuover ;相等转移
rjmp nextshu
shuover: clr r30
nextshu: ld temp,z
out PORTB,temp
;
sbis PORTD,5 ;
rjmp dkou
cbi PORTD,5 ;0
rjmp tend
dkou: sbi PORTD,5 ;1
tend: out SREG,status
reti
;********************** 1: 请版本给点意见!谢谢! 问双龙他们不回答我! 2: 呀!你是1200,为什么包含2313的头文件,不一样的!
你的图画的不错哟! 3: 求解!!!我用1200试过了不行,接下来改用2313也不行。头文件没改过来。怎么用1200怎么就那么难呢!!! 4: 哈哈。问题发现了。我终于见到了黎明的曙光了! 5: 怎么不用C呢?

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]