1142 NEC Datfasheet
1142 NEC Datfasheet
com
Document: Datasheet
Date: 22-Mar-11
Model #: 1142-NEC
tyop
Features
Simple serial data output TTL level output compatible with any microcontrollers pins directly Decodes any NEC type remote control
Specification
Parameter Working Voltage Current Serial UART Interface Board Dimensions Value 5V DC 10mA 9600 bps, 8 bit data, no parity, 1 stop bit at 5V (For 3V systems insert a 1K resistor in series to TXD to drop the voltage at 3V) 36 mm x 15 mm
Block Diagram
ST3679 needs only one component to work that is IR receiver like TSOP1738 or similar. The data is output as simple 2 bytes of serial data consisting of 16 bits of information for each key press on the remote.
Board Schematic
U1 TSOP1738
GND VCC
IR
+5V U3 ST3679 1 2 3 4 TXD VDD IR TXD N/C 8 GND 7 DAT 6 +5V CLK 5 +5V RDY 9600 bps serial data CN1 JST3 3 2 1
3 2 C2 100nF
+
S
Sunrom Technologies
Title Remote Code Receiver Code 1142-NEC Date: Wednesday, December 29, 2010
http://www.sunrom.com
Sheet 1 Rev of 1 1
Sunrom Technologies
Visit us at www.sunrom.com
A7-A0 = NEC address of remote control. This is also called custom code or device address. D7-D0 = NEC command for each keypress at remote control. If you get output as 0x0000 means its a Repeat command since user has kept key pressed. Example For example pressing Key 1 on remote control can output 0x0301 where 0x03 is high byte and 0x01 is low byte. Here 0x03 is address or custom code for the transmitter which remains same for all key press. The data command will change on each key press. Special case of data is repeat command if a key is kept press. It will be output as 0x0000. If we interpret, in terms of NEC data we get below High: 0x03 in binary is
Bit -> Data-> 15 0 A7 14 0 A6 13 1 A5 12 1 A4 11 0 A3 10 0 A2 9 1 A1 8 1 A0
Important: If you keep any key pressed, you will get 0x0000 which means repeat code. This is part of NEC format when user keeps key pressed, it send repeat command and not the whole data packet. Only on first key press you get actual data, then if key is kept press you get repeat code which is 0x0000. If you leave Key1 and then press again, full value of data/address will be visible. Therefore this data of repeat packet tells you if user is keeping the key press or left the key once and pressed again. This is particular useful if you are implementing Toggle output like Relay ON and OFF logic.
Sunrom Technologies
Visit us at www.sunrom.com
The above values in serial data are ASCII characters. You can convert the value to binary to use in your program by deducting 0x30 from ASCII value. Our sample code given on next page uses this technique to convert this ASCII buffer of four digit to single integer of NEC data variable containing 16 bits.
Sunrom Technologies
Visit us at www.sunrom.com
http://www.sunrom.com/p-245.html
RS232 INTERFACING
VCC
USB INTERFACING
It will appear as virtual serial port on PC to which you can communicate through any software which can transmit receive by this serial port like hyperterminal or custom made software.
3 2 1
15
GND
To get +5V power for Decoder from USB port, solder +5V wire of RF module to +ve pin of this capacitor.
http://www.sunrom.com/p-244.html
Sunrom Technologies
Visit us at www.sunrom.com
IR
+5V U5 ST3679 1 2 3 4 TXD VDD IR TXD N/C 8 GND 7 DAT 6 +5V CLK 5 RDY 9600 bps serial data
21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 29 30
GND VCC
C3 100nF
P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P2.5/A13 P2.6/A14 P2.7/A15 P3.0/RXD P3.1/TXD P3.2/INT0 P3.3/INT1 P3.4/T0 P3.5/T1 P3.6/WR P3.7/RD
3 2
CN1 PBT3 5 3 4
18
19 Y1 11.0592
VCC
40
100n
C8 33p
C7 33p
Sunrom Technologies
20
Visit us at www.sunrom.com
When a key is pressed on the remote controller, the message transmitted consists of the following, in order: a 9ms leading pulse burst (16 times the pulse burst length used for a logical data bit) a 4.5ms space the 8-bit address for the receiving device the 8-bit logical inverse of the address the 8-bit command the 8-bit logical inverse of the command a final 562.5s pulse burst to signify the end of message transmission. The four bytes of data bits are each sent least significant bit first. Figure 1 illustrates the format of an NEC IR transmission frame, for an address of 00h(00000000b) and a command of ADh (10101101b). Example message frame using the NEC IR transmission protocol.
Notice from Figure 1 that it takes: 27ms to transmit both the 16 bits for the address (address + inverse) and the 16 bits for the command (command + inverse). This comes from each of the 16 bit blocks ultimately containing eight '0's and eight '1's - giving (8 * 1.125ms) + (8 * 2.25ms). 67.5ms to fully transmit the message frame (discounting the final 562.5s pulse burst that signifies the end of message).
Repeat Codes If the key on the remote controller is kept depressed, a repeat code will be issued, typically around 40ms after the pulse burst that signified the end of the message. A repeat code will continue to be sent out at 108ms intervals, until the key is finally released. The repeat code consists of the following, in order:
Sunrom Technologies
Visit us at www.sunrom.com
a 9ms leading pulse burst a 2.25ms space a 562.5s pulse burst to mark the end of the space (and hence end of the transmitted repeat code).
Figure illustrates the transmission of two repeat codes after an initial message frame is sent.
Screenshot of actual capture from NEC transmitted data, using Sunroms IR Protocol Analyzer
Sunrom Technologies
Visit us at www.sunrom.com