Reflections on a low level triggered

First, the problem background

Yesterday library to write a development board, wrote LCD part, encountered a few problems.

As FIG correlation circuit, the upper left corner for the microcontroller is connected by hardware 74HC595 SPI, 74HC138 chip select signal is produced by, after the two 8-bit parallel output series 470 ohm 8P4R exclusion connected to a set of pin and LCD interface.

1602 total LCD 16 pin, wherein there are 11 data, the LCD 595 is forced to be connected to the microcontroller IO port not so much. This is a bad design, but I have found over the welding problems.

There are two problems:

First, only a serial input parallel output 595, but the LCD module has a read command, LCD is busy detection, and this is a necessary operation, however, can not directly read the microcontroller;

Secondly, I have to wait before each write operation LCD into an idle state, but only about half of the LCD display character, and not fixed.

 

Second, the solution

The first question I want to connect a specified user line, during initialization as a parameter.

The second question, I read the 74HC595 before each output set to high, then working.

In retrospect, the link between the second question and solutions somewhat subtle.

 

Third, the process of resolving

As a development board, the board have a number of net leads pin, can be connected by Dupont line. Precisely, the output 595 is connected to the resistor in series after the LCD, outputs two do not conflict, and this net is drawn out, but also leads to the GPIO microcontroller, then a solution to the first problem is very obvious - put together. Accordingly, the program should call the read operation on the GPIO.

And solve the second problem would struggle to find. After the microcontroller can read the LCD busy, every time I wait before writing in the program enters an idle LCD, it should be able to work, but did not.

I will try to join a delay, adding more than 1ms delay in the writing process, found to work properly. Then I tried to eliminate as much delay and reduce the length of the delay, found that 10,000 cycles for as long as the delay on the line before the rising edge of the E-pin LCD, but not vice versa. This delay solutions far to my satisfaction.

E while the rising edge of the pin, the LCD pin level is read and started operation, it must be delayed before. One possibility is to signal transmission delay, the minimum delay is required here alkylene milliseconds excluded. Another possibility is busy reading error state level, indicating a high level of busy reading became low.

Before the process of solving the first problem, the use of resistance between 595 and LCD, it's there so that the two outputs do not conflict. But this is only 470 ohm resistor, if a low level at both ends of a high level, there will be a current of 10mA, for the CMOS IC 74HC595 other, so that this current does not exceed the value of voltage deviation over 1V, but not to other IC certain of.

A 4-pin RGB LED lamps have a total of yin and yang two connections, I was wondering why there are two kinds of access to information that, older IC, such as 51, is a manufacturing process using TTL, port strong sink current capability and the ability to source current is weak, if you use a pin drive LED, will generally positive to the VCC, series resistor connected to the pin, it is used for the RGB of common anode.

The following are two TI's datasheet FIG screenshot 74LS00 and 74HC00, the analysis data can be obtained, the former is slightly stronger output low capacity, quite symmetrical, which obviously asymmetrical.

74HC00

74LS00

In this problem, source output current capability of the LCD module is weak, a 5V supply, when the output 595 is low, the LCD output is high, the voltage of 1.1V which port; 595 when the high-output, low LCD output, after voltage is 1.1V by the port; two voltages are determined to be a low level microcontroller.

Analysis of this point, the solution is not hard - before reading the output set 595 is high, then you can correctly read the LCD output.

 

Fourth, thinking

This is a problem not difficult, I have successfully solved, but the problem-solving ideas and the process is still quite let me harvest.

If I read the datasheet carefully before drawing schematics, we know that there are LCD read operation, there would be the problem behind. So, after doing development process, to carefully read the datasheet; device attributes seemingly only output also may need to enter, not because a device is an output device to put it up on a pure outlet.

If I put the LCD connected directly to the microcontroller when drawing schematics, there will not be problems behind. In this development board 595 connected to the digital control, the LCD pin with three kinds of devices, such multiplexing scheme is bad and should be avoided; few more prefer the IC, or more for a single-chip IO Although the high cost, but also save time down.

595 development board put this original purpose, it is to give the user learn the timing and learn to write programs based on datasheet, thinking that beginners will play LED, for the convenience of users plus the exclusion, even if you want to output as the other, harmless to humans and animals are also series resistor. Later, only then LED and LCD connected up together. And output LCD 595 but not directly connected reason the connection resistance, wiring for convenience only. I did not expect the final lucky hit, the series resistance of great help. Maybe later, when the design should take account of the series resistance, resistance pennies anyway, rounding it is not money, but chances are there is great use.

Finally, and most importantly, knowledge of electronic circuit is mastery of. Even minutiae, irrelevant, or have obsolete knowledge, may also become the key to solving a problem. If you did not understand the reasons behind common anode and common cathode, for the microcontroller developers have been using a CMOS process is, how will not receive instructions from the LCD all the way to think of the problem TTL drive capability it? Probably did not solve the problem, right now!

 

Guess you like

Origin www.cnblogs.com/jerry-fuyi/p/11298042.html