打印

求救````

[复制链接]
2009|13
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
boss001|  楼主 | 2007-12-3 17:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
chenczy| | 2007-12-3 17:23 | 只看该作者

你想用什么芯片做?

   你想用什么芯片做?有什么要求?

使用特权

评论回复
板凳
boss001|  楼主 | 2007-12-5 19:42 | 只看该作者

回复

AT89C51

使用特权

评论回复
地板
lelee007| | 2007-12-5 20:20 | 只看该作者

靠,抢答器

就那么些功能吧
又没什么指标要求

使用特权

评论回复
5
boss001|  楼主 | 2007-12-8 11:13 | 只看该作者

 各位大哥帮帮小弟,我想采用AT89C51芯片做抢答器,就是在抢答到时报警和犯规报警的程序不会编,希望各位帮忙,用LED显示数字,

使用特权

评论回复
6
hellomcu| | 2007-12-8 11:57 | 只看该作者

晕!

   看书去。。。。。
相关链接:http://shop35088126.taobao.com

使用特权

评论回复
7
hotpower| | 2007-12-8 12:12 | 只看该作者

不就是"你拍一,我拍二"吗???

使用特权

评论回复
8
zusen| | 2007-12-8 12:46 | 只看该作者

N年前写的,参考一下吧

;********************************************************************************
;********************************************************************************
;*
;*文本名称:抢答器.asm
;*功能:8路抢答,三位显视,答题时间可设,一位清零
;*编译工具:MedWin(万利仿真软件)
;*编写日期:
;*修改日期:
;*编写作者:zusen
;*修改人:
;*联系方式:zusen@21cn.com
;********************************************************************************
;********************************************************************************
;********************************常数和内存分配定义******************************


ISP_DATA                  EQU                0E2H
ISP_ADDRH                 EQU                0E3H
ISP_ADDRL                 EQU                0E4H
ISP_CMD                   EQU                0E5H
ISP_TRIG                  EQU                0E6H
ISP_CONTR                 EQU                0E7H
ISP_IAP_BYTE_READ         EQU                1
ISP_IAP_BYTE_PROGRAM      EQU                2
ISP_IAP_SECTOR_ERASE      EQU                3


T0_SIGN                   DATA                20H
SPRING                    BIT                 T0_SIGN.0
T0_ORVE                   BIT                 T0_SIGN.1


DISPLAY1                  DATA                30H               ;显示组数
DISPLAY2                  DATA                31H               ;显示计数第一位
DISPLAY3                  DATA                32H               ;显示计数第二位

SCAN                      DATA                33H               ;01时扫描组数,02扫描第一位,03扫描第二位
TS1_TMP                   DATA                34H
DELAY_TIME1               DATA                35H               ;延时绶冲
DELAY_TIME2               DATA                36H               ;延时绶冲

PLAY_TMPE1                DATA                37H
PLAY_TMPE2                DATA                38H




;*********************************************************************************
;********************************程序的开始***************************************
;*定义中断程序的入口,初始化各寄存器和内存
;*********************************************************************************
                           ORG                 0000H
                           LJMP                MAIN             ;复位后的第一条指令
                           
                           ORG                 001BH
                           LJMP                T1_INT           ;定时器0中断程序入口
                           
                           
                           ORG                 0080H          
MAIN:
                           MOV                 P0,#00
                           MOV                 P2,#00
                           MOV                 DISPLAY1,#00
                           MOV                 DISPLAY2,#09
                           MOV                 DISPLAY3,#00
                           MOV                 TS1_TMP,#100
                           MOV                 T0_SIGN,#00

                           MOV                 TMOD,#10H        ;T0设为工作方式一
                           MOV                 TH1,#0ecH
                           MOV                 TL1,#078H        ;10ms为时间间隔
                           SETB                EA
                           SETB                ET1              ;打开总中断控制器
                           SETB                TR1              ;启动定时器
                           
                           JNB                 P3.0,SET_TIME1
                           MOV                 ISP_ADDRH,#20H
                           MOV                 ISP_ADDRL,#00H
                           LCALL               READ_ID
                           MOV                 DISPLAY2,A
                           MOV                 PLAY_TMPE1,A
                           LCALL               DELAY_10ms
                           MOV                 ISP_ADDRH,#20H
                           MOV                 ISP_ADDRL,#01H
                           LCALL               READ_ID
                           MOV                 DISPLAY3,A
                           MOV                 PLAY_TMPE2,A
                          ; JNB                 P3.0,SET_TIME1
                           LJMP                LOOP
                           
                           
