📄 int.doc
字号:
T h e 8 0 5 1 F A I n t e r r u p t D e m o(0) INTRODUCTION This is a diagnostic testing and demo program I've used when preparing8051FA applications. It comes in real handy when you need to verify that thecircuits containing the 8051FA will generate the correct interrupts on themicroprocessor. This software uses the IO library, which is an interface to a keypad andLCD unit. Either you will need compatible hardware, as described in theIO reference, or you will need to write an emulation of the necessary IOroutines, for example, to display results and read commands over a RS-232. For reference, these are the routines that you would need to emulate: * scr_init Initializes the display unit, clears it, and sets the cursor to row 0, column 0. * cputc Prints out the character contained in the accumulator A. Moves the cursor right one column. If the cursor was already at the last column it's location is undefined. * locate Sets the cursor to the location given by the variables Row and Col. Row should be in the range 0..3, and Col in the range 0..19.You will also need to allocate 1 byte of space in internal data memory each forthe variable Row, and Col if you write your own IO routines.(1) DISPLAY The display unit used with this software is a 4 x 20 LCD unit. The top row(row 0) is used to display the number of interrupts received from varioussources. These numbers are single digits listed in the following format: Column Interrupt Source 0 IE0 falling edge 1 IE1 falling edge 2 T2EX falling edge 3 CEX3 falling edge 4 CEX3 rising edge 5 CEX4 falling edge 6 CEX4 rising edge 7 CEX5 falling edge 8 CEX5 rising edge 9 CEX6 falling edge 10 CEX6 rising edge 11 CEX7 falling edge 12 CEX7 rising edgeThe CEX interrupt sources can distinguish both falling edges and rising edges. When the count for any interrupt source exceeds 10, its count is reset to 0and a 0 is displayed for it. Rows 1, 2, and 3 illustrate the concurrent execution of the interrupt loopsin TTY fashion: from column 0, rightward to column 19, and from row 1 down torow 3. When the display reaches the last row and column, it wraps around backto row 1 and column 0. The program starts when all the interrupt loops are "Spawned" from main.In the followiing sequence:main: <a> spawn TestIE0 <b> spawn TestIE1 <c> spawn TestT2EX <d> spawn TestCCF <e> start the interruptsretThe letters a, b, c, d, and e will be displayed as the corresponding points inthe program are reached.Each time a CCF interrupt is triggered, a number: 0, 1, 2, 3, or 4 is displayedcorresponding to the interrupt source (0 = CCF0, 1 = CCF1, 2 = CCF2, 3 = CCF3,and 4 = CCF4).Finally, each of the loops is marked as follows:TestIE0: Initialize IE0 while (1) { <f> wait for IE0 interrupt <g> }TestIE1: Initialize IE1 while (1) { <h> wait for IE1 interrupt <i> }TestT2EX: Initialize T2EX while (1) { <j> wait for T2EX interrupt <k> }TestCCF: Initialize CCF0, CCF1, CCF2, CCF3, CCF4 while (1) { <l> wait for T2EX interrupt <m> }The letters f, g, h, i, j, k, l, and m will be displayed as the correspondingpoint in each loop is reached. The display will therefore will be the sequence: a f b h c j d i efollowed by one or more of the sequences: g f, i h, k j, 0 m l, 1 m l, 2 m l, 3 m l, or 4 m l.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -