AN236. X-10 Home Automation Using the PIC16F877A HARDWARE OVERVIEW INTRODUCTION TEST SETUP WHEN USING DEVELOPMENT TOOLS. Microchip Technology Inc.
|
|
|
- Clemence Flowers
- 9 years ago
- Views:
Transcription
1 X-10 Home Automation Using the PIC16F877A Author: INTRODUCTION Jon Burroughs Microchip Technology Inc. X-10 is a communication protocol designed for sending signals over 120 VAC wiring. X-10 uses 120 khz bursts timed with the power line zero-crossings to represent digital information. Plug-in modules available from various vendors enable users to create home automation systems by using the AC wiring already installed within a home. Readers who would like an overview of the X-10 signal format may refer to Appendix A. PICmicro microcontrollers can easily be used in conjunction with X-10 technology to create home automation applications. The specific PICmicro microcontroller (MCU) used should be selected based on RAM, ROM, operating frequency, peripheral, and cost requirements of the particular application. The PIC16F877A was selected for this application because of its versatility as a general purpose microcontroller, its FLASH program memory (for ease of development), data EEPROM, and ample I/O. This application note discusses the implementation of X-10 on a PICmicro MCU to create a home controller that can both send and receive X-10 signals. The reader may implement the home controller as is, or adapt the circuits and firmware to other applications. A library of X-10 functions is provided to facilitate development of other X-10 applications using PICmicro MCUs (see Appendix E). Operating instructions for the home controller are included in Appendix B. HARDWARE OVERVIEW The home controller application described in this application note allows the user to program on and off times for up to sixteen devices, using a 2 x 16 liquid crystal display and five push buttons. A built-in light sensor can be used to turn on lights at dusk, and turn them off at dawn. The home controller is designed to facilitate experimentation with home automation using the PIC16F877A. In addition to the PIC16F877A, the board will accept any other PICmicro MCU that shares the same pinout, such as the PIC18F452. Therefore, experimenters may expand on the application using the higher performance of the PIC18 family of parts without changing the hardware. With care, engineers and home control enthusiasts can experiment with home automation using the MPLAB ICD and MPLAB ICD 2 development tools or in-circuit emulator. However, proper circuit isolation precautions must be taken to avoid damage to your computer or development tools. See Figure 1 and the warning note! WARNING: VSS or ground on the application circuit is tied to neutral of the 120 VAC. To safely connect your development tools or computer to the home controller, you must power it through an isolation transformer and leave wall ground (the green wire in most cases) disconnected. Any test instruments (such as an oscilloscope) that you hook up to the application circuit, should be powered through the isolation transformer as well, with wall ground disconnected. In addition, the entire circuit should be enclosed within a suitable case to prevent unintentional contact with the mains voltage! FIGURE 1: TEST SETUP WHEN USING DEVELOPMENT TOOLS Computer, development tools, and the isolation transformer should be plugged into the wall outlet. Isolation Transformer X-10 Board X-10 Lamp Module Oscilloscope X-10 Lamp Module X-10 modules and any test instruments should be plugged into the isolation transformer. To maintain isolation, leave ground disconnected Microchip Technology Inc. DS00236A-page 1
2 HARDWARE DESCRIPTION An overview of the home controller application hardware is shown in Figure 2. The hardware functionality of X-10 circuitry can be divided into four functional blocks: Zero-crossing detector 120 khz carrier detector 120 khz signal generator Transformerless power supply There are several application functions that are not directly associated with the X-10 interface. User interface functions are accomplished with an LCD display and five push buttons. A real-time clock is created using Timer1 and an external 32 khz oscillator. User modified control data, such as unit on and off times, are stored in the PICmicro MCU s built-in EEPROM. A light sensor and load switch are also used in this application. FIGURE 2: APPLICATION BLOCK DIAGRAM X-10 FUNCTIONS Zero-crossing Detector APPLICATION SPECIFIC FUNCTIONS Light Sensor Load Switch 120 khz Carrier Detector Real-time Clock Control Data Storage 120 khz Carrier Generator USER INTERFACE LCD Key Switches TRANSFORMERLESS POWER SUPPLY DS00236A-page Microchip Technology Inc.
3 A summary of resource use can be seen in Table 1. Details of the functional sections are discussed below. TABLE 1: SUMMARY OF MICROCONTROLLER RESOURCE USE Resource Function Description External interrupt on RB0 Zero-crossing Detect Generates one interrupt every zero-crossing. CCP1/Timer2 in PWM mode Timer2 interrupt through postscaler 120 khz Modulation TRISC is used to enable/disable 120 khz output. Main oscillator is MHz. Triac Dimmer Timing Generates dimmer timing increments for controlling Triac. Timer1 interrupt Real-time Clock Used as time keeping clock and key scan clock. One interrupt/25 ms, 40 interrupts/1 sec. Timer0 interrupt 120 khz Envelope Timing Times duration of 1 ms bursts and onset of second and third phase bursts. ADC Light Sensor Used to detect dawn and dusk. PORTB<1:5> Key Press Inputs Five push buttons are used for menu navigation. PORTB<6:7> Reserved for ICD Isolation precautions required. See warning note! PORTD<0:7> LCD Data pins 8 data lines for LCD. PORTE<0:2> LCD Control pins 3 control lines for LCD. DATA EEPROM Non-volatile Control Data Storage Stores on and off times and other user programmable information. Zero-Crossing Detector In X-10, information is timed with the zero-crossings of the AC power. A zero-crossing detector is easily created by using the external interrupt on the RB0 pin and just one external component, a resistor, to limit the current into the PICmicro MCU (see Figure 3). In the United States, Vrms = 117 VAC, and the peak line voltage is 165V. If we select a resistor of 5 MΩ, Ipeak = 165V/5 MΩ =33µA, which is well within the current capacity of a PICmicro MCU I/O pin. Input protection diodes (designed into the PICmicro MCU I/O pins) clamp any voltage higher than VDD or lower than VSS. Therefore, when the AC voltage is in the negative half of its cycle, the RB0 pin will be clamped to VSS - 0.6V. This will be interpreted as a logic zero. When the AC voltage rises above the input threshold, the logical value will become a 1. In this application, RB0 is configured for external interrupts, and the input buffer is a Schmitt trigger. This makes the input threshold 0.8 VDD = 4V on a rising edge and 0.2 VDD = 1V on a falling edge. Upon each interrupt, the Interrupt Edge Select bit within the OPTION_REG register is toggled, so that an interrupt occurs on every zero-crossing. Using the following equation, it is possible to calculate when the pin state will change relative to the zero-crossing: V = Vpk*sin(2*π*f*t), where Vpk = 165V and f = 60 Hz On a rising edge, RB0 will go high about 64 µs after the zero-crossing, and on a falling edge, it will go low about 16 µs before the zero-crossing. More information on interfacing PICmicro MCUs to AC power lines can be found in the application note AN521, Interfacing to AC Power Lines, which is available for download from the Microchip web site. FIGURE 3: 120 VAC ZERO-CROSSING DETECTOR R = 5 MΩ PIC16F87XA RB0/INT 2002 Microchip Technology Inc. DS00236A-page 3
4 120 khz Carrier Detector To receive X-10 signals, it is necessary to detect the presence of the 120 khz signal on the AC power line. This is accomplished with a decoupling capacitor, a high-pass filter, a tuned amplifier, and an envelope detector. The components of the carrier detector are illustrated in Figure 4. Because the impedance of a capacitor is: Zc = 1/(2*π*f*C), a 0.1 µf capacitor presents a low impedance (13Ω) to the 120 khz carrier frequency, but a high impedance (26.5 kω) to the 60 Hz power line frequency. This high-pass filter allows the 120 khz signal to be safely coupled to the 60 Hz power line, and it doubles as the coupling stage of the 120 khz carrier generator described in the next section. Since the 120 khz carrier frequency is much higher than the 60 Hz power line frequency, it is straightforward to design an RC filter that will pass the 120 khz signal and completely attenuate the 60 Hz. A high-pass filter forms the first stage of the High-Pass Filter and Tuned Amplifier Block, shown on sheet 5 of the schematics in Appendix C. For a simple high-pass filter, the -3 db breakpoint is: ƒ3 db = 1/(2*π*R*C). For C = 150 pf and R = 33 kω, ƒ3 db = 1/(2*π*150 pf *33 kω) =32kHz. This ƒ3 db point assures that the 60 Hz signal is completely attenuated, while the 120 khz signal is passed through to the amplifier stages. Next, the 120 khz signal is amplified using a series of inverters configured as high gain amplifiers. The first two stages are tuned amplifiers with peak response at 120 khz. The next two stages provide additional amplification. The amplified 120 khz signal is passed through an envelope detector, formed with a diode, capacitor, and resistor. The envelope detector output is buffered through an inverter and presented to an input pin (RC3) of the PIC16F877A. Upon each zero-crossing interrupt, RC3 is simply checked within the 1 ms transmission envelope to see whether or not the carrier is present. The presence or absence of the carrier represents the stream of 1 s and 0 s that form the X-10 messages described in Appendix A. FIGURE 4: 120 khz CARRIER DETECTOR Decoupling Capacitor 0.1 µf X2 Rated 1 MΩ High-Pass Filter & Tuned Amplifier (1) +5 VDC 10K 10 nf Envelope Detector PIC16F87XA RC3 Note 1: See schematic in Appendix C. DS00236A-page Microchip Technology Inc.
5 120 khz Carrier Generator X-10 uses 120 khz modulation to transmit information over 60 Hz power lines. It is possible to generate the 120 khz carrier with an external oscillator circuit. A single I/O pin would be used to enable or disable the oscillator circuit output. However, an external oscillator circuit can be avoided by using one of the PICmicro MCU s CCP modules. The CCP1 module is used in PWM mode to produce a 120 khz square-wave with a duty cycle of 50%. Because X-10 specifies the carrier frequency at 120 khz (+/- 2 khz), the system oscillator is chosen to be MHz, in order for the CCP to generate precisely 120 khz. Calculations for setting the PWM period and duty cycle are shown in the code listing comments for the function InitPWM. After initialization, CCP1 is continuously enabled, and the TRISC bit for the pin is used to gate the PWM output. When the TRISC bit is set, the pin is an input and the 120 khz signal is not presented to the pin. When the TRISC bit is clear, the pin becomes an output and the 120 khz signal is coupled to the AC power line through a transistor amplifier and capacitor, as depicted in Figure 5. Since the impedance of a capacitor is Zc = 1/(2*π*f*C), a 0.1 µf capacitor presents a low impedance to the 120 khz carrier frequency, but a high impedance to the 60 Hz power line frequency. This high-pass filter allows the 120 khz signal to be safely coupled to the 60 Hz power line, and it doubles as the first stage of the 120 khz carrier detector, described in the previous section. To be compatible with other X-10 receivers, the maximum delay from the zero-crossing to the beginning of the X-10 envelope should be about 300 µs. Since the zero-crossing detector has a maximum delay of approximately 64 µs, the firmware must take less than 236 µs after detection of the zero-crossing to begin transmission of the 120 khz envelope. Transformerless Power Supply The PIC16F877A and other board circuits require a 5V supply. In this application, the X-10 controller must also transmit and receive its data over the AC line. Since X-10 components are intended to be plugged into a wall outlet and have a small form factor, a transformerless power supply is used. Two characteristics of transformerless supplies that should be kept in mind are limited current capacity, and lack of isolation from the AC mains (see the warning note)! WARNING: This circuit is not isolated from 120 VAC. Act with caution when constructing or using such a circuit, and ensure that it is contained within a suitable insulated enclosure. Follow isolation precautions to avoid personal injury or damage to test equipment and development tools. Figure 6 illustrates the transformerless power supply used in this application. To protect the circuit from spikes on the AC power line, a 130V VDR (voltage dependent resistor) is connected between Line and Neutral. A Positive Temperature Coefficient (PTC) device acts as a resettable fuse, which limits current between Ground and Neutral. The 47Ω resistor limits current into the circuit, and the 1 MΩ resistor provides a discharge path for the voltage left on the capacitor when the circuit is unplugged from the wall. Two diodes rectify the voltage across the 1000 µf capacitor and 5.1V Zener diode to produce a 5V supply. The reader may wish to refer to the technical brief TB008, Transformerless Power Supply, available for download from the Microchip web site, for additional information on transformerless power supply design. FIGURE 5: 120 khz CARRIER GENERATOR +5 VDC High-Pass Filter PIC16F87XA OSC2 RC3/CCP OSC1 50Ω 0.1 µf X2 Rated 120 VAC MHz 200Ω 1 MΩ 2002 Microchip Technology Inc. DS00236A-page 5
6 FIGURE 6: TRANSFORMERLESS POWER SUPPLY VDR N L 2.25 µf 1N VDC PTC G 2.25 µf 1.1M 1N µf 5.1V Zener Load Switch A load switch is included on the home controller so that it may act as a lamp module, with its own house and unit address. A Triac was selected as the load switch, because its medium power switching capacity and rapid switching capability make it well-suited for lamp control and dimming. A Triac is an inexpensive, three-terminal device that basically acts as a high speed, bi-directional AC switch. Two terminals, MT1 and MT2, are wired in series with the load. A small trigger current between the gate and MT1 allow conduction to occur between MT1 and MT2. Current continues to flow after the gate current is removed, as long as the load current exceeds the latching value. Because of this, the Triac will automatically switch off near each zero-crossing as the AC voltage falls below the latching voltage. A Teccor L4008L6 Triac was selected because it has a sensitive gate that can be directly controlled from the logic level output of the PICmicro MCU I/O pin. The sensitive gate Triac can control AC current in both directions through the device, even though the PICmicro MCU can provide only positive voltages to the gate. A variable dimmer is created by including a delay between the time of each zero-crossing and the time that the trigger current is provided to the Triac from the PICmicro MCU. The design and control of a lamp dimmer using a PICmicro MCU is discussed in detail in PICREF-4 Reference Design, PICDIM Lamp Dimmer for the PIC12C508. FIGURE 7: LOAD SWITCH/DIMMER (TRIAC) PIC16F87XA L4008L6 Return Hot MT1 120 VAC In VSS RA5 470Ω 1N4148 Gate MT2 120 VAC Out DS00236A-page Microchip Technology Inc.
7 LCD Module The 2-line x 16-character display uses the HD44780U Display Controller. Eight data lines and three control lines are used to interface to the PICmicro MCU. If fewer I/O pins are available, the LCD can be operated in Nibble mode using only four data lines, with some additional software overhead. A basic LCD library is included in this application, which provides the necessary functions for controlling this type of LCD. Real-Time Clock A real-time clock is implemented using Timer1. The real-time clock keeps track of the present time using a routine called UpdateClock. It also determines the rate that the buttons are read by a routine called ScanKeys. Timer1 is set to cause an interrupt each time it overflows. By adding a specific offset to Timer1 each time it overflows, the time before the next overflow can be precisely controlled. The button reading routine, ScanKeys, is called each time a Timer1 interrupt occurs. Since ScanKeys performs debouncing of the button presses, a suitable rate to check the buttons is once every 25 ms. With a 32 khz crystal, the counter increments once every µs when the prescaler is set to 1:1. In order for Timer1 to generate an interrupt once every 25 ms, TMR1H:TMR1L are pre-loaded with 0xFCE0h. The Timer1 interrupt interval, or tick, can be seen in the following equation: (FFFFh FCE0h)*1/32 khz =.025 s = 1 tick Each time ScanKeys is called (every 25 ms), it calls UpdateClock. UpdateClock keeps track of the time unit variables: ticks, seconds, minutes, and hours. Since every 25 ms equals one tick, seconds are incremented every 40 ticks. Minutes and hours are incremented in a similar fashion. development tool, without taking first isolating the entire application from wall power (see the previous warning notes)! Control Data Storage Certain control data that is programmable by the user must be stored in non-volatile memory. The PICmicro MCU s built-in EEPROM is well-suited to this task. To use EEPROM memory space most efficiently (by avoiding wasted bits), on/off times and light sensor control flags are stored using the format shown in Figure 8. Figure 9 shows the location of on/off times and other information within the data EEPROM. Using this data organization, only 48 bytes of EEPROM are required to store the on/off times and light sensor control flags for 16 units. FIGURE 8: 4 bits 4 bits EEHours On Hour Off Hour bits EEOnMinutes A B OnMin bits EEOffMinutes C D Off Min FIGURE 9: 0x001 0x002 0x010 0x011 0x012 ON/OFF TIME STORAGE EEPROM DATA Address Unit Data 0x020 0x021 0x022 System System Unit 1 Unit 2 Unit 3 Unit 1 Unit 2 Unit 3 A = AM/PM bit for On Hour B = Control bit for On at Dusk C = AM/PM bit for Off Hour D = Control bit for Off at Dawn House Address Unit Address OnHour OnHour OnHour A B A B A B OffHour OffHour OffHour OnMin OnMin OnMin Push Buttons Five push buttons, connected to RB1-RB5, are used for user interaction with the application. Each normally open push button will pull a port pin low when it is pressed. 0x030 0x031 0x032 Unit 1 Unit 2 Unit 3 A B A B A B OffMin OffMin OffMin Light Sensor To detect the ambient light level, a CdS photoresistor is used in conjunction with an 820Ω resistor to create a voltage divider. The voltage on the divider varies with the intensity of ambient light and is connected to an analog channel (AN0) of the microcontroller. In-Circuit Debugger RB6 and RB7 have been reserved for In-Circuit Serial Programming TM (ICSP TM ) and the in-circuit debugger (ICD). However, do not connect the ICD or any other Each time that minutes are incremented within the UpdateClock routine, a flag is set that enables a routine called CheckOnOffTimes to be called from the main loop. CheckOnOffTimes compares the present time with the unit on and off times stored in EEPROM memory. If there is a match, then a flag is set to either turn the unit on or off, by sending it the appropriate X-10 command when the routine ControlX10Units is called Microchip Technology Inc. DS00236A-page 7
8 APPLICATION FIRMWARE OVERVIEW The firmware is divided into several different files to facilitate adaptation of the code to other applications. Following is a summary of the files associated with this application note: x10lib.asm Defines X-10 functions. x10lib.inc Defines X-10 constants and macros. x10hc.asm Main application code for the home controller. x10demo.asm Example code that shows how to use the X-10 library macros. lcd.asm Defines the routines necessary for driving the LCD. p16f877a.lkr Standard linker file for PIC16F877A parts. p16f877a.inc Standard include file for PIC16F877A parts. Detailed descriptions of operation can be found in the comments within the code listing. The X-10 library functions and macros are described in the next section. X-10 LIBRARY A simple library of commands was developed and used for the home controller. It can be used with little or no modification in a user s application. The library consists of two files: x10lib.asm and x10lib.inc. To use the library, a user need only understand the function of the macros defined in x10lib.inc. The macros greatly simplify the use of the library by eliminating the need for the user to understand every X-10 function in x10lib.asm. Examples of how the macros are used are included in the file x10demo.asm. The macros are explained below: InitX10 This macro is used to initialize the peripherals that provide X-10 functionality. It must be called in the application program before any of the below macros will work. It is used as follows: InitX10 SkipIfTxReady Before sending an X-10 message, it is necessary to make sure that another message is not already being sent, which is signified by the X10TxFlag being set. This macro simply checks that flag and skips the next instruction if it is okay to begin a new transmission. Otherwise, there is a chance that a new transmission will interrupt an ongoing transmission. It is used as follows: SkipIfTxDone GOTO $-1 ;loop until ready to ;transmit next message SendX10Address (House, Unit) This macro is used to send an X-10 address for a particular unit. It requires two arguments, a house address and unit address. The definitions for all house and unit addresses are defined in x10lib.inc. To use this macro to send the address for unit 16 at house P, one simply types: SendX10Address HouseP, Unit16 SendX10AddressVar This macro is used to send an X-10 address, defined by variables rather than constants. To send an address contained in the user variables MyHouse and MyUnit, the following sequence would be applied: MOVF MyHouse, W ;contains a value ;from 0-16 MOVWF TxHouse MOVF MyUnit, W ;contains a value ;from 0-16 MOVWF TxUnit SendX10AddressVar DS00236A-page Microchip Technology Inc.
9 SendX10Command (House, Function) This macro is used to send an X-10 command. It requires two arguments, the house address and function code. The definitions for all house addresses and function codes are defined in x10lib.inc. To use this macro to send the command All Lights On to all units at house A, one types: SendX10Command HouseA, AllLightsOn SendX10CommandVar This macro is used to send an X-10 command, defined by a variable rather than a constant. To use this macro to send the command stored in the user variable MyCommand to all units at MyHouse, one types: MOVF MyHouse, W ;contains a value ;from 0-16 MOVWF TxHouse MOVF MyCommand, W ;any X-10 ;function ;defined in ;x10lib.inc MOVWF TxFunction SendX10CommandVar SkipIfRxDone Before reading an X-10 message, it is necessary to make sure that a complete message has been received. This is signified by the X10RxFlag being set. This macro simply checks that flag and skips the next instruction if a new X-10 message has been received. It is used as follows: SkipIfRxDone GOTO $-1 ;loop until message ;received SkipIfAddressRcvd It may be necessary to make sure that an address was received by using this macro, which checks to see if the RxCommandFlag is clear. It is used as follows: SkipIfAddressRcvd GOTO $-1 ;loop until address ;received SkipIfCommandRcvd Or, it may be necessary to make sure that a command was received by using this macro, which checks to see if the RxCommandFlag is set. It is used as follows: SkipIfCommandRcvd GOTO $-1 ;loop until command ;received ReadX10Message This macro is called to read a received X-10 message, which may be either an address or a command. If the message was an address, then the received house and unit codes will be stored in the variables RxHouse and RxUnit, respectively. If the message was a command, then the received house address and function code will be stored in the variables RxHouse and RxFunction. It is simply called as follows: ReadX10Message Please refer to the example code in x10demo.asm to see how each of these macros is used in a simple application Microchip Technology Inc. DS00236A-page 9
10 Memory Usage Memory usage for the X-10 portion of the application is summarized in Table 2. TABLE 2: SUMMARY OF MEMORY USAGE FOR X-10 FUNCTIONALITY Memory Type Used Available on PIC16F877A Percent Used FLASH Program Memory 437 words 8453 words 5% Data Memory (RAM) 62 bytes 368 bytes 17% EEPROM Data Memory 0 bytes 256 bytes 0% Memory usage for the entire home controller application is summarized in Table 3. TABLE 3: SUMMARY OF MEMORY USAGE FOR THE HOME CONTROLLER Memory Type Used Available on PIC16F877A Percent Used FLASH Program Memory 3762 words 8453 words 44.5% Data Memory (RAM) 168 bytes 368 bytes 45.6% EEPROM Data Memory 51 bytes 256 bytes 20% DS00236A-page Microchip Technology Inc.
11 CONCLUSION The PICmicro MCU is well-suited to X-10 applications. With its plethora of on-chip peripherals and a few external components, a PICmicro MCU can be used to implement an X-10 system that can transmit and receive messages over the AC power line wiring. The small code size of the X-10 library leaves ample space for the user to create application specific code. PICmicro MCUs, such as the PIC16F877A, have plenty of additional resources for creating more complex X-10 applications, while smaller PICmicro MCUs can be selected for economical use in simpler X-10 applications. USEFUL WEB REFERENCES This web site describes how to build an appliance module that utilizes the PIC16C52 or PIC16F84. Parts of this project s receiver circuit, designed by Phil Plunkett, were adapted to the home controller application. The Microchip web site features data sheets, product information, and more. Helpful technical documentation available here include: AN521 Interfacing to AC Power Lines TB008 Transformerless Power Supply PICREF-4 PICDIM Lamp Dimmer for the PIC12C508 The X10 Wireless Technology, Inc. TM web site features technical information and FAQs pertaining to the X-10 communication protocol Microchip Technology Inc. DS00236A-page 11
12 APPENDIX A: HOW DOES THE X-10 PROTOCOL WORK? X-10 transmissions are synchronized with the zero-crossings on the AC power line. By monitoring for the zero-crossings, X-10 devices know when to transmit or receive X-10 information. A binary 1 is represented by a 1 ms long burst of 120 khz, near the zero-crossing point of the AC. A binary zero is represented by the lack of the 120 khz burst. FIGURE A-1: X-10 TRANSMISSION TIMING (1) (1) 120 khz 60 Hz 1 ms ms ms ms (1) (1) Note 1: These 120 khz carrier bursts are timed to coincide with the zero-crossing of the other phases, when implemented. A complete X-10 message is composed of a start code (1110), followed by a house code, followed by a key code. The key code may be either a unit address or a function code, depending on whether the message is an address or a command. Table A-1 and Table A-2 show the possible values of the house and key codes. DS00236A-page Microchip Technology Inc.
13 TABLE A-1: House Addresses TABLE A-2: Function Codes HOUSE CODES House Codes H1 H2 H4 H8 A B C D E F G H I J K L M N O P KEY CODES Key Codes Unit Addresses D1 D2 D4 D8 D All Units Off All Units On On Off Dim Bright All Lights Off Extended Code Hail Request Hail Acknowledge Pre-set Dim X 1 Extended Code (Analog) Status = On Status = Off Status Request When transmitting the codes in Table A-1 and Table A-2, two zero-crossings are used to transmit each bit as complementary bit pairs (i.e., a zero is represented by 0-1, and a one is represented by 1-0). For example, in order to send the house code A, the four-bit code in Table A-1 is 0110, and the code transmitted as complimentary bit pairs is Since house and key codes are sent using the complimentary format, the start code is the only place where the pattern 1110 will appear in an X-10 data stream. The key code, which is 5-bits long in Table A-2, takes 10 bits to represent in the complimentary format. Because the last bit of the key code is always zero for a unit address and one for a function code, the last bit of the key code can be treated as a suffix that denotes whether the key code is a unit address or function code. A complete block of data consists of the start code, house code, key code and suffix. Each data block is sent twice, with 3 power line cycles, or six zero-crossings, between each pair of data blocks. For example, to turn on an X-10 module assigned to house code A, unit 2, the following data stream would be sent on the power line, one bit per zero-crossing. First, send the address twice: START HOUSE A UNIT 2 Suffix START HOUSE A UNIT 2 Suffix Next, wait for three cycles (six zero-crossings): Then, send the command twice: START HOUSE A ON Suffix START HOUSE A ON Suffix Lastly, wait for three cycles (six zero-crossings) before sending the next block: There are exceptions to this format. For example, the bright and dim codes do not require the 3-cycle wait between consecutive dim commands or consecutive bright commands. For a complete discussion of all X-10 messages, please refer to the X10 Wireless Technology, Inc. web site (see the "USEFUL WEB REFERENCES" section) Microchip Technology Inc. DS00236A-page 13
14 APPENDIX B: Welcome Screen HOME CONTROLLER OPERATING INSTRUCTIONS The home controller user interface consists of five buttons and a 2 x 16 LCD. Upon power-up, the Welcome screen is displayed. This screen displays a welcome message and the time. Immediately, the seconds begin incrementing and the PICmicro MCU begins keeping track of the time. Figure B-1 shows the Welcome screen and the location and functionality of each button. Depending on the screen viewed, each of the five buttons performs a different function. When the Welcome screen is displayed, the buttons enable access to the following functions: Press menu to enter the Select Function screen. Press up to brighten the lamp that is plugged into the home controller. Press down to dim the lamp. Press enter to turn the lamp on. Press exit to turn the lamp off. FIGURE B-1: WELCOME SCREEN Welcome Home 12:00:00 AM menu Select Function Screen up down enter exit When viewing the Welcome screen, the menu button enables access to the Select Function screen. Each successive press of the menu button cycles through the four main functions of the user interface: setting the system time, setting the system address, setting the light sensor, or programming the unit on and off times, as illustrated in Figure B-2. FIGURE B-2: Select Function Set System Time Select Function Program Unit SELECT FUNCTION SCREENS Set System Time Screen Use the Set System Time screen to set the time. SETTING SYSTEM TIME 1. Starting from the Welcome screen, press menu until the Set System Time screen is displayed and press enter. 2. Press up/down to set the hours. 3. Press enter when the correct hour, including AM or PM, has been selected. 4. Repeat this process to set the minutes. 5. If the time is correct, select Y (the default) using the up/down buttons and press enter. This returns to the Welcome screen with the new time displayed. 6. If the time is not correct, select N and press enter. This will return the user to step 2 so the correct time can be entered. 7. Press exit at any time to return the user to the Welcome screen without saving the new time. FIGURE B-3: Set System Time 12:00 AM Set hrs menu Select Function Set System Addr Select Function Set Light Sensor SET SYSTEM TIME SCREENS up down enter exit 1 3 Set System Time 12:00 AM Set min Set System Time 12:00 AM Okay? Y 2 menu up down enter 3 exit DS00236A-page Microchip Technology Inc.
15 Select System Address Screen Use the Set System Address screen to set the house address and unit address of the home controller. SETTING HOUSE/UNIT ADDRESS 1. From the Welcome screen, press menu until the Set System Addr screen is displayed and press enter. 2. Press up or down to set the house address (a letter from A - P). 3. Press enter when the house address has been selected. 4. Repeat steps 2 and 3 to set the unit address (a number from 1-16). 5. If the house and unit addresses are correct, select Y (the default) using the up/down buttons and press enter. This returns to the Welcome screen with the new address stored in non-volatile memory. 6. If the address is not correct, select N and press enter. This will return the user to step Press exit at any time to return the user to the Welcome screen without saving the new address. FIGURE B-4: SET SYSTEM ADDRESS SCREENS Set System Addr A-01 Set House menu up down enter exit 1 Set System Addr A-01 Okay? Y menu up down enter 3 exit Set System Addr A-01 Set Unit 2 Set Light Sensor Screen Use the Set Light Sensor screen to select whether units turn on at dusk, or off at dawn. SETTING THE LIGHT SENSOR 1. From the Welcome screen, press menu until the Set Light Sensor screen is displayed and press enter. 2. Press up or down to select the desired unit. The house address will already be set to the system house address. 3. Press enter when the desired unit address has been selected. 4. Press up or down to select whether or not the unit should turn on at dusk, and press enter. 5. Repeat this process to set other units as desired. 6. Press exit to return to the Welcome screen. Pressing exit while the On at Dusk or Off at Dawn prompt is displayed will return the user to the Welcome screen without modifying that parameter. FIGURE B-5: SET LIGHT SENSOR SCREENS Set Light Sensor A-01 Set Unit menu up down enter exit 1 Set Light Sensor Off at Dawn? Y menu up down enter 3 exit Set Light Sensor On at Dusk? Y Microchip Technology Inc. DS00236A-page 15
16 Program Unit Screen Use the Program Unit screen to program on and off times for different units. PROGRAMMING UNIT ON AND OFF TIMES 1. From the Welcome screen, press menu repeatedly until the Program Unit screen is displayed and press enter. 2. Press up or down to select the desired unit. The house address will already be set to the system house address. 3. Press enter when the unit address has been selected. 4. Press up or down to set the on time hours. Hours set to 00 means that the unit will not be turned on at any time. 5. Press enter when the correct hour, including AM or PM, has been selected. 6. Repeat this process to set the on time minutes. If the hour has been set to 00, then the minutes will be set to 00 automatically. 7. If the time is correct, select Y (the default) using the up/down buttons and press enter. The user will be prompted to program the off time in a similar fashion. 8. If the time is not correct, select N and press enter. This allows the user to re-enter the hour and minutes by returning to step Repeat this process to set the on and off time for other units as desired. 10. Press exit to return to the Welcome screen. Pressing exit while the Set Hours or Set Min prompt is displayed will return the user to the Welcome screen without modifying any parameters. FIGURE B-6: PROGRAM UNIT ON TIME SCREENS N Program Unit A-01 Set Unit Program On-Time 00:00AM Set hrs Program On-Time 00:00AM Set min Program On-Time 00:00AM Okay? Y Y Program Off-Time 00:00AM Set hrs Program Off-Time 00:00AM Set min N Program Off-Time 00:00AM Okay? Y Y DS00236A-page Microchip Technology Inc.
17 APPENDIX C: X-10 SCHEMATICS FIGURE C-1: SHEET 1 OF 5 MCLR CDS TRIAC ZEROX UP DOWN MENU ENTER EXIT U1 RE2 RE1 RE0 RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 XIN XOUT 2002 Microchip Technology Inc. DS00236A-page 17
18 FIGURE C-2: SHEET 2 OF 5 MENU UP RE2 RE1 RE0 DOWN LCD1 CDS ENTER RD0 RD1 RD2 RD3 RD4 RD5 RD6 RD7 EXIT DS00236A-page Microchip Technology Inc.
19 FIGURE C-3: SHEET 3 OF 5 TRIAC XIOCIRCUITS +5V 2002 Microchip Technology Inc. DS00236A-page 19
20 FIGURE C-4: SHEET 4 OF 5 XIOCIRCUITS XOUT CARRIERDATA ZEROX DS00236A-page Microchip Technology Inc.
21 FIGURE C-5: SHEET 5 OF 5 CARRIERDATA XIN 2002 Microchip Technology Inc. DS00236A-page 21
22 APPENDIX D: PARTS LIST Count Reference Value Description 2 D7, D8 6.8V Zener Diode 2 D4, D5 1N4005 Diode 2 D3, D9 1N4148 Diode 1 D6 5.1V Zener Diode 1 Q2 2N2222 NPN Transistor 1 J2 Power In Connector 2 J1 Power Out Connector 1 U2 CD4069 HEX Inverters 8 C1, C2, C3, C8, C9, C10, C11, C µf Capacitor 4 C4, C5, C6, C7 15 pf Capacitor 1 C µf Capacitor 2 C14, C µf, 250V x2 Capacitor 2 C21, C nf Capacitor 2 C25, C nf Capacitor 1 C20 10 nf Capacitor 2 C23, C24 10 pf Capacitor 1 C pf Capacitor 2 C18, C pf Capacitor 1 C µf, 25V Capacitor 1 C µf, 275 VAC x2 Capacitor 1 Y MHz Crystal 1 Y1 32 khz Crystal 2 L1, L2 220 µh Axial Lead Inductor 1 LCD1 CG161 HD44780-based 2x16 Liquid Crystal Display 2 D1, D2 LTL-94PEKTA LEDs 1 U1 PIC16F877A Microcontroller 1 R6 20 kω Potentiometer 1 PTC1 CdS Cell 1 PTC2 Resettable PTC's Resistor 1 R18 1 MΩ Resistor 1 R MΩ Resistor 1 R13 2 MΩ Resistor 1 R17 5 MΩ Resistor 7 R1, R4, R5, R7, R8, R9, R21 10 kω Resistor 1 R22 33 kω Resistor 1 R25 47 kω Resistor 1 R19 50 kω Resistor 1 R kω Resistor 2 R15, R kω Resistor 1 R20 200Ω Resistor 1 R kω Resistor 2 R2, R3 680Ω Resistor 1 R10 820Ω Resistor 1 R11 470Ω Resistor 1 R kω Resistor 1 R26 10 MΩ Resistor 6 S1, S2, S3, S4, S5, S6 Push Button Switches 7 P1, P2, P3, P4, P5, P6, P7 Test Points 1 Q1 TIC206D Sensitive Gate Triac 1 VDR1 130V Varistor (Voltage Dependent Resistor) DS00236A-page Microchip Technology Inc.
23 APPENDIX E: SOURCE CODE Due to size considerations, the complete source code for this application note is not included in the text. A complete version of the source code, with all required support files, is available for download as a Zip archive from the Microchip web site, at: Microchip Technology Inc. DS00236A-page 23
24 NOTES: DS00236A-page Microchip Technology Inc.
25 Note the following details of the code protection feature on PICmicro MCUs. The PICmicro family meets the specifications contained in the Microchip Data Sheet. Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet. The person doing so may be engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable. Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our product. If you have any further questions about this matter, please contact the local sales office nearest to you. Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Microchip s products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, KEELOQ, MPLAB, PIC, PICmicro, PICSTART and PRO MATE are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, microid, MXDEV, MXLAB, PICMASTER, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. dspic, dspicdem.net, ECONOMONITOR, FanSense, FlexROM, fuzzylab, In-Circuit Serial Programming, ICSP, ICEPIC, microport, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, PICC, PICDEM, PICDEM.net, rfpic, Select Mode and Total Endurance are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. Serialized Quick Turn Programming (SQTP) is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. 2002, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received QS-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona in July 1999 and Mountain View, California in March The Company s quality system processes and procedures are QS-9000 compliant for its PICmicro 8-bit MCUs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, non-volatile memory and analog products. In addition, Microchip s quality system for the design and manufacture of development systems is ISO 9001 certified Microchip Technology Inc. DS00236A - page 25
26 WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ Tel: Fax: Technical Support: Web Address: Rocky Mountain 2355 West Chandler Blvd. Chandler, AZ Tel: Fax: Atlanta 500 Sugar Mill Road, Suite 200B Atlanta, GA Tel: Fax: Boston 2 Lan Drive, Suite 120 Westford, MA Tel: Fax: Chicago 333 Pierce Road, Suite 180 Itasca, IL Tel: Fax: Dallas 4570 Westgrove Drive, Suite 160 Addison, TX Tel: Fax: Detroit Tri-Atria Office Building Northwestern Highway, Suite 190 Farmington Hills, MI Tel: Fax: Kokomo 2767 S. Albright Road Kokomo, Indiana Tel: Fax: Los Angeles Von Karman, Suite 1090 Irvine, CA Tel: Fax: San Jose Microchip Technology Inc North First Street, Suite 590 San Jose, CA Tel: Fax: Toronto 6285 Northam Drive, Suite 108 Mississauga, Ontario L4V 1X5, Canada Tel: Fax: ASIA/PACIFIC Australia Microchip Technology Australia Pty Ltd Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: Fax: China - Beijing Microchip Technology Consulting (Shanghai) Co., Ltd., Beijing Liaison Office Unit 915 Bei Hai Wan Tai Bldg. No. 6 Chaoyangmen Beidajie Beijing, , No. China Tel: Fax: China - Chengdu Microchip Technology Consulting (Shanghai) Co., Ltd., Chengdu Liaison Office Rm. 2401, 24th Floor, Ming Xing Financial Tower No. 88 TIDU Street Chengdu , China Tel: Fax: China - Fuzhou Microchip Technology Consulting (Shanghai) Co., Ltd., Fuzhou Liaison Office Unit 28F, World Trade Plaza No. 71 Wusi Road Fuzhou , China Tel: Fax: China - Shanghai Microchip Technology Consulting (Shanghai) Co., Ltd. Room 701, Bldg. B Far East International Plaza No. 317 Xian Xia Road Shanghai, Tel: Fax: China - Shenzhen Microchip Technology Consulting (Shanghai) Co., Ltd., Shenzhen Liaison Office Rm. 1315, 13/F, Shenzhen Kerry Centre, Renminnan Lu Shenzhen , China Tel: Fax: China - Hong Kong SAR Microchip Technology Hongkong Ltd. Unit 901-6, Tower 2, Metroplaza 223 Hing Fong Road Kwai Fong, N.T., Hong Kong Tel: Fax: India Microchip Technology Inc. India Liaison Office Divyasree Chambers 1 Floor, Wing A (A3/A4) No. 11, O Shaugnessey Road Bangalore, , India Tel: Fax: Japan Microchip Technology Japan K.K. Benex S-1 6F , Shinyokohama Kohoku-Ku, Yokohama-shi Kanagawa, , Japan Tel: Fax: Korea Microchip Technology Korea 168-1, Youngbo Bldg. 3 Floor Samsung-Dong, Kangnam-Ku Seoul, Korea Tel: Fax: Singapore Microchip Technology Singapore Pte Ltd. 200 Middle Road #07-02 Prime Centre Singapore, Tel: Fax: Taiwan Microchip Technology (Barbados) Inc., Taiwan Branch 11F-3, No. 207 Tung Hua North Road Taipei, 105, Taiwan Tel: Fax: EUROPE Austria Microchip Technology Austria GmbH Durisolstrasse 2 A-4600 Wels Austria Tel: Fax: Denmark Microchip Technology Nordic ApS Regus Business Centre Lautrup hoj 1-3 Ballerup DK-2750 Denmark Tel: Fax: France Microchip Technology SARL Parc d Activite du Moulin de Massy 43 Rue du Saule Trapu Batiment A - ler Etage Massy, France Tel: Fax: Germany Microchip Technology GmbH Steinheilstrasse 10 D Ismaning, Germany Tel: Fax: Italy Microchip Technology SRL Centro Direzionale Colleoni Palazzo Taurus 1 V. Le Colleoni Agrate Brianza Milan, Italy Tel: Fax: United Kingdom Microchip Ltd. 505 Eskdale Road Winnersh Triangle Wokingham Berkshire, England RG41 5TU Tel: Fax: /18/02 DS00236A-page Microchip Technology Inc.
AN709. System Level Design Considerations When Using I 2 C TM Serial EEPROM Devices INTRODUCTION INSURING BUS-FREE DURING POWER-UP
M AN709 System Level Design Considerations When Using I 2 C TM Serial EEPROM Devices Author: INTRODUCTION Rick Stoneking Developing systems that implement the I 2 C protocol for communicating with serial
AN688. Layout Tips for 12-Bit A/D Converter Application GETTING A GOOD START INTRODUCTION. Microchip Technology Inc. / 2 MCP602
Layout Tips for 12-Bit A/D Converter Application Author: INTRODUCTION Bonnie C. Baker Microchip Technology Inc. This Application Note originally started as a cook book for a true 12-bit layout. The assumption
AN680. Passive RFID Basics INTRODUCTION DEFINITIONS. Modulation. Reader. Tag. Carrier. Microchip Technology Inc.
Passive RFID Basics Author: INTRODUCTION Radio Frequency Identification (RFID) systems use radio frequency to identify, locate and track people, assets, and animals. Passive RFID systems are composed of
M Floating Point to ASCII Conversion
M Floating Point to ASCII Conversion AN670 Authors: INTRODUCTION It is often necessary to output a floating point number to a display. For example, to check calculations, one might want to output floating
How to Implement ICSP Using PIC12C5XX OTP MCUs VDD. GP3/MCLR/VPP ICSP Connector. To application circuit Isolation circuits
TB017 How to Implement ICSP Using PIC12C5XX OTP MCUs Author: Thomas Schmidt custom orders for your products. IN-CIRCUIT SERIAL PROGRAMMING INTRODUCTION The technical brief describes how to implement in-circuit
AN699. Anti-Aliasing, Analog Filters for Data Acquisition Systems ANALOG VERSUS DIGITAL FILTERS INTRODUCTION. Microchip Technology Inc.
Anti-Aliasing, Analog Filters for Data Acquisition Systems Author: INTRODUCTION Bonnie C. Baker Microchip Technology Inc. Analog filters can be found in almost every electronic circuit. Audio systems use
AN831. Matching Small Loop Antennas to rfpic Devices INTRODUCTION CALCULATING THE LOOP RADIATION RESISTANCE AND LOSS RESISTANCE EQUATION 2:
Matching Small Loop Antennas to rfpic Devices Author: Jan van Niekerk Microchip Technology Inc. EQUATION 2: Ploss I 2 Rloss INTRODUCTION In close proximity to the human body, small loop antennas outperform
TCM809/TCM810. 3-Pin Microcontroller Reset Monitors. General Description. Features. Applications. Pin Configurations. Typical Application Circuit
M TCM809/TCM810 3-Pin Microcontroller Reset Monitors Features Precision Monitor for 2.5V, 3.0V, 3.3V, 5.0V Nominal System Voltage Supplies 140 msec Minimum RESET Timeout Period RESET Output to = 1.0V (TCM809)
AN844. Simplified Thermocouple Interfaces and PICmicro MCUs INTRODUCTION. Linearization THERMOCOUPLE CIRCUITS. Absolute Temperature Reference.
Simplified Thermocouple Interfaces and PICmicro MCUs Author: INTRODUCTION Joseph Julicher Microchip Technology Inc. Thermocouples are the simplest form of temperature sensors. Thermocouples are normally:
M Floating Point to ASCII Conversion
M Floating Point to ASCII Conversion AN670 Authors: INTRODUCTION It is often necessary to output a floating point number to a display. For example, to check calculations, one might want to output floating
Voltage-to-Frequency/Frequency-to-Voltage Converter
Voltage-to-Frequency/Frequency-to-Voltage Converter Author: Michael O. Paiva, Microchip Technology, Inc. RATIOMETRIC MEASUREMENT (ANALOG DIVISION) One of the most difficult circuits to build is one which
TCM680. +5V To ±10V Voltage Converter. General Description. Features. Applications. Package Type. Typical Operating Circuit
M 5V To ±10V Voltage Converter TCM680 Features 99% Voltage Conversion Efficiency 85% Power Conversion Efficiency Input Voltage Range: 2.0V to 5.5V Only 4 External Capacitors Required 8Pin SOIC Package
FLASH Memory Programming Specification TABLE 1-1: PIN DESCRIPTIONS (DURING PROGRAMMING): PIC16F72
M PIC16F72 FLASH Memory Programming Specification This document includes the programming specifications for the following device: PIC16F72 1.0 PROGRAMMING THE PIC16F72 The PIC16F72 is programmed using
Analog-to-Digital Converters
Analog-to-Digital Converters In this presentation we will look at the Analog-to-Digital Converter Peripherals with Microchip s midrange PICmicro Microcontrollers series. 1 Analog-to-Digital Converters
A CAN Physical Layer Discussion
M A CAN Physical Layer Discussion AN228 Author: INTRODUCTION Pat Richards Microchip Technology Inc. Many network protocols are described using the seven layer Open System Interconnection (OSI) model, as
AN713. Controller Area Network (CAN) Basics INTRODUCTION CAN PROTOCOL BASICS CAN OVERVIEW
Controller Area Network (CAN) Basics AN713 Author: INTRODUCTION Controller Area Network (CAN) was initially created by German automotive system supplier Robert Bosch in the mid-1980s for automotive applications
Code Hopping Decoder Using a PIC16C56
Code Hopping Decoder Using a PIC6C56 AN66 Author: OVERVIEW Steven Dawson Microchip Technology Inc. This application note fully describes the working of a code hopping decoder implemented on a Microchip
TC652/TC653. Integrated Temperature Sensor & Brushless DC Fan Controller with FanSense Detect & Over-Temperature. Features.
Integrated Temperature Sensor & Brushless DC Fan Controller with FanSense Detect & Over-Temperature Features Integrated Temperature Sensing and Multi-speed Fan Control FanSense Fan Fault Detect Circuitry
TB3016. Using the PIC MCU CTMU for Temperature Measurement IMPLEMENTATION BASIC PRINCIPLE MEASUREMENT CIRCUIT
Using the PIC MCU CTMU for Temperature Measurement Author: Padmaraja Yedamale Microchip Technology Inc. The Charge Time Measurement Unit (CTMU), introduced on the latest generation of PIC24F and PIC18F
Technical Brief Secure Learning RKE Systems Using KEELOQ Encoders
Technical Brief Secure Learning RKE Systems Using KEELOQ Encoders TB001 Author: Chris R. Burger INTRODUCTION Learning capability in remote keyless entry (RKE) and remote-controlled security systems is
How To Use A Temperature Sensor On A Microchip Computer (For Microchip)
2-Wire Serial Temperature Sensor and Thermal Monitor Features Solid-State Temperature Sensing; 0.5 C Accuracy (Typ.) Operates from -55 C to +25 C Operating Supply Range: 2.7V to 5.5V Programmable Trip
WORKSHOP-IN-A-BOX 2: LOW POWER SOLUTIONS DEMONSTRATION BOARD
WORKSHOP-IN-A-BOX 2: LOW POWER SOLUTIONS DEMONSTRATION BOARD 2004 Microchip Technology Inc. DS51512A Note the following details of the code protection feature on Microchip devices: Microchip products meet
PIC16F877A. FLASH Memory Programming Specification 1.0 PROGRAMMING THE PIC16F87XA
M PIC16F87XA FLASH Memory Programming Specification This document includes programming specifications for the following devices: Pin Diagrams PDIP, SOIC PIC16F873A PIC16F874A PIC16F876A PIC16F877A 1.0
AN562. Using Endurance Predictive Software. Using the Microchip Endurance Predictive Software INTRODUCTION TOTAL ENDURANCE PREDICTIVE SOFTWARE
AN562 Using the Microchip Endurance Predictive Software INTRODUCTION Endurance, as it applies to non-volatile memory, refers to the number of times an individual memory cell can be erased and/or written
TB026. Calculating Program Memory Checksums Using a PIC16F87X ACCESSING MEMORY INTRODUCTION. PIC16C7X vs. PIC16F87X. Microchip Technology Inc.
M TB026 Calculating Program Memory Checksums Using a PIC16F87X Author: INTRODUCTION Many applications require the microcontroller to calculate a checksum on the program memory to determine if the contents
AN685. Thermistors in Single Supply Temperature Sensing Circuits INTRODUCTION THERMISTOR OVERVIEW. Current-Over-Time Mode. Voltage-Versus-Current Mode
Thermistors in Single Supply Temperature Sensing Circuits Author: INTRODUCTION Bonnie C. Baker Microchip Technology Inc. There is a variety of temperature sensors on the market all of which meet specific
AN1303. Software Real-Time Clock and Calendar Using PIC16F1827 DATA INTERFACE INTRODUCTION IMPLEMENTATION INTERNAL REGISTER MAP
Software Real-Time Clock and Calendar Using PIC16F1827 Author: INTRODUCTION Cristian Toma Microchip Technology Inc. This application note describes the implementation of software Real-Time Clock and Calendar
TB056. Demonstrating the Set_Report Request With a PS/2 to USB Keyboard Translator Example INTRODUCTION. The Set_Report Request.
Demonstrating the Set_Report Request With a PS/2 to USB Keyboard Translator Example Author: INTRODUCTION This Technical Brief details the translation of a PS/2 keyboard to a USB keyboard using the PIC16C745/
TB040. Fast Integer Square Root THE ALGORITHM INTRODUCTION SQUARE ROOT FLOW CHART
Fast Integer Square Root Author: Ross M. Fosler Microchip Technology Inc. algorithm demonstrates how the single cycle multiplier is useful in calculating a square root and at the same time, save processor
AN679. Temperature Sensing Technologies SO MANY TEMPERATURE SENSORS INTRODUCTION. Microchip Technology Inc.
M Temperature Sensing Technologies AN679 Author: Bonnie Baker Microchip Technology Inc. INTRODUCTION Of all of the sensing technologies, temperature sensing is the most common. This phenomena can be explained
AN826. Crystal Oscillator Basics and Crystal Selection for rfpic TM and PICmicro Devices INTRODUCTION OSCILLATOR MODELS. Microchip Technology Inc.
Crystal Oscillator Basics and Crystal Selection for rfpic TM and PICmicro Devices Author: INTRODUCTION Steven Bible Microchip Technology Inc. Oscillators are an important component of radio frequency (RF)
AN1286. Water-Resistant Capacitive Sensing INTRODUCTION THEORY OF OPERATION. Sensing Steps. Sensing Steps Description DESIGN
Water-Resistant Capacitive Sensing AN1286 Author: INTRODUCTION Thomas Perme Steven Lin Microchip Technology Inc. This application note describes a new hardware sensing method which is resilient to water
Operational Amplifier Topologies and DC Specifications
Operational Amplifier Topologies and DC Specifications Author: Bonnie C. Baker INTRODUCTION Operational amplifiers (op amps) are as prolific in analog circuits as salt and pepper is on food. They are sprinkled
Driving Power MOSFETs in High-Current, Switch Mode Regulators V GS(TH) In equation form: and. I G = Q G /t (transition) where: For example:
N786 Driving Power MOSFETs in High-Current, Switch Mode Regulators uthor: bid Hussain, Microchip Technology, Inc. Q GS Q GD Q G Q OD DRIVING THE MOSFET The low on-resistance and high current carrying capability
AN905. Brushed DC Motor Fundamentals INTRODUCTION PRINCIPLES OF OPERATION. Stator. Rotor SIMPLE TWO-POLE BRUSHED DC MOTOR. Microchip Technology Inc.
Brushed DC Motor Fundamentals AN905 Author: Reston Condit Microchip Technology Inc. INTRODUCTION Brushed DC motors are widely used in applications ranging from toys to push-button adjustable car seats.
AN723. Operational Amplifier AC Specifications and Applications INTRODUCTION FREQUENCY DOMAIN SPECIFICATIONS
Operational Amplifier AC Specifications and Applications Author: INTRODUCTION Bonnie C. Baker I IN V DD This application note defines the ac specifications of voltage feedback operational amplifiers (Op
AN717. Building a 10-bit Bridge Sensing Circuit using the PIC16C6XX and MCP601 Operational Amplifier
Building a 10-bit Bridge Sensing Circuit using the PIC16C6XX and MCP601 Operational Amplifier Author: INTRODUCTION Bonnie C. Baker Sensors that use Wheatstone bridge configurations, such as pressure sensors,
An Introduction to MPLAB Integrated Development Environment
An Introduction to MPLAB Integrated Development Environment 2004 Microchip Technology Incorporated An introduction to MPLAB Integrated Development Environment Slide 1 This seminar is an introduction to
MCP3021. Low Power 10-Bit A/D Converter With I 2 C Interface. Description. Features. Applications. Functional Block Diagram.
M MCP321 Low Power 1-Bit A/D Converter With I 2 C Interface Features 1-bit resolution ±1 LSB DNL, ±1 LSB INL max. 25 µa max conversion current 5 na typical standby current, 1 µa max. I 2 C compatible serial
TC110. PFM/PWM Step-Up DC/DC Controller. Features. General Description. Applications. Functional Block Diagram. Device Selection Table
PFM/PWM Step-Up DC/DC Controller TC110 Features Assured Start-up at 0.9V 50µA (Typ) Supply Current (f OSC = 100kHz) 300mA Output Current @ V IN 2.7V 0.5µA Shutdown Mode 100kHz and 300kHz Switching Frequency
Recommended Usage of Microchip 23X256/23X640 SPI Serial SRAM Devices RECOMMENDED CONNECTIONS FOR 23X256,23X640 SERIES DEVICES VCC 23X256/ HOLD.
Recommended Usage of Microchip 23X256/23X640 SPI Serial SRAM Devices Author: INTRODUCTION Martin Bowman Microchip Technology Inc. This document details recommended usage of the Microchip 23X256 and 23X640
AN873. Using the MCP2515 CAN Developer s Kit INTRODUCTION. PC Node. PICmicro Node BLOCK DIAGRAM OF MCP2515 DEVELOPMENT BOARD
M Using the MCP2515 CAN Developer s Kit AN873 Author: INTRODUCTION The MCP2515 eases software development and shortens the learning curve for the MCP2515 by providing three PC software templates with different
Interfacing Pressure Sensors to Microchip s Analog Peripherals V OUT- Silicon Substrate
Interfacing Pressure Sensors to Microchip s Analog Peripherals Author: INTRODUCTION Bonnie Baker Pressure measurement devices can be classified into two groups: those where pressure is the only source
AN687. Precision Temperature-Sensing With RTD Circuits RTD OVERVIEW INTRODUCTION EQUATION 1:
Precision Temperature-Sensing With RTD Circuits Author: INTRODUCTION Bonnie C. Baker Microchip Technology Inc. The most widely measured phenomena in the process control environment is temperature. Common
AN1142. USB Mass Storage Class on an Embedded Host INTRODUCTION. USB Mass Storage Class. Overview
USB Mass Storage Class on an Embedded Host Author: INTRODUCTION With the introduction of Microchip's microcontrollers with the USB OTG peripheral, microcontroller applications can easily support USB Embedded
Section 28. In-Circuit Serial Programming (ICSP )
M Section 28. In-Circuit Serial Programming (ICSP ) HIGHLIGHTS This section of the manual contains the following major topics: 28. Introduction...28-2 28.2 Entering In-Circuit Serial Programming Mode...28-3
APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.
APPLICATION NOTE Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer Introduction Atmel AVR 8-bit Microcontroller This application note describes how to implement a real time counter (RTC)
Installing and Licensing MPLAB XC C Compilers
Installing and Licensing MPLAB XC C Compilers DS50002059G Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular
TB055. PS/2 to USB Mouse Translator IMPLEMENTATION OVERVIEW. Hardware FIGURE 1: PS/2 TO USB MOUSE TRANSLATOR HARDWARE DIAGRAM (1)
PS/2 to USB Mouse Translator TB55 Author: OVERVIEW Reston Condit Microchip Technology Inc. This Technical Brief details the translation of a PS/2 mouse to a USB mouse using the PIC16C745/765. The PIC16C745/765
Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs
Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs AN033101-0412 Abstract This describes how to interface the Dallas 1-Wire bus with Zilog s Z8F1680 Series of MCUs as master devices. The Z8F0880,
Fondamenti su strumenti di sviluppo per microcontrollori PIC
Fondamenti su strumenti di sviluppo per microcontrollori PIC MPSIM ICE 2000 ICD 2 REAL ICE PICSTART Ad uso interno del corso Elettronica e Telecomunicazioni 1 2 MPLAB SIM /1 MPLAB SIM is a discrete-event
AN1156. Battery Fuel Measurement Using Delta-Sigma ADC Devices INTRODUCTION REVIEW OF BATTERY CHARGING AND DISCHARGING CHARACTERISTICS
Battery Fuel Measurement Using Delta-Sigma ADC Devices Author: INTRODUCTION Youbok Lee, Ph.D. Microchip Technology Inc. The battery fuel status indicator is a common feature of the battery-supported handheld
8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.
AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,
HANDLING SUSPEND MODE ON A USB MOUSE
APPLICATION NOTE HANDLING SUSPEND MODE ON A USB MOUSE by Microcontroller Division Application Team INTRODUCTION All USB devices must support Suspend mode. Suspend mode enables the devices to enter low-power
AN3265 Application note
Application note Handling hardware and software failures with the STM8S-DISCOVERY Application overview This application is based on the STM8S-DISCOVERY. It demonstrates how to use the STM8S window watchdog
How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player
Watt Saver for a Cell Phone AC Adapter Reference Design Document Number: DRM130 Rev 1, 10/2013 2 Freescale Semiconductor, Inc. Contents Section number Title Page Chapter 1 Introduction 1.1 Overview...5
Flexible Active Shutter Control Interface using the MC1323x
Freescale Semiconductor Document Number: AN4353 Application Note Rev. 0, 9/2011 Flexible Active Shutter Control Interface using the MC1323x by: Dennis Lui Freescale Hong Kong 1 Introduction This application
Timers: Timer0 Tutorial (Part 1)
Timers: Timer0 Tutorial (Part 1) 2007 Microchip Technology Inc. DS51682A Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained
AN1199. 1-Wire Communication with PIC Microcontroller INTRODUCTION. OVERVIEW OF THE 1-Wire BUS. 1-Wire Protocol. Prerequisites
1-Wire Communication with PIC Microcontroller Author: INTRODUCTION This application note introduces the user to the 1-Wire communication protocol and describes how a 1-Wire device can be interfaced to
AN956. Migrating Applications to USB from RS-232 UART with Minimal Impact on PC Software OVERVIEW INTRODUCTION. Microchip Technology Inc.
Migrating Applications to USB from RS-232 UART with Minimal Impact on PC Software Author: INTRODUCTION Rawin Rojvanit Microchip Technology Inc. The RS-232 serial interface is no longer a common port found
TC648. Fan Speed Controller with Auto-Shutdown and Over-Temperature Alert. Package Types. Features TC648. General Description.
M Fan Speed Controller with Auto-Shutdown and Over-Temperature Alert TC648 Features Temperature Proportional Fan Speed for Acoustic Control and Longer Fan Life Efficient PWM Fan Drive 3.0V to 5.5V Supply
8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter
AVR400: Low Cost A/D Converter Features Interrupt Driven : 23 Words Low Use of External Components Resolution: 6 Bits Measurement Range: 0-2 V Runs on Any AVR Device with 8-bit Timer/Counter and Analog
dspic30f3012/3013 dspic30f3012/3013 Rev. B0 Silicon Errata dspic30f3012/3013 (Rev. B0) Silicon Errata Silicon Errata Summary
dspic30f3012/3013 Rev. B0 Silicon Errata dspic30f3012/3013 (Rev. B0) Silicon Errata The dspic30f3012/3013 (Rev. B0) samples you have received were found to conform to the specifications and functionality
MX PIC24F Educational Module User Manual
MX PIC24F Educational Module User Manual Revision History Date Description Initial release. Table of Contents 1. Introduction... 3 1.1. Package Contents... 3 1.2. Key Hardware Features... 4 2. Hardware
AN1325. mtouch Metal Over Cap Technology THEORY OF OPERATION INTRODUCTION CROSS SECTION OF METAL OVER CAPACITIVE (UNPRESSED)
mtouch Metal Over Cap Technology AN1325 Authors: INTRODUCTION Keith Curtis Dieter Peter Microchip Technology Inc. As a user interface, capacitive touch has several advantages: it is low power, low cost,
SG2525A SG3525A REGULATING PULSE WIDTH MODULATORS
SG2525A SG3525A REGULATING PULSE WIDTH MODULATORS 8 TO 35 V OPERATION 5.1 V REFERENCE TRIMMED TO ± 1 % 100 Hz TO 500 KHz OSCILLATOR RANGE SEPARATE OSCILLATOR SYNC TERMINAL ADJUSTABLE DEADTIME CONTROL INTERNAL
Universal Programming Module 2
Universal Programming Module OVERVIEW The Universal Programming Module (UPM) is a handy, low-cost board that supports the programming of Microchip devices using MPLAB in-circuit emulators and debuggers.
8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.
AVR415: RC5 IR Remote Control Transmitter Features Utilizes ATtiny28 Special HW Modulator and High Current Drive Pin Size Efficient Code, Leaves Room for Large User Code Low Power Consumption through Intensive
Software Real Time Clock Implementation on MC9S08LG32
Freescale Semiconductor Document Number: AN4478 Rev. 0, 03/2012 Software Real Time Clock Implementation on MC9S08LG32 by: Nitin Gupta Automotive and Industrial Solutions Group 1 Introduction The MC9S08LG32
8-bit RISC Microcontroller. Application Note. AVR182: Zero Cross Detector
AVR182: Zero Cross Detector Features Interrupt Driven Modular C Source Code Size Efficient Code Accurate and Fast Detection A Minimum of External Components Introduction One of the many issues with developing
NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter
NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter Description: The NTE2053 is a CMOS 8 bit successive approximation Analog to Digital converter in a 20 Lead DIP type package which uses a differential
A PIC16F628 controlled FLL (Frequency Locked Loop) VFO for HF
Abstract A PI6F628 controlled FLL (Frequency Locked Loop) VFO for HF It is described a device which joins in a single microprocessor a digital programmable frequency meter and a control logic capable to
AN974 APPLICATION NOTE
AN974 APPLICATION NOTE Real time clock with ST7 Timer Output Compare By MCD Application Team 1 INTRODUCTION The purpose of this note is to present how to use the ST7 Timer output compare function. As an
AN2680 Application note
Application note Fan speed controller based on STDS75 or STLM75 digital temperature sensor and ST72651AR6 MCU Introduction This application note describes the method of defining the system for regulating
RC Model Aircraft Motor Control. Solutions. PWM Rate khz 1 PIC12C508A 20 20 0.5 limited None None 1.3 2 PIC16F628 20 20 1.0 Yes Yes Yes 32, 8, 2
RC Model Aircraft Motor Control AN847 Author: INTRODUCTION Joseph Julicher Microchip Technology Inc. As modern MOSFET transistors are developed with lower ON resistance and smaller packages, Electronic
AN3252 Application note
Application note Building a wave generator using STM8L-DISCOVERY Application overview This application note provides a short description of how to use the STM8L-DISCOVERY as a basic wave generator for
Integrated Development Environment
Development Tools Integrated Development Environment Transforming Ideas Into Realities The typical product development life cycle is comprised of smaller cycles each representing an iterative process toward
HCS200. KEELOQ Code Hopping Encoder DESCRIPTION FEATURES PACKAGE TYPES BLOCK DIAGRAM. Security. Operating. Other. Typical Applications
KEELOQ Code Hopping Encoder HCS200 FEATURES Security Programmable 28-bit serial number Programmable 64-bit crypt key Each transmission is unique 66-bit transmission code length 32-bit hopping code 28-bit
AN1470. Manchester Decoder Using the CLC and NCO ABSTRACT INTRODUCTION MANCHESTER ENCODED DATA (AS PER G.E. THOMAS)
Manchester Decoder Using the CLC and NCO Authors: ABSTRACT A Manchester decoder can be built using Microchip s award winning CLC (Configurable Logic Cell) blocks and NCO (Numerically Controlled Oscillator)
SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.
SKP16C62P Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance
1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver
Electronics Exercise 2: The 555 Timer and its Applications Mechatronics Instructional Laboratory Woodruff School of Mechanical Engineering Georgia Institute of Technology Lab Director: I. Charles Ume,
0.9V Boost Driver PR4403 for White LEDs in Solar Lamps
0.9 Boost Driver for White LEDs in Solar Lamps The is a single cell step-up converter for white LEDs operating from a single rechargeable cell of 1.2 supply voltage down to less than 0.9. An adjustable
HT1632C 32 8 &24 16 LED Driver
328 &216 LED Driver Features Operating voltage: 2.V~5.5V Multiple LED display 32 ROW /8 COM and 2 ROW & 16 COM Integrated display RAM select 32 ROW & 8 COM for 6 display RAM, or select 2 ROW & 16 COM for
M68EVB908QL4 Development Board for Motorola MC68HC908QL4
M68EVB908QL4 Development Board for Motorola MC68HC908QL4! Axiom Manufacturing 2813 Industrial Lane Garland, TX 75041 Email: [email protected] Web: http://www.axman.com! CONTENTS CAUTIONARY NOTES...3 TERMINOLOGY...3
APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description
APPLICATION NOTE Atmel AT259: In House Unit with Bluetooth Low Energy Module Hardware User Guide Features 8-bit Atmel Microcontroller Low power consumption Interface with BLE with UART Bi-direction wake
AN1353. Op Amp Rectifiers, Peak Detectors and Clamps INTRODUCTION BASIC RECTIFIERS. Choosing the Components. Positive Half-Wave Rectifier.
Op Amp Rectifiers, Peak Detectors and Clamps Author: Dragos Ducu, Microchip Technology Inc. INTRODUCTION This application note covers a wide range of applications, such as halfwave rectifiers, fullwave
PIC10F200/202/204/206
Memory Programming Specification This document includes the programming specifications for the following devices: PIC10F200 PIC10F202 PIC10F204 PIC10F206 1.0 PROGRAMMING THE PIC10F200/202/204/206 The PIC10F200/202/204/206
Accurate Measurement of the Mains Electricity Frequency
Accurate Measurement of the Mains Electricity Frequency Dogan Ibrahim Near East University, Faculty of Engineering, Lefkosa, TRNC [email protected] Abstract The frequency of the mains electricity supply
Features, Value and Benefits of Digital Control for Power Supplies
Author: INTRODUCTION Sagar Khare Microchip Technology Inc. Control of Switch Mode Power Supplies (SMPSs) has traditionally been a purely analog domain. The advent of low-cost, high-performance Digital
CHAPTER 11: Flip Flops
CHAPTER 11: Flip Flops In this chapter, you will be building the part of the circuit that controls the command sequencing. The required circuit must operate the counter and the memory chip. When the teach
AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction
AVR134: Real Time Clock (RTC) using the Asynchronous Timer Features Real Time Clock with Very Low Power Consumption (4 μa @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts
AN3332 Application note
Application note Generating PWM signals using STM8S-DISCOVERY Application overview This application user manual provides a short description of how to use the Timer 2 peripheral (TIM2) to generate three
PLL frequency synthesizer
ANALOG & TELECOMMUNICATION ELECTRONICS LABORATORY EXERCISE 4 Lab 4: PLL frequency synthesizer 1.1 Goal The goals of this lab exercise are: - Verify the behavior of a and of a complete PLL - Find capture
AN ISOLATED GATE DRIVE FOR POWER MOSFETs AND IGBTs
APPLICATION NOTE AN ISOLATED GATE DRIVE FOR POWER MOSFETs AND IGBTs by J.M. Bourgeois ABSTRACT Power MOSFET and IGBT gate drives often face isolation and high voltage constraints. The gate drive described
TDA7448 6 CHANNEL VOLUME CONTROLLER 1 FEATURES 2 DESCRIPTION. Figure 1. Package
6 CHANNEL CONTROLLER FEATURES 6 CHANNEL INPUTS 6 CHANNEL OUTPUTS ATTENUATION RANGE OF 0 TO -79dB CONTROL IN.0dB STEPS 6 CHANNEL INDEPENDENT CONTROL ALL FUNCTION ARE PROGRAMMABLE VIA SERIAL BUS DESCRIPTION
Designing an Induction Cooker Using the S08PT Family
Freescale Semiconductor, Inc. Document Number: AN5030 Application Note Rev. 0 11/2014 Designing an Induction Cooker Using the S08PT Family by: Leo Pan, Dennis Lui, T.C. Lun 1 Introduction This application
TCP/IP Networking: Web-Based Status Monitoring
TCP/IP Networking: Web-Based Status Monitoring Microchip TCP/IP Stack HTTP2 Module 2007 Microchip Technology Incorporated. All Rights Reserved. Web-Based Status Monitoring Slide 1 Welcome to the first
