2020 Blue Bridge province Cup race ready Diary 1

# Environment: IAP15F2K61S2, Keil5 +

# A, 51 bus on Intel: XBYTE Usage
When #include <absacc.h> after, can XBYTE [0x 4-digit hexadecimal] Control P2, P0, WR
example:
XBYTE [0x8ff0] = 0x00
0x8ff0 that is deployed : P2 section 1000 1111, P0 part: 11,110,000
but in fact this is not what P0 with eggs
!!! its real role is to:

									XBYTE[P2P0] = P0;

In fact, the left parentheses P0 and egg with nothing, P0 is the focus on the right, left P2 is useful
implementation mechanism is:
①P2 + WR down
②WR pulled
③P0
just binding "letter of long days," Blue Bridge cup design board

# Second, the decoder 138 feet absolutely not removable ABC
might write such a function:

void Change138(unsigned char num)
{
	//高位
	LSA = num/2/2%2;
	//中位
	LSB = num/2%2;
	//低位
	LSC = num%2;
}

Do not! ! !
There is no thought of such a problem:
in the case of mating with a latch, such conversion will generate a lot of interference in the middle of
example: 4 decoder 138 becomes 7
Initial 4: ABC 100
at the end of 8: ABC 111
first line statement: ABC (100) -> ABC (100)
a second line statement: ABC (100) -> ABC (110)
statement on line: ABC (110) -> ABC (111)
in the middle of the second row conversion function accidentally generated interference state when the selected ABC = 110

# Third, do not want to appear baffling problem in the .h file defines the variables C language! ! ! !

Published an original article · won praise 0 · Views 55

Guess you like

Origin blog.csdn.net/qq_43313844/article/details/104077532