Platform: iTOP-4412 development board
Implementation: Relay module test routine
Relay's C test program, C test program can be used on Android system, Qt system and minimal
It runs on the linux system. The document takes the test on the Android system as an example. The C test source code provided is "relay.c" and the compiled program "relay". The schematic diagram of the relay module is shown in the figure below. By controlling the level of the network XispSPIMISO, the relay is turned on and off. The elite version baseboard corresponds to the pin 10 of the expansion terminal J38 (the terminal is printed with "GPIO", next to the terminal of the audio interface), and the all-round board baseboard corresponds to the pin 10 of the expansion terminal J10 (the terminal is printed with "GPIO", next to the terminal of the buzzer and independent button).
Elite Edition hardware connection, as shown in the figure below, use the cable to connect the development board and relay module, connect the
"GPIO" port.
Next, compile the test program. As shown below, compile the relay.c test program. In the Ubuntu system, enter the compile command
"arm-none-linux-gnueabi-gcc -o relay relay.c -static" generates the relay executable program. The compiler used is "arm-2009q3". For details, please refer to Section 8.1 of the User Manual.
Upload the executable program relay to the development board's "/data" through adb. In the cmd command line, enter adb up
The command for transferring files is "adb push relay /data", as shown in the figure below. For details on adb file upload, please refer to Section 8.1 of the User Manual.
Modify the permissions of the test program. In the HyperTerminal, enter the command "cd /data" and enter the command to modify permissions.
"chmod 777 relay", as shown in the figure below.
In the HyperTerminal, enter the command "./relay 1" to run the program. As shown in the figure below, the terminal prints "tl sucess", which means
The program runs successfully. At this time, the network XispSPIMISO outputs a high level, the relay is turned on, and a crisp sound of the relay can be heard. The multimeter measures that the relay pins 2 and 5 are conducting, and the pin-A of the terminal J1 on the relay module outputs a 5V voltage.
In the HyperTerminal, enter the command "./relay 0" to run the program. The terminal prints "tl sucess".
XispSPIMISO outputs a low level, the relay is closed, and a crisp sound can be heard from the relay. The multimeter measures that relay pins 3 and 5 are conductive, and pin-B of terminal J3 on the relay module outputs a 5V voltage.
If you want to output other voltages (not 5V), you can remove the R3 resistor and change the voltage to be controlled from "COM"
Pin input is OK.
Previous article:Xunwei 4412 development board practical intelligent gateway project
Next article:iTOP-4412 development board-practical tutorial-ssh server ported to arm development board
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Talk about the "obstacles" on the road to power supply upgrade
- How to do switch detection in TWS headset design
- FAQ|Littelfuse Live: How to improve the safety and reliability of smart building electronic equipment in the era of the Internet of Things
- Has anyone used ST's vl53l0x laser distance sensor?
- Simple use of window function in Matlab
- I want a vhdl written eeprom read and write function, power failure data will not be lost
- How to measure the output ripple of a single-phase inverter with an oscilloscope
- No color difference splicing screen
- Analysis of optimization methods for overcrowded solder joints in PCB design
- FPGA design clean code is a core skill for programmers