SET_TIME1:
                           LJMP               SET_TIME                           
;***********************************************************************************
;**********************************主程序 ******************************************
;*函数名称:LOOP
;*功能: 循环检测8组按钮是否按下
;*入口函数:无
;*输出数据:无
;***********************************************************************************
LOOP:
                          JNB                 P1.0,GROUP_ONE_POOL
LOOP1:                          
                          JNB                 P1.1,GROUP_TWO_POOL
LOOP2:                          
                          JNB                 P1.2,GROUP_THREE_POOL
LOOP3:
                          JNB                 P1.3,GROUP_FOUR_POOL  
LOOP4:
                          JNB                 P1.4,GROUP_FIVE_POOL
LOOP5:
                          JNB                 P1.5,GROUP_SIX_POOL
LOOP6:
                          JNB                 P1.6,GROUP_SEVEN_POOL
LOOP7:
                          JNB                 P1.7,GROUP_EIGHT_POOL
LOOP8:                          
                          LJMP                LOOP
;**********************************地址池 ******************************************
;*函数名称:
;*功能:
;*入口函数:无
;*输出数据:无
;*********************************************************************************** 
GROUP_ONE_POOL:
                         LJMP                 GROUP_ONE
GROUP_TWO_POOL:
                         LJMP                 GROUP_TWO
GROUP_THREE_POOL:
                         LJMP                 GROUP_THREE
GROUP_FOUR_POOL:
                         LJMP                 GROUP_FOUR
GROUP_FIVE_POOL:
                         LJMP                 GROUP_FIVE
GROUP_SIX_POOL:
                         LJMP                 GROUP_SIX
GROUP_SEVEN_POOL:             
                         LJMP                 GROUP_SEVEN
GROUP_EIGHT_POOL:
                         LJMP                 GROUP_EIGHT                                                                        
                         
;***********************************************************************************
;**********************************第一组 ******************************************
;*函数名称:GROUP_ONE
;*功能: 第一组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_ONE:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#01H       ;显示第一组抢到控制权
                         LCALL                 BUZZER              ;响声提示
GROUP_ONE_1:
                         JB                   T0_ORVE,GROUP_ONE_END ;倒计时结速
                         JNB                  P3.0,GROUP_ONE_END  ;手动清零
                         LJMP                 GROUP_ONE_1
GROUP_ONE_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP1
;***********************************************************************************
;**********************************第二组 ******************************************
;*函数名称:GROUP_TWO
;*功能: 第二组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_TWO:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#02H       ;显示第一组抢到控制权
                         LCALL                 BUZZER              ;响声提示
GROUP_TWO_1:
                         JB                   T0_ORVE,GROUP_TWO_END  ;倒计时结速
                         JNB                  P3.0,GROUP_TWO_END  ;手动清零
                         LJMP                 GROUP_TWO_1
GROUP_TWO_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP2                                                                                            
                         
;***********************************************************************************
;**********************************第三组 ******************************************
;*函数名称:GROUP_THREE
;*功能: 第三组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_THREE:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#03H       ;显示第一组抢到控制权
                         LCALL                 BUZZER              ;响声提示
GROUP_THREE_1:
                         JB                   T0_ORVE,GROUP_TWO_END  ;倒计时结速
                         JNB                  P3.0,GROUP_THREE_END  ;手动清零
                         LJMP                 GROUP_THREE_1
GROUP_THREE_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP3                         
                         
;***********************************************************************************
;**********************************第四组 ******************************************
;*函数名称:GROUP_FOUR
;*功能: 第四组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_FOUR:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#04H       ;显示第一组抢到控制权
                         LCALL                 BUZZER              ;响声提示
GROUP_FOUR_1:
                         JB                   T0_ORVE,GROUP_FOUR_END  ;倒计时结速
                         JNB                  P3.0,GROUP_FOUR_END  ;手动清零
                         LJMP                 GROUP_FOUR_1
