Arduino expansion board is called Shield, and the Raspberry Pie's expansion board is called HAT (Hardware Attached On TOP), which means a hardware board attached to the top of the Raspberry. Here, you will be designed with a piece of open source from zero to the Raspberry PI ICA HAT.
Raspberry Pi Ica Hat
First, demand analysis
Design HAT's original intention is to provide basic display and user input functions for the Raspberry Part, and lead to hardware interfaces such as UART, I2C, SPI, easy to connect to other modules, and can also be used as a user to learn the entry board for the user's hardware programming ( Starter board. The configuration of ICA HAT is as follows:
The user button X5 can be used as the upper and lower or "determination" buttons;
User LED X4 implements basic instructions, and another power indicator LED;
Active buzzer X1 provides alarm function;
Infrared transmit tube X2, infrared receiving head X1, realizing infrared transmission and receiving remote control;
Seven Digital Tube X2, implement 8-digit display, driven by the MAX7219 chip of the SPI interface;
Several I / O and power extension needles.
After setting good requirements, the first thing to consider is the structural problem. The design of this example is the Raspberry 2b model, and is also compatible with one generation B + model. The picture below shows the mechanical structure of the Raspberry 2b / B +:
For the reservoir of the Raspberry, two kinds of two HAT can be designed. The full-length plate is the same size as the raspberry, but because the raspberry USB and RJ45 connector are high, it is necessary to note whether the device under the region is in contact with the connector.
The semi-long plate contains only four screw holes.
Both plate types are connected to the main board with a 2.54 mm spacing, and secured by 4 M2.5 copper columns or screws with the motherboard. As shown below.
Full length Hat and Half Hat
Two-dimensional HATs that have been designed have been stored on Github, and readers can design on this basis.
Open source development board recommended:
ATOM E3825 Development Board is compact, affordable development board with a 64-bit Intel Ato E38xx series.
A high-performance parallel processing application developed by the P1601-DK02 development board and excellent performance and excellent performance and make full use of onboard EPIPHANY chips.
Intel Galileo Development Board A microcontroller board based on an Intel® Quark SoC X1000 application processor.
After analyzing the mechanical structure, it is necessary to consider I / O resource allocation. The I / O of the Raspberry Pass 2B / B + includes two SPI interfaces, two I2C interfaces, and a UART interface. There is no hardware PWM and ADC available. Moreover, I2C0 is used as an IDPROM interface for reading the HAT board information, and the user cannot be used. SPI1 is called SPI_AUX in the CPU. The current Linux driver is not perfect, but can be called through the PIGPO library. As shown below:
In this case, the SPI0, I2C1 and UART0 are drawn to the needle, and the MAX7219 is controlled using SPI1, and using GPIO as a soft selection. Other functions are allocated to the GPIO according to the wiring.
Second, hardware design and production
After the demand analysis is completed, hardware design is started, and the rabbit uses the Cadence 16.6 tool. The schematic tool is Orcad Capture CIS, the PCB tool is Allegro PCB Editor.
The first is IDPROM, connecting an EEPROM with the I2C0 of the Raspberry Pist. This part of the circuit is reserved, and does not install it when actually produced (the actual non-welded device is represented by NC).
User LED uses GPIO perfusion current control, when IO is low, LED lights.
The button portion is implemented by the GPIO to detect the left level, the button is high, and the power is high, and the low level is pressed. The hardware is not shaken here, requiring software implementation.
The infrared transmit tube requires a large current, so it is driven through an GPIO to control the NPN triode to drive infrared LEDs, and the infrared pipe is turned on at high levels. You can use only one LED to enhance the infrared signal using two LEDs.
Infrared reception adopts an integrated receiving head HS0038, it can be operated at 3.3V voltages, using a GPIO to receive infrared signals.
The active buzzer also requires a large current, and the triode drive is used as the infrared tube, and the GPIO high-speed buzzer sounds.
The digital display uses two 4-digit 7-segment digital tube (total cathode, counting the decimal point is actually 8), and drives through the MAX7219 chip. The MAX7219 provides up to 8-segment 8-digit display, where the MAX7219's segment code A to DP simultaneously connects two digital tubes simultaneously, used to display the content of each bit. The digital selection signal of the MAX7219 is connected to each of the two digital tubes.
Open source development board recommended:
ATOM E3825 Development Board is compact, affordable development board with a 64-bit Intel Ato E38xx series.
A high-performance parallel processing application developed by the P1601-DK02 development board and excellent performance and excellent performance and make full use of onboard EPIPHANY chips.
Intel Galileo Development Board A microcontroller board based on an Intel® Quark SoC X1000 application processor.
The MAX7219 is connected to the Raspberry Party via the SPI. Dout may not be connected because it only needs to be controlled without reading information. The chip is powered by 5V. Strict SPI should use 5V level, and the 3.3V level of the Raspberry Pist can also be controlled normally, but it is recommended to set the level conversion circuit.
Finally, the interface extension pin is extended, and the series of 100 ohm resistors is currently limited. Each interface provides 3.3V power and GND, respectively.
ICA HAT's PCB uses a cheap dual panel (10 pieces of PCB only need 50RMB), and it is necessary to explain the layout.
According to the usual user's usage habits, the digital tube is placed on the upper portion of the board (the most eye-catching position), the button is placed on the lower right corner of the board (the friend who is usually used can be placed on the left). The infrared transceiver part and the IO interface are neatly arranged on the surrounding plates to prevent blocking and convenient wiring. Other LEDs and buzzers are placed in the middle of the board.
Designed PCB files can be exported into light-making (Drill) documents to provide PCB manufacturers, and domestic manufacturers generally receive engineering documents in Altium Designer and Protel format, but actually turned into light Production. Vendors will provide free tests to ensure that circuits do not have short circuits, and the figure below shows the production of PCB:
After the PCB production is the device patch welding. If it is a machine welding, it is necessary to provide a Solder Mask file for steel network, and an assembly layer (Assembly) file for machine patches.
Here, due to small amounts of devices, the rabbit is manually welded. When welding, it is possible to warm the large-pin-intensive patch IC, and then weld the highly low patch devices, and finally welded higher inserts. Connectors and digital tubes can be welded. The picture below shows the circuit board whose manual welding is completed, we call PCBA:
It should be noted that the test circuitry is required after the welding is completed, especially the short circuit of the power supply, and then power it up. Otherwise, it is possible to burn the HAT board, but it is possible to damage the Raspberry Panel.
Open source development board recommended:
ATOM E3825 Development Board is compact, affordable development board with a 64-bit Intel Ato E38xx series.
A high-performance parallel processing application developed by the P1601-DK02 development board and excellent performance and excellent performance and make full use of onboard EPIPHANY chips.
Intel Galileo Development Board A microcontroller board based on an Intel® Quark SoC X1000 application processor.
Related Reading:
Another piece of open source hardware board with shoulder berry pie - banana party BPI-M1 +
Front and reunion of the open source hardware Arduino, 1 | Is it fighting? That is destined to be abandoned
Total total of the Raspberry Party 3 | Tube, it is too competitive, in fact, I have won.
Total Total Total 2 | The world is so big, but the Raspberry Party is in a gameplay
Is the RASPBERRY PI? BBC micro: Bit final design
Our other product: