共2条
1/1 1 跳转至页
AT90S1200 AT90S1200 怎么不工作?

问
我是从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呢?
下面是我设计的图与程序:编译通过,单步运行正常,程序写入芯片后,在实验板上就不能工作???我实在找不出原因了???
希望提出宝贵见意。谢谢!!!
编程器是用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 跳转至页
回复
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
分享汽车通信和多媒体总线结构被打赏20分 | |
【我踩过的那些坑】结构堵孔导致的喇叭无声问题被打赏50分 | |
NUCLEO-U083RC学习历程38+串口通过队列的方式输出两个字符串被打赏20分 | |
【我踩过的那些坑】分享一下调试一款AD芯片的遇到的“坑”被打赏50分 | |
电流检测模块MAX4080S被打赏10分 | |
【我踩过的那些坑】calloc和malloc错误使用导致跑飞问题排查被打赏50分 | |
分享电控悬架的结构与工作原理(一)被打赏20分 | |
多组DCTODC电源方案被打赏50分 | |
【我踩过的那些坑】STM32cubeMX软件的使用过程中的“坑”被打赏50分 | |
新手必看!C语言精华知识:表驱动法被打赏50分 |