GROUP_FOUR_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP4    
                         
;***********************************************************************************
;**********************************第五组 ******************************************
;*函数名称:GROUP_FIVE
;*功能: 第五组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_FIVE:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#05H       ;显示第一组抢到控制权
                         LCALL                BUZZER              ;响声提示
GROUP_FIVE_1:
                         JB                   T0_ORVE,GROUP_FIVE_END  ;倒计时结速
                         JNB                  P3.0,GROUP_FIVE_END  ;手动清零
                         LJMP                 GROUP_FIVE_1
GROUP_FIVE_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP5                                                
                         
;***********************************************************************************
;**********************************第六组 ******************************************
;*函数名称:GROUP_SIX
;*功能: 第五组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_SIX:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#06H       ;显示第一组抢到控制权
                         LCALL                BUZZER              ;响声提示
GROUP_SIX_1:
                         JB                   T0_ORVE,GROUP_SIX_END  ;倒计时结速
                         JNB                  P3.0,GROUP_SIX_END  ;手动清零
                         LJMP                 GROUP_SIX_1
GROUP_SIX_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP6                         
                         
;***********************************************************************************
;**********************************第七组 ******************************************
;*函数名称:GROUP_SEVEN
;*功能: 第五组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_SEVEN:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#07H       ;显示第一组抢到控制权
                         LCALL                BUZZER              ;响声提示
GROUP_SEVEN_1:
                         JB                   T0_ORVE,GROUP_SEVEN_END  ;倒计时结速
                         JNB                  P3.0,GROUP_SEVEN_END  ;手动清零
                         LJMP                 GROUP_SEVEN_1
GROUP_SEVEN_END:
                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         LJMP                 LOOP7  
                         
;***********************************************************************************
;**********************************第八组 ******************************************
;*函数名称:GROUP_EIGHT
;*功能: 第五组按下处理程序
;*入口函数:
;*输出数据:
;*********************************************************************************** 
GROUP_EIGHT:
                         SETB                 SPRING              ;有组数响应
                         MOV                  DISPLAY1,#08H       ;显示第一组抢到控制权
                         LCALL                 BUZZER              ;响声提示
GROUP_EIGHT_1:
                         JB                   T0_ORVE,GROUP_EIGHT_END  ;倒计时结速
                         JNB                  P3.0,GROUP_EIGHT_END  ;手动清零
                         LJMP                 GROUP_EIGHT_1
GROUP_EIGHT_END:

                         CLR                  T0_ORVE
                         CLR                  SPRING
                         MOV                  DISPLAY1,#00H
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         
                         LJMP                 LOOP8   
                         
;***********************************************************************************
;**********************************T0中断入口 **************************************
;*函数名称:T0_INT
;*功能: 定时、扫描和计数
;*入口函数:
;*输出数据:
;*********************************************************************************** 
T1_INT:
                         PUSH                 ACC
                         PUSH                 PSW
                         MOV                  TH1,#0ecH
                         MOV                  TL1,#078H
                         
                         JNB                  SPRING,T1_INT_1
                         DJNZ                 TS1_TMP,T1_INT_1
                         MOV                  TS1_TMP,#200
                         MOV                  A,DISPLAY2
                         CJNE                 A,#00,COUNT1
                         MOV                  A,DISPLAY3
                         CJNE                 A,#00,COUNT0
                         MOV                  DISPLAY2,PLAY_TMPE1
                         MOV                  DISPLAY3,PLAY_TMPE2
                         MOV                  DISPLAY1,#00
                         CLR                  SPRING
                         SETB                 T0_ORVE
                         LJMP                 T1_INT_1
          
COUNT0:                        

使用特权

评论回复
9
hq_y| | 2007-12-8 12:50 | 只看该作者

问题是,ls他看不懂啊~~~~~~~

使用特权

评论回复
10
zusen| | 2007-12-8 12:53 | 只看该作者

不是吧,中文会看吧

写的都是中文注泽

使用特权

评论回复
11
boss001|  楼主 | 2007-12-8 14:15 | 只看该作者

感谢ZUSEN

真的好感激你的帮助

使用特权

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

本版积分规则

4

主题

10

帖子

0

粉丝