The STK600 development kit has considerable auxiliary development value. This is the most comprehensive tool I have ever seen to evaluate the AVR MCU. It is estimated that there have been some simple children who have brought the simple world to the AVR world. Half-body squatting in the AVR, it should be proved that "born for AVR, died for AVR", this is really the culprit. However, the world is also not lacking in the "peony flower to die, the ghost is also romantic", the author is also willing to be a "abuse of the yellow cover" to try out more features of the STK600 development kit.
Serial port
Speaking of the serial port, the small partners who are crawling in the electronics industry are basically unfamiliar. The author also has a lot of "this is too pediatric thinking". I didn't expect to hit the nails when I came up. First of all, the STK600 development kit is not for you. Prepare a 5-star service. When you use each function, you will find that there is a shortage of two. Just say that this RS232 serial port requires you to prepare a 9-pin D-SUB interface cable (one male and one female). Female).
Serial port routines can be found in Atmel Studio 6.1, where I compiled and downloaded a UART interrupt example for the ATmega2560 routine. The problem is again, the baud rate did not say how much the setting, the author found in the code, it may be Atmel company wants to teach us a reason to "do it yourself, can be full of food and clothing." Unfortunately, the author did not get through, still like a dragon Service, is it not a bit up?
Open the HyperTerminal and set the parameters. No matter how it is operated, the HyperTerminal has no information to print. When you are in a hurry, you can see the serial port of the serial port. It’s not a pothole. This RX and TX signal lines are not connected to the MCU. MCU has no relationship at all.
But there is at least a direction. First, you need to let RX and TX establish a connection with the MCU Atmega2560.
RS232's spare interface is easy to find. The problem is that I don't know how to connect with the MCU's signal line. I also need to find the ATMEGA2560 datasheet, which is very troublesome, but there are other ways.
In fact, the operation is still very simple and convenient, just know the method. Connect the RX and TX signal lines correctly according to the SPEC instructions.
Everything is ready, and the number 3, 2, 1 is powered on.
Bingo!
In the original code, the output print is "Hello, World!" is too greasy. When I checked the baud rate setting in the code, I changed it to "Hello, eeboard" and it looks much more comfortable...
CAN controller area network
Compared with the serial port, CAN has not reached the level of familiarity, but its status is also a prince. The reason is that it controls the communication system on the car. Can you imagine that there is no car now? Now we have to take a devout attitude to understand its background. The CAN bus was developed by the German company BOSCH. It was mainly used in the automotive industry at first. However, due to its outstanding features, high performance and high reliability, it is now widely used in the mechanical industry, CNC machine tools, medical equipment and other fields. It's a bit like "unintentional willows".
The main three-layer structure of CAN is: physical layer, data link layer, and application layer.
Now look back at the STK600, which also carries a CAN module circuit.
CAN transceiver is Atmel's own product ATA6660, supporting differential serial bus standard
Practical application in STK600 development board
With Atmel's own ATA6660 CAN transceiver, the circuit is much simpler, with just a few resistors, and everything is done. No wonder now that software engineers are fragrant, hardware circuit design engineers are almost out of food. . . Of course, this is just a joke, let's take a look at several special interfaces in the CAN module circuit TERM, SPLIT, SLOPE CTRL is another mystery.
TERM: When the CAN baud rate is greater than 100 Kb/s, a jumper cap is required, which is equivalent to adding a 124 ohm resistor between the CAN-H and CAN-L signal lines.
SPLIT: This jumper is mainly used to pull up the CAN-H and CAN-L signals.
SLOPE CTRL: This jumper pulls down the RS signal regardless of the position to adjust the slope of the CAN signal and prevent signal transients.
Unfortunately, Atmel Studio 6.1 does not provide CAN routines for the ATMEGA2560, and it is quite disappointing to demonstrate CAN functionality.
LIN bus
The "cheap" of cars has led to the popularity of family cars. In some cities, the vehicles used for commuting to work have returned to green bicycles, which is convenient and quick. The CAN bus communication system specifically for automobiles seems to be overkill in some inexpensive cars. Therefore, the LIN bus has emerged, which is an auxiliary extension of the CAN bus. You can also understand that the LIN bus is a small follow-up to the CAN bus. Basically, it does not require a hardware foundation. The implementation of the LIN bus hardware can be based on a common serial communication interface (SCI), and even a common I/O port can be used in a child node. Add a timer to simulate. Its existence is undoubtedly cost-effective on cheap cars and more suitable than the CAN bus.
The LIN transceiver used in the STK600 development kit is Atmel's ATA6661, which supports the LIN 2.0 specification, next to the RS232 serial port. The treatment is visible in general, and it is a life-long job.
The ATA6661 has few external interfaces. Similarly, the circuit in the STK600 development board is relatively simple.
On the STK600 development board with the device board, its application on the LIN bus can be used as both a master device and a slave device. When the application running on the bus is used as the master device, the M LIN jump cap must be connected to pull up the LIN signal. To BAT. The BAT voltage is required between 5 and 12V and must be powered externally.
The MCU can be connected through the 6PIN interface socket on the other end. Usually, the MCU realizes the LIN bus transmission through the UART. It should be noted that the NSLP signal line must be connected to the high level to ensure that the LIN bus output does not enter the sleep mode.
With the development of the automotive industry, the CAN bus and the LIN bus can be said to be interdependent. It is said that the relative application range of LIN is narrow, focusing on automotive electronics, and the development of the CAN bus is huge, and the industry is becoming more and more broad.
summary
It mainly introduces the functions of serial port, CAN bus and LIN bus on STK600 development kit. These three are all widely used interfaces in the industry. CAN bus and LIN bus are interdependent. The realization of LIN bus can be realized by serial port. The CAN bus, which was born for the automotive electronics industry, has been extended to all walks of life, and the LIN bus for automotive electronics has a price/performance ratio that CAN bus can't match in some respects, and it is much better than blue. The serial port is as simple as ever for us, but it can't be replaced.
Modern Physics Experiment Series
Modern physics experiment related equipment for efficient specialized physics laboratory
Modern Physics Experiment Instruments,Optical Instruments,Acousto-Optic Modulator Experimental Device,Optical Spectroscopy Experiment Determinator
Yuheng Optics Co., Ltd.(Changchun) , https://www.yhenoptics.com