Wireless remote control system for tower crane based on MSP430 and nRF905 (4)
source: "Electrical Engineering" Author: Yang Peng time: 2012-04-12
The 3.1 transmitter software
The transmitter is just electrified, complete the initialization mainly includes: I/O port initialization, wireless chip configuration, open the timer and I/O interrupt enable. The rest of the main function in the timer interrupt and I/O interrupt service subroutine. The main function of the interrupt service subroutine for: the button state, button to send the state code, code status. MSP430 microcontroller and nRF905 through the SP I port communication process is as follows:
(1) the microcontroller through SP I interface for data to be transmitted, the receiver's address and the time sequence data to be transmitted is sent to nRF905;
(2) the TRX microcontroller _CE and TX high _ EN, ShockBurstTM transmission mode excitation nRF905;
(3) nRF905 by sending an ShockBurstTM: radio frequency register automatically open; the data package (plus prefix and CRC check code); ¢Û transmits the data packet; when data transmission is completed, the data ready pin is set high.
(4) AUTO_RETRAN is set high, nRF905 repeat, until the TRX_CE is set low;
(5) when TRX_CE is set low, the process of sending nRF905, automatically enter standby mode.
Emitter flow diagram, as shown in figure 3.