Design and Implement of Responder Based on Freescale HCS12 Single
Chip Microcomputer
Responder is also known as the first signal discriminator, which is widely used in various competitions. It can judge the number of the first player accurately, fairly and intuitively. Currently, a variety of quiz responder has emerged on the market, in which a small responder is commonly designed with small-scale digital integrated circuit. Although the technology has been quite mature,but it is simple function, low intelligence, high fault, simple display, less flexibility, not convenience for upgrade, it has been unable to meet all kinds of requirements for intellectual competitions and variety shows. Therefore, it is necessary to develop some kinds of responder which are more suitable for applications.
In recent years, with the rapid development of science and technology, the applications of single-chip microcomputer are becoming widely, which promotes the development of traditional measurement and control technology. In this paper, Freescale HCS12 [1-3] is designed as a core component to achieve an intelligent digital responder with 8-channel [4-8], it has some breakthroughs on technology, function and other aspects, comparing with the past responder. It is characterized by simple structure, powerful, good reliability, practicability, so that the competition can really carried out on just, fair and open rules.
The basic functions of responder designed in this paper are:
1
(1) The system can limit the competition time and answer time of the alarm;
(2) The system can identify the answer signal and identify the player's number;
(3) The system can calculate score for each player and display the scores.
Responder can accommodate 8 players numbered 1 to 8. In addition, LED digital tubes are designed to display the latched data. After race host clears the system, if participants press switch, and after answer is certificated whether it is correct or not, the number of first player to answer in action is immediately shown by digital tubes. Responder should have a strong ability to distinguish players to answer in the action, its resolution reaches at least a few ms
After the requirements and functions of responder are analyzed, the following circuits are required in general:
1、Responder circuit
The circuit has two functions: one is to identify the number of the player who press button, and to save the number; the other is to prohibit the other players from buttoning or to make other buttons not available
2、Timing circuits
Host can set competition time and answer time by the time pre-set-circuit. If nobody can answer question within the set time, all players will not get score, then
2
the host will announce the answer. Besides, if someone gets the chance to answer the question, but does not give the right result before the allowable time, he or she won't get the score, the overtime signal will be also send, the host will declare the right answer. Freescale HCS12 contains timer module, the timer module can be directly used.
3、Overtime circuit
HCS12 will send overtime signal when time goes beyond the set time, this signal will be transferred to the PC computer by the serial port. The next question will be proceeded to answer.
4、Scores count and display circuit.
When host presses the answer key, it is time to start to answer, if one player presses the answer key, his or her number will be recorded, his or her score will be counted and displayed on the LED digital tubes.
Bedside the circuits designed above, some necessary logic
designs are also necessary. The logic designs are as following:
First, the host will read the question which will show in the LCD; next, the PC computer will send letter \"k\At the same time, timing circuit starts to work, if nobody gets the chance to answer
3
the question within permitted time, microcontroller will send the word \"chao shi\" to PC computer; If someone presses the competition key within the specified time, microcontroller will send his or her number. If the time goes beyond the permitted time, PC computer will send \"next\" which means turning to the next question, the next question will be automatically showed to answer. If some player gets the chance to answer the question, his or her number and scores will decrease 1 automatically and show in the digital tubes, then microcontroller sends \"next\" to go on the next question. If the score is few than 0 after decreasing, player is eliminated. The right answer will show on the LCD. Finally, if all the questions are done, microcontroller will send \"e\" to end the game, then the scores of all players will be computed, the highest one will be shown on the digital tubes.
Responder hardware is firstly designed;Responder hardware is taken directly from the hardware resources of Freescale HCS12 development board developed by Suzhou University. The development board takes MC9S12DG128 as the core, using modular design approach, it extracts part of I/O resources,and it also provides each module with a corresponding interface circuit. It also provides A/D input channels, PWM low-pass filter circuits, 16-key keyboard input channels, 8-bit digital I/O circuits, SPI I/O circuits, SCI communication circuits,IC but I/O expansion circuits and so.In this paper, the hardware modules, the pin connections and the corresponding interfaces of the development board are listed and unified to redesign by actual needs of the system.
Before the start of the main program, the total interruptions are turned off and each module is initialized. The initialization of each module has been done in the
4
corresponding initialization subprogram of each module. Here we only need call the corresponding initialization subprogram. After the initialization of each module is completed,the total interruptions should be turned on. The main body of the main program is a loop structure; there are also several sub-cycles in the main loop, which are used for the cycle waiting of each loop. After the completion of the initialization, the system has been waited for the signal of competition start with the circular mode until the signal comes. When this signal is received, the system checks whether the cycle time is overtime, if it is overtime, the system changes to the next question, otherwise, the system checks the competition signal, if some player competes to answer, then the system checks whether the answer time is out, if the time is not out, the system judges whether the result is true, if the result is right, the player is added 1 point, otherwise, the player is subtracted 1 point, and the system enters the next question. To the player whose score will be subtracted, the system needs to check whether the score is low than 0, if it does, this player's input channel is turned off. To be noted that, if the competition flag is 1, it should be cleared
Responder is one of the essential devices in various knowledge and intellectual contests, the development of better and more intelligent digital responder is very significant. Responder designed in this paper can achieve a responder's basic functions through experimental prototype testing.
It reaches the design target with reasonable design, simple structure, good commonality, strong function, reliable answer and quick reaction. However, as hardware limitations of development board, some functions have not been able to
5
achieve, such as the development board does not have enough LED digital tubes to display all player's scores simultaneously, the host can not adjust answer time according the difficulty of the question and so on. These issues will remain to be addressed in future development.
6
外文资料译文
基于Freescale HCS12系列单片机设计和实现抢答器
抢答器也被称为第一信号鉴别器,它被广泛应用于各种比赛。它可以判断一个选手的数量准确,公正,直观。目前,有多种抢答器已经出现在市场上,在其中一个小的抢答器通常用小规模数字集成电路设计。虽然该技术已相当成熟,但它功能简单,智能低,高容错,显示简单,灵活性较差,不便于进行升级,它已经无法满足各种智力竞赛,综艺节目的要求。因此,有必要开发一些种类的抢答器,可以更适合的应用。
近年来,随着科学技术的飞速发展,单片机的应用正在变得广泛,从而促进传统的测量和控制技术的发展。在本文中,飞思卡尔的HCS12 [ 1-3 ]被设计成一个核心组成部分,实现了智能数字抢答器与8通道[ 4-8 ] ,但对技术,功能等方面有所突破,与过去相比响应。它的特点是结构简单,功能强大,可靠性好,实用性,从而使比赛能够真正进行了公正,公平,公开的规则。
抢答器的设计本文的基本功能是:
(1)该系统可以限制竞争时间和回答的报警时间;
(2)该系统能识别应答信号并确定该选手的号码;
(3)该系统可以计算每个选手的分数,并显示分数。
抢答器可容纳8名选手编号为1到8。此外, LED数码管的设计,显示锁存数据。之后的比赛主持人清除系统中,如果选手按下开关,无论之后的回答是否正确,第一个选手在行动回答的数目是由数码管立即显示。抢答器应具有较强的分辨能力的选手在动作来回
1
答,其分辨率达到至少几毫秒后响应方的要求和功能进行了分析,下面的电路是必需的,一般:
1、抢答器电路
该电路有两个功能:一个是确定谁按下按钮,播放器的数量,并保存号码,另一种是从扣扣禁止的其他选手或作出其他按钮不可用
2时序电路
主机可以设置比赛时间和时间预先设定电路答题时间。如果没有人能在设定的时间内回答问题,所有选手都不会得到分数,那么主机将公布答案。此外,如果有人得到机会来回答这个问题,但在允许的时间之前没有给出正确的结果,他或她不会得到分数,加班的信号也会被发送,主机将宣布正确答案。飞思卡尔HCS12包含定时模块,定时模块,可直接使用。
3、加班电路
HCS12将发送超时信号,当时间超过设定的时间,这个信号将通过串口传送到PC机。接下来的问题将进行回答。
4、评分计数和显示电路。
当主持人按下了抢答键,表示开始回答,如果一个选手按下了抢答键,他或她的编号将被记录,他或她的分数将计算并显示在LED数码管显示。
2
设计也是必要的。逻辑设计是如下:
首先,主机会读取这将在LCD显示的问题,其次, PC机将发送字母“K” ,这意味着该剧开始竞争。与此同时,定时电路开始工作,如果没有人得到机会允许的时间内回答问题,微控制器会发出单词“超市”到PC电脑,如果有人按下指定时间内竞争的关键,单片机将送他或她的编号。如果时间超出了允许的时间, PC机将发送“下一步”,这意味着将目光转向了下一个问题,下一个问题将被自动显示来回答。如果某些选手都有机会来回答这个问题,他或她的编号和成绩将自动减少1 ,并显示在数码管,然后单片机发送“下一步”继续下一个问题。如果分数是几比0后下降,选手被淘汰。正确的答案将显示在LCD上。最后,如果所有的问题都做了,微控制器会发出“E”来结束比赛,然后所有选手的分数将被计算,最高的一位将在数码管显示。
抢答器的硬件首先设计;抢答器的硬件是由飞思卡尔HCS12开发板由苏州大学开发的硬件资源直接服用。该开发板采用MC9S12DG128为核心,采用模块化设计方法,它提取的I / O资源的一部分,而且还提供了每个模块有相应的接口电路。它还提供了A / D输入通道, PWM低通滤波电路, 16键键盘输入通道,8位数字I / O电路,SPI的I / O电路,SCI通信电路,集成电路,但I / O扩展电路和所以在本文中,硬件模块的引脚连接和开发板的相应接口列,统一由系统的实际需要重新设计。
在主节目的开始之前,总中断被关闭,每个模块被初始化。每个模块的初始化中的每个模块的相应初始化子程序已经完成。在这里,我们只需要调用相应的初始化子程序。每个模块的初始化完成后,总的中断应当接通。主程序的主体是一个环结构;也有几个子周期在主循环中,其中用于每个循环的周期的等待。在完成初始化后,系统已经等待了比赛开始的信号与圆形模式,直到信号到来。当接收到此信号后,系统会检查周期时间是否加班,如果是加班时,系统切换到下一个问题,否则,系统会检查的竞争信号,如果一些选手竞
3
争来回答,然后系统会检查是否答案时间是那样,如果时间不超时,则系统判定结果是否为真,如果结果是正确的,播放器中加入1点,否则,选手被减去1点,并且系统进入下一问题。给选手的分数将被减去,系统需要检查是否得分低是大于0 ,如果是的话,该选手的输入通道被关闭。要注意的是,如果在竞争标志为1时,它应该被清除。
抢答器是在不同的知识和智力竞赛的重要设备之一,更好,更智能数字应答的发展是非常显著。抢答器设计本文通过实验样机的测试实现了抢答器的基本功能。
它达到了设计目标具有设计合理,结构简单,通用性好,功能强,可靠的回应和快速反应。然而,由于开发板的硬件限制,有些功能未能实现,如开发板没有足够的LED数码管同时显示所有选手的分数,主机可以根据问题的难度不会调整答题时间等。这些问题将继续留在未来的发展加以解决。
4
因篇幅问题不能全部显示,请点此查看更多更全内容