共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 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】智能可穿戴设备AR/VR如何引领科技新潮流! | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
【有奖活动】震撼来袭!这场直播将直击工程师的心灵! | |
“我想要一部加热台”活动,不花钱赢取开发好工具!活动开始了哦 | |
【有奖活动】伙伴们:您的“需求”解决了吗? |
打赏帖 | |
---|---|
【换取手持数字示波器】N32G430点亮数码管与串口打印、ADC被打赏40分 | |
老胖子聊电路--分析一个反馈电路被打赏50分 | |
【换取手持数字示波器】+点亮WS2812RGB灯被打赏50分 | |
【换取手持数字示波器】+线性调整器理论知识分享被打赏40分 | |
放大↔震荡被打赏50分 | |
【换取手持数字示波器】RTduino驱动ssd1306+sht31温湿度计被打赏40分 | |
【换取手持数字示波器】称植国产开源TobudOS到雅特力AT32F425被打赏40分 | |
【分享评测,赢取加热台】+Telink-泰凌微电子B91点灯篇被打赏20分 | |
【换取手持数字示波器】+精英板驱动LCD屏被打赏50分 | |
【换取手持数字示波器】+DFR0216全彩灯带WS2812示例分享被打赏50分 |