EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 18 April 2011
|
|
- Isaac Rich
- 5 years ago
- Views:
Transcription
1 EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 18 April 2011 Project Name: Multi-Zone Climate Control System Team Name: G 2 Intelligent HVAC System Solutions Team Members: Name: Giovanni Montoya Name: Gustavo Cifuentes
2 Page 2/42 Table of Contents Project Abstract...3 Introduction...4 Technical Objectives...6 Concept/ Technology Selection...7 Cost Objectives...9 Division of Labor...10 Gantt Chart...11 Appendix A 12 Appendix B 14 Appendix C 16
3 Page 3/42 Project Abstract Our group aims to create an intelligent climate control system which may be programmed to independently control the air temperature of several rooms. The system functions by taking a reading of a room s temperature with a satellite sensor module (SSM) and controlling individual air conditioning vents with satellite control modules (SCM). Both the SSM and SCM will be implemented utilizing TI MSP430 microcontrollers due to their low power consumption and cost. The temperature reading from the SSM will be transmitted to a central control module (CCM) which will determine if the temperature of the environment is within acceptable range in addition to providing user I/O. Based on these temperature readings, the CCM will send out control signals to the SCMs which operate the vents through the use of low power servomotors.
4 Page 4/42 Introduction One of the most power hungry and important aspects of a modern building is its Heating Ventilation Air Conditioning (HVAC) unit. While modern HVAC units can be efficient at heating or cooling air itself, they are typically woefully inefficient when it comes to distributing air throughout a building. An HVAC system keeps the general building temperature at a preset point; however not every room needs to be at the same temperature all the time. For example, when the occupants of a house go the sleep, only the bedrooms need to be cooled or heated. This means a significant amount power could be conserved if a programmable multizone HVAC system were to be employed. Additionally, a home or building serviced by a traditional HVAC unit tends to have significant unwanted temperature fluctuations across its various rooms. Factors such as poorly insulated rooms, large windows or skylights resulting in excessive amounts of sunlight, or a poorly designed air duct system all contribute to temperature fluctuations that can be corrected by the implementation of a multi-zone climate control system. Multi-zone climate control systems have been around for some time, typically found in large buildings serviced by industrial grade HVAC equipment. For example, a hospital may be serviced by several large air handler units each of which can independently control the temperature for a section of the building. Only recently have multi-zone climate control systems appeared in residential applications. In these systems a home may be divided into 2-4 zones (typically floor 1 and floor 2) where air flow is controlled by air flow dampeners installed in the main air ducts, allowing for course climate control to a section of a home. The installation of one of these systems into a home or small building is time consuming and difficult, as it involves
5 Page 5/42 replacing parts of the air duct system in addition to wiring the thermostats, and air flow dampeners together. As a result, installation is typically performed by professionals. Our proposed system differs from the aforementioned systems because it will allow for fine temperature control of the individual rooms of a house or building. This level of control will result in greater efficiency and a more comfortable environment for users than what is offered by currently existing systems. Our system has the additional advantage of being relatively easy to install, since it does not necessitate replacing portions of the air duct system throughout the building or house.
6 Page 6/42 Technical Objectives The main objective of this project is to create a centralized multi-zone climate control system suitable for regulating the temperature in individual rooms serviced by a single Heating Ventilation Air Conditioning (HVAC) unit. The CCM is responsible for transmitting data received by the SSM to the SCM. Using RF transceivers eliminates the need for wires between both control systems and avoids line of site problems that would be present with infrared applications. The CCM will utilize a more sophisticated microcontroller since it will be receiving temperature data from every room, running thermodynamic algorithms, transmitting signals to the control modules, and receiving user input. The SSM will monitor temperature readings and act as a feedback control loop for the CCM. The SSM will be controlled by an MSP430 because the microcontroller can be programmed for excellent power management; this aspect is critical in the design since the sensor modules will run on batteries that will last for months at a time. The SCM will be responsible for operating the servomotor that opens and closes the vents. Based on servomotor power consumption studies, it is possible for the control module to operate on batteries.
7 Page 7/42 Concept/Technology Selection The physical system requirements of the Multi-Zone Climate Control System dictated its design as a 3 part system. There must be an air temperature sensor in each room as well as an airflow controller on each vent in a room. The sensors and controllers cannot be combined into one unit as placing sensors in an air vent would result in erroneous room temperature readings. A central unit must process the room temperature readings and coordinate all of the air flow controllers. For this reason the project was divided into three physically distinct modules. The Satellite Sensor Module will be a small battery powered wireless module to allow for easy placement and setup; an MSP430G2231 will be used to implement this module. This microcontroller has a built in temperature sensor and SPI module as well as numerous low power features making it ideal for use in a battery powered temperature sensor module. This module will interface with the rest of the system using a wireless transmitter. An RF link transmitter was chosen as opposed to an XBee or similar device, for low cost and simple SPI interface. With the goal of making an easy to use and install Multi-Zone Climate Control System, the SCM was chosen to be placed on the air vent, rather than in the air duct. This would allow for an easy install of the SCM, as portions of the air duct system would not need to be replaced. Most air vents have manual airflow restrictors built into them, which we intend to electronically control through the use of an actuator. For cost and availability reasons servomotors will be used as the actuators in our design. The microcontroller requirements for this system are minimal; it needs to have an SPI interface and a few GPIO pins. For these reason a low cost MSP430G2231 will be used for this project.
8 Page 8/42 Creating multiple temperature zones in a home or building serviced by a single HVAC unit requires a centralized controller to coordinate the operation of the HVAC unit and airflow controllers in response to temperature readings. In order to interface with the HVAC unit s control wires the CCM must physically replace, or interface with the thermostat unit of a typical HVAC system. As the central controller in the system, it is also an ideal location to place user I/O. This means the microprocessor which controls the CCM must have enough GPIO to accommodate an HVAC interface (up to 9 wires), LCD screen, and keypad. It also needs to have sufficient processing power to run multivariate feedback algorithms, user I/O, and transmit and receive signals from numerous satellite modules; for this reason an MSP430F2274 was chosen.
9 Page 9/42 Cost Objectives This device is intended to be a modular system which can be expanded or reduced to meet the need of individual users; as such its price will vary depending on the configuration a user decides to implement. For this reason the cost objectives will be set on a per module basis. The prototype will be based on a 3 zone system consisting of 3 SSMs, 3 SCMs, and 1 CCM with a cost of under $200; the tentative parts list is shown below. Central Control Module Price (CCM) Components MSP430F RF Link Receiver ~2.50 RF Link Transmitter ~2.50 LCD Screen 0.00 Keypad ~10.00 DC Power Supply 0.00 Relay X Case/Enclosure ~11.36 Module Total Satellite Sensor Module Price (SSM) Components X 3 MSP430G2231 ~5.00 RF Link Transmitter ~2.50 Battery Housing 2-AA ~1.00 Housing/Case 3.41 Module Total Satellite Control Module Price (SSM) Components X 3 MSP430G2231 ~5.00 RF Link Receiver ~2.50 Battery Clips 2-AA and 4-AA ~2.00 Servomotor Vent Cover 9.00 Module Total Prototype Cost (3 Zones) $161.94
10 Page 10/42 Division of Labor by Percent Task Giovanni Montoya Gustavo Cifuentes RF interface & Satellite Sensor Module Satellite Control Module Central Control Module Algorithms Central Control Module HVAC Interface Central Control Module Hardware System Integration 50 50
11 Page 11/42 Gantt Chart
12 Page 12/42 Appendix A Diagrams and Flow Charts: Fig. 1 Block Diagram for Preliminary Design of Multi-Zone Climate Control System Fig. 2 SSM Flowchart Fig. 3 CCM Flowchart
13 Page 13/42 Fig. 4 SCM Flow Chart Fig. 5 System Flow Chart
14 Page 14/42 Appendix B Schematic and PCB Files: Fig 1. SSM Schematic Fig. 2 SCM Schematic Fig. 3 CCM Schematic
15 Page 15/42 Fig. 1 SSM PCB Fig 2. SCM PCB Fig. 3 CCM PCB
16 Page 16/42 Appendix C SSM Code: /* * Recieves and Transmits data on low cost wireless devices * Transmits and or recieves based on initialization * Data Packet has following format * start byte 1 start byte 2 source byte destination byte data byte(s) * * Includes a preamble * Preamble definetely helps successfully transmit data * RED LED indicates its out of sleep mode and transmitting data * * This version has sleep commands */ //pragma #include <msp430g2231.h> //volatile unsigned int Data0,Data1,Data2,i,Start_Value0,CompWindow; int DB1=0, DB2=0, k, displacement=10, Start_Value1,sync,DataLength,PacketCount=0; //int RxData[5]; //sets number of data words (max datalength = #of Rxdata+2 (EX 5+2)) //Copy Me into the program int DataLength; int Rep,TXpos,RepCount=0; int Data[5]=0xFA, 0x70, 0x51,0, 0; volatile int j,sleeptime=40000; //3 sec at ACLK/4 volatile unsigned long TempConv,TempF; /////////////////////////////////// void RFWconfig(int datalength); void RFWtx(int Destination,int Repetition, int Dat); void main(void) WDTCTL =WDTPW + WDTHOLD; //Disable Watchdog BCSCTL1 = CALBC1_1MHZ; // Set DCO DCOCTL = CALDCO_1MHZ; BCSCTL2 = 0x06; // MCLK=DCO/0 SMLCK=DCO/8 BCSCTL3 = LFXT1S_2; // LFXT1 = VLO IFG1 &= ~OFIFG; // Clear OSCFault flag // BCSCTL2 = SELM_0 + DIVM_0; // MCLK = DCO
17 Page 17/42 P1DIR=0x11; P1OUT=0x10; DB1++; //Configure ADC 10 to temp sensor ADC10CTL1 = INCH_10 + ADC10DIV_0; // Temp Sensor, ADC10CLK //Configure Timer CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = SleepTime; // one second TACTL = TASSEL_1 + ID_3 + MC_2; // ACLK/8, continuous mode //Configure ADC 10 to temp sensor ADC10CTL1 = INCH_10 + ADC10DIV_0; // Temp Sensor, ADC10CLK //Configure Timer CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = SleepTime; // one second TACTL = TASSEL_1 + ID_3 + MC_2; // ACLK/8, continuous mode RFWconfig(5); while(1) P1OUT = BIT4 + BIT0; RFWtx(0x55,150,TempF); for (k=0;k<50;k++) _delay_cycles(50000); // _BIS_SR(GIE + LPM3); P1OUT=0; _bis_sr_register(lpm3_bits + GIE); #pragma vector=usi_vector interrupt void spi(void) //Transmits contents of Data[0-DataLength] Rep times if (TXpos<5) //5 x 0xAA preamble USISRL=0xAA; // USICNT =0x8; // TXpos++; // else // USISRL=Data[TXpos-5]; USICNT =0x8;
18 Page 18/42 TXpos++; DB2++; // if ((TXpos-5) >= DataLength) TXpos=0; RepCount++; //one more packet transmitted if (RepCount < Rep) //reenable the interupt if... USICTL1 &= ~USIIFG; void RFWtx(int Destination,int Repetition, int Dat) //readies TX vector/stack // Data[0]=0xFA; done at beggining // Data[1]=0x70; // Data[2]= source Hardcoded into array Data[3]=Destination; Data[4]=Dat; //readies ISR RepCount=0; //resets counter Rep=Repetition; //sets counter max value TXpos=0; // resets data position counter //readies USI USISRL=0xAA; //initialization USICNT=0x8; //set usi count USICTL1 &= ~USIIFG; //clear USI flag void RFWconfig(datalength) USICTL0 &= USISWRST; // reset spi USICTL0 = USIPE7 + USIPE6 + USIPE5 + USIMST + USIOE; //PINs USICTL1 = USIIE; //usi interupt enable USICKCTL = USIDIV_7 + USISSEL_2;//clk sourced from SMCLK/128 USISRL=5; //initialization USICNT=0x8; //set usi count USICTL0 &= ~USISWRST; //resume usi operation USICTL1 &= ~USIIFG; //clear USI flag DataLength=datalength; _BIS_SR(GIE); //global interupt enable
19 Page 19/42 #pragma vector=timera0_vector interrupt void Timer_A (void) ADC10CTL0 = SREF_1 + ADC10SHT_3 + REFON + ADC10ON; _delay_cycles(50); // Wait for ADC Ref to settle ADC10CTL0 = ENC + ADC10SC; // Sampling and conversion start _delay_cycles(100); ADC10CTL0 &= ~ENC; // Disable ADC conversion ADC10CTL0 &= ~(REFON + ADC10ON); // Ref and ADC10 off TempConv = ADC10MEM; // Read conversion value P1OUT &= ~BIT6; // green LED off TempF=(((TempConv-630)*761)/1024); Data[4]=TempF; //copy to transmit stack CCR0 += SleepTime; // Add one second to CCR0 _bic_sr_register_on_exit(lpm3_bits); SCM Code: /* * Recieves and Transmits data on low cost wireless devices * Transmits and or recieves based on initialization * Data Packet has following format * start byte 1 start byte 2 destination byte source byte data byte * * Prototype: * RFWrx(DataLength,Repetition) * RFWconfig sets source and baud rate */ #include <msp430x20x3.h> volatile unsigned int Data0,Data1,Data2,i,Start_Value0,CompWindow; int displacement=10, Start_Value1,sync,DataLength; int DB1=0; // DB2=0,PacketCount=0; int RxData[5]; //sets number of data words (max datalength = #of Rxdata+2 (EX 5+2)) const int ID=0xAA; //Copy Me into the program int DataLength,k,old_temp; int rxbytes=0,rxbytecount=0;
20 Page 20/42 int period = 80; //4 * 20 ms = 80 int r_edge= 0; int f_edge = 0; int y=0; int OC=0; //int x=0; /////////////////////////////////// void RFWconfig(int datalength); void RFWrx(int Repitition); //scan for how long (in 8 bit words) (T=Repitition*8*Baud) void main(void) WDTCTL =WDTPW + WDTHOLD; //Disable Watchdog BCSCTL1 = CALBC1_1MHZ; // Set DCO DCOCTL = CALDCO_1MHZ; BCSCTL2 = 0x06; // MCLK=DCO/0 SMLCK=DCO/8 // BCSCTL2 = 0; DB1++; RFWconfig(0x4); /* TACCTL0 = CCIE; // CCR0 interrupt enabled TACCR0 = 31; // Prescale for ISR TACTL = TASSEL_2 + MC_1 + ID_0; // SMCLK/1, upmode P1DIR =BIT4; */ // _bis_sr_register(gie); // Enter LPM0 with interrupt while(1) // _bis_sr_register(gie); TACCTL0 = ~CCIE; RFWrx(10000); for (k=0;k<150;k++) _delay_cycles(50000); while(sync!= 0) //wait untill data packet is complete USICTL1 &= ~USIIE; P1DIR =BIT0; TACCTL0 = CCIE; // CCR0 interrupt enabled TACCR0 = 31; // Prescale for ISR TACTL = TASSEL_2 + MC_1 + ID_0; // SMCLK/1, upmode
21 Page 21/42 _bis_sr_register(gie); // Enter LPM0 with interrupt for (k=0;k<50;k++) //delay for PWM _delay_cycles(50000); for (k=0;k < 300; k++) if (y>=12000) TACCTL0 = ~CCIE; //diable PWM y=0; goto breakout; breakout: DB1++; #pragma vector=usi_vector interrupt void spi(void) Data0=USISRL; //transfr data to lower data reg USISRL=0x00; //Transmit nothing... would change if module is being used as a tranciever USICNT =0x8; //shift in/out 8 more bits when the interrupt flag goes false rxbytecount++; // DB2++; // P1OUT=0; // led off (red) Data1=Data1<<8; //shift over 8 to make room for new data Data1 =Data0 & 0x00FF; //Data1=YYXX whare xx is a value in data 0 and Y is old data if (sync!= 0) //fully or partially synced if (sync == 1) //partially synced; try to fully sync Data2 = Data1 & (0x00FF << displacement); //with last recieved byte end of start code //current recieved byte contains data starting at displacement Data2 = Data2 >> displacement; if (Data2==Start_Value1) //fully synced (second start value confirmed) P1OUT=0x01; //set led to indicate success ++sync; //reciever and transmitter pair synced (sync > 1 indicates synched status) else sync=0; //start_value0 was probably noise; de-sync else if (sync <= DataLength) //fully synched, get data out RxData[sync-2]=(Data1 >> displacement) & 0x00FF;
22 Page 22/42 sync++; //inc sync else //synch greater than DataLength sync=0; //end sync if ((RxData[0]==ID) && (RxData[1]==0x55)) OC=RxData[2]; else //not synced for (i=0;i<8;i++) //Checks for start value CompWindow=(Data1 & (0x00FF<<i)); //Creates a floating 8 bit comparison "window" EX 0XX0 if i=4 CompWindow=CompWindow>>i; // Shifts 8 bit comparison window back to lsb EX 00XX if (Start_Value0 == CompWindow) //If start value found, do the following EX 00XX == 00AA displacement=i; //offset from lsb sync=1; DB1++; break; else sync=0; P1OUT=0x00; if (rxbytecount < rxbytes) // repeat so many times USICTL1 &= ~USIIFG; //reset interupt flag else USICTL1 &= USIIFG; void RFWrx(int Repitition) USICTL1 = USIIE; rxbytes=repitition; //counter reset rxbytecount=0; //SPI register reset USISRL=0x00; //Transmit nothing... would change if module is being used as a tranciever USICNT =0x8;
23 Page 23/42 USICTL1 &= ~USIIFG; void RFWconfig(datalength) Data0=0; //data recieved from SPI Data1=0; //raw data window, conains last 16 Recieved bits (two Recieve interupts) Start_Value0 = 0xFA; //first start byte to check for Start_Value1= 0x70; //second start byte to check for DataLength = 3; //number of bytes of data in a packet // minimum of 3 (2 start bytes + 1 databyte) sync=0; // has data been synched //P1DIR = 0x01; //Set LED 1 //P1OUT =0; USICTL0 &= USISWRST; // reset spi USICTL0 = USIPE7 + USIPE6 + USIPE5 + USIMST + USIOE; //PINs USICTL1 = USIIE; //usi interupt enable USICKCTL = USIDIV_7 + USISSEL_2;//clk sourced from SMCLK/128 USISRL=5; //initialization USICNT=0x8; //set usi count USICTL0 &= ~USISWRST; //resume usi operation USICTL1 &= ~USIIFG; //clear USI flag _BIS_SR(GIE); //global interupt enable DataLength=datalength; // Timer A0 ISR: #pragma vector = TIMERA0_VECTOR interrupt void Timer_A (void) // USICTL1 &= ~USIIE; y++; ++r_edge; ++f_edge; if((y == 1 ) && (OC==0x00)) // if (ID==RxData[0]) f_edge = (20-2)*4; r_edge = 0; else if ((y == 6000) && (OC==0xFF)) // if (ID==RxData[0])
24 Page 24/42 //x=0.75; f_edge = ( )*4; r_edge = 0; if (r_edge > period) r_edge = 0; P1OUT = (BIT0); if (f_edge >period) f_edge = 0; P1OUT = ~(BIT0); CCM Code: /* this file integrates the user IO with the TRANSMITTER and RECIEVER code. * Remember to break the Rx or Tx when done using each. * Remember to Reinitialize the Rx and Tx before every use. * The Relay pins must be set * */ #include <msp430f2274.h> #include <string.h> typedef struct int SSM_ID; int SCM_ID; int Set_Temp; int Current_Temp; int Vent_Position; //should vent be open or closed Room; typedef struct signed int Mode; signed int Vote; System; //-1=cool 0=off 1=heat //tally of each room's "vote" for the HVAC setting
25 Page 25/42 System Sys=1,0; //system initialized to heat tally set to off Room Room_A=0x03,0xAA,0,0,0; Room Room_B=0x0C,0xBB,0,0,0; Room Room_C=0x30,0xCC,0,0,0; Room Room_D=0xC0,0xDD,0,0,0; int KeyPress,mask; int CHAR,DB2; //ascii code for char A = 0x41 int NIB,NIB1; //nibble of char to be transmitted NIB=4 NIB=1 char DB1; int TMP[3]; // Temperary Variables for use in MAIN //TEMP_C,*TEMP_C2; int DataLength=5,TXC=0,Preamble_Length=3; int Rep,TXpos,RepCount=0; int Data[5]=0xFA, 0x70, 0x55,0xAA, 0xFF; int DB[3]=0,0,0; volatile unsigned int Data0,Data1,Data2,i,Start_Value0,CompWindow; int displacement=10, Start_Value1,sync,DataLength; int RxData[5]; //sets number of data words (max datalength = #of Rxdata+2 (EX 5+2)) const int ID=0x55; int Time=0; int TxRx; // 1= TX mode 2=Rx Mode used as a flag int ii; void RTx_Initialization(void); int KeyPad (void); void LCD_Init(void); void LCD_Write(char string[]); void LCD_CLR(void); void LCD_CRWrite(int command); void LCD_NewLine(void); void LCD_Left(int spaces); void LCD_Right(int spaces); void LCD_DisplayLeft(int spaces); void LCD_DisplayRight(int spaces); void LCD_Display(int CHAR); //Display the last value of keypress only works for numeric values void Data_Initialization(void); // set default values int Hex_to_Dec(int Hex); void VentControl (Room Room_X); ////////////////////////////////////////////////////////////////////////////////// // Program void main (void)
26 Page 26/42 WDTCTL =WDTPW + WDTHOLD; //Disable Watchdog BCSCTL1 = CALBC1_1MHZ; // Set DCO DCOCTL = CALDCO_1MHZ; DCOCTL = 0xA8; // manual calibration BCSCTL2 = 0x06; // MCLK=DCO/0 SMLCK=DCO/8 P3SEL=0x0E; //mux SPI to P3.4 and 3.5 P2DIR=0xFF; TACCTL0 = CCIE; // CCR0 interrupt enabled TACCR0 = 1250; // Prescale for 1MHz corresponds to 10 millisecond TACTL = TASSEL_2 + MC_1 + ID_0; // SMCLK/1, upmode //P2OUT = 0x01; //DEBUG CODE ERASE ME RTx_Initialization(); Data_Initialization(); LCD_Init(); //***********************Status Screen****************************************** STATUS: LCD_CLR(); LCD_Write("Room A ~"); TMP[2]=Hex_to_Dec(Room_A.Current_Temp); TMP[0]=(TMP[2] & 0xF0)>> 4; TMP[1]=TMP[2] & 0xF; LCD_Display(TMP[0]); LCD_Display(TMP[1]); LCD_Write(" ~"); // leave a space LCD_Write("Room B ~"); TMP[2]=Hex_to_Dec(Room_B.Current_Temp); TMP[0]=(TMP[2] & 0xF0)>> 4; TMP[1]=TMP[2] & 0xF; LCD_Display(TMP[0]); LCD_Display(TMP[1]); LCD_NewLine(); LCD_Write("Room C ~"); TMP[2]=Hex_to_Dec(Room_C.Current_Temp); TMP[0]=(TMP[2] & 0xF0)>> 4; TMP[1]=TMP[2] & 0xF; LCD_Display(TMP[0]);
27 Page 27/42 LCD_Display(TMP[1]); LCD_Write(" Press *~"); REFRESH: //LCD Refresh LCD_CRWrite(0x0C); LCD_CRWrite(0x02); //back to home LCD_Right(7); TMP[2]=Hex_to_Dec(Room_A.Current_Temp); TMP[0]=(TMP[2] & 0xF0)>> 4; TMP[1]=TMP[2] & 0xF; LCD_Display(TMP[0]); LCD_Display(TMP[1]); // LCD_Right(2); LCD_Right(8); TMP[2]=Hex_to_Dec(Room_B.Current_Temp); TMP[0]=(TMP[2] & 0xF0)>> 4; TMP[1]=TMP[2] & 0xF; LCD_Display(TMP[0]); LCD_Display(TMP[1]); LCD_NewLine(); LCD_Right(7); TMP[2]=Hex_to_Dec(Room_C.Current_Temp); TMP[0]=(TMP[2] & 0xF0)>> 4; TMP[1]=TMP[2] & 0xF; LCD_Display(TMP[0]); LCD_Display(TMP[1]); LCD_CRWrite(0xF0); //******************************************************************************* //***********************Heat/Cool Screen**************************************** _delay_cycles(1000); for (ii=0;ii<5;ii++) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released int iii; for (iii=0;iii<2000;iii++) //Keys have been released now scan for new keypress KeyPad(); // if (KeyPress == 0xE) //scanning for these keys
28 Page 28/42 goto NEXT1; goto REFRESH; //valid data entered go to label NEXT1: LCD_CLR(); LCD_Write("(1)Cool or (2)Heat~"); LCD_NewLine(); LCD_Write("rooms?~"); _delay_cycles(1000); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); if (KeyPress == 0x1 ) //scanning for these keys goto COOL; //valid data entered go to label else if (KeyPress == 0x2) goto HEAT; COOL: Sys.Mode=-1; LCD_CLR(); LCD_Write("Set to Cool~"); LCD_NewLine(); LCD_Write("Press * to Continue~"); goto NEXT2; HEAT:
29 Page 29/42 Sys.Mode=1; LCD_CLR(); LCD_Write("Set to Heat~"); LCD_NewLine(); LCD_Write("Press * to Continue~"); goto NEXT2; NEXT2: _delay_cycles(1000); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); // if (KeyPress == 0xE) //scanning for these keys goto ROOM; //valid data entered go to label //************************************************************************** //*********************Room Selection*************************************** ROOM: LCD_CLR(); LCD_Write("Enter Room Letter~"); LCD_NewLine(); LCD_Write("(A,B,C)~"); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); if (KeyPress == 0xA ) //scanning for these keys goto ROOMA; //valid data entered go to label
30 Page 30/42 else if (KeyPress == 0xB) goto ROOMB; else if (KeyPress == 0xC) goto ROOMC; ROOMA: LCD_CLR(); LCD_Write("Room A Selected~"); LCD_NewLine(); LCD_Write("Press * to Continue~"); TMP[0]=0xA; goto NEXT3; ROOMB: LCD_CLR(); LCD_Write("Room B Selected~"); LCD_NewLine(); LCD_Write("Press * to Continue~"); TMP[0]=0xB; goto NEXT3; ROOMC: LCD_CLR(); LCD_Write("Room C Selected~"); LCD_NewLine(); LCD_Write("Press * to Continue~"); TMP[0]=0xC; goto NEXT3; NEXT3: _delay_cycles(1000); while (1)
31 Page 31/42 KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); // if (KeyPress == 0xE) //scanning for these keys goto TEMP; //valid data entered go to label //************************************************************************** //***************Temperature Input****************************************** TEMP: LCD_CLR(); LCD_Write("Input Room Temp: ~"); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); // if (KeyPress == 1 KeyPress == 2 KeyPress == 3 KeyPress == 4 KeyPress == 5 KeyPress == 6 KeyPress == 7 KeyPress == 8 KeyPress == 9 KeyPress == 0 ) //scanning for these keys goto ET1; //valid data entered go to label ET1: TMP[1]=KeyPress * 10; LCD_Display(KeyPress); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress
32 Page 32/42 KeyPad(); // if (KeyPress == 1 KeyPress == 2 KeyPress == 3 KeyPress == 4 KeyPress == 5 KeyPress == 6 KeyPress == 7 KeyPress == 8 KeyPress == 9 KeyPress == 0 ) //scanning for these keys goto ET2; //valid data entered go to label ET2: TMP[1] = TMP[1] + KeyPress; LCD_Display(KeyPress); LCD_NewLine(); LCD_Write("Press * To Continue~"); goto NEXT4; //Data Values will be changed once temp is confirmed NEXT4: _delay_cycles(1000); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); // if (KeyPress == 0xE) //scanning for these keys goto CONFIG; //valid data entered go to label //****************************************************************** //***************Configure Another Room***************************** CONFIG: //Desired Temperature Confirmed Update Data if(tmp[0]==0xa)room_a.set_temp=tmp[1];
33 Page 33/42 else if(tmp[0]==0xb)room_b.set_temp=tmp[1]; else if(tmp[0]==0xc)room_c.set_temp=tmp[1]; else if(tmp[0]==0xd)room_d.set_temp=tmp[1]; LCD_CLR(); LCD_Write("Config. Another Room?~"); LCD_NewLine(); LCD_Write("(1)Yes (2)No~"); while (1) KeyPad(); //Scan if (KeyPress==0xff) //Check to see if keys have been released while (1) //Keys have been released now scan for new keypress KeyPad(); if (KeyPress == 0x1 ) //scanning for these keys goto ROOM; //valid data entered go to label else if (KeyPress == 0x2) goto STATUS; //********************************************************** ///////////////////////////////////////////////////////////////////////////////////////////////// // FUNCTIONS int Hex_to_Dec(int Hex) int D1=0;
34 Page 34/42 while (Hex > 9) Hex=Hex-10; D1++; D1= D1 << 4; D1=(D1+Hex); return D1; void Data_Initialization(void) Room_A.Set_Temp=00; Room_A.Current_Temp=00; Room_B.Set_Temp=00; Room_B.Current_Temp=00; Room_C.Set_Temp=00; Room_C.Current_Temp=00; Room_D.Set_Temp=00; Room_D.Current_Temp=00; void LCD_Display(int CHAR) CHAR=CHAR+0x30; _delay_cycles(2000); NIB = CHAR & 0xF0; NIB = NIB >> 1; P1OUT = NIB 0x01; P1OUT = NIB 0x05; P1OUT = NIB 0x01; //0XXX X001 //0XXX X101 //0XXX X001 _delay_cycles(2000); NIB = CHAR & 0x0F; NIB = NIB << 3; P1OUT = NIB 0x01; P1OUT = NIB 0x05; P1OUT = NIB 0x01; //0XXX X001 //0XXX X101 //0XXX X001 void LCD_Left(int spaces) int LCD_i; for(lcd_i=0;lcd_i<spaces; LCD_i++) LCD_CRWrite(0x10);
35 Page 35/42 void LCD_Right(int spaces) int LCD_i; for(lcd_i=0;lcd_i<spaces; LCD_i++) LCD_CRWrite(0x14); void LCD_DisplayRight(int spaces) int LCD_i; for(lcd_i=0;lcd_i<spaces; LCD_i++) LCD_CRWrite(0x1C); void LCD_DisplayLeft(int spaces) int LCD_i; for(lcd_i=0;lcd_i<spaces; LCD_i++) LCD_CRWrite(0x18); void LCD_NewLine(void) LCD_CRWrite(0xC0); void LCD_CLR(void) LCD_CRWrite(0x01); void LCD_CRWrite(int command) _delay_cycles(2000); NIB = command & 0xF0; NIB = NIB >> 1; P1OUT = NIB 0x00; //0XXX X000 P1OUT = NIB 0x04; //0XXX X100 P1OUT = NIB 0x00; //0XXX X000 _delay_cycles(2000);
36 Page 36/42 NIB = command & 0x0F; NIB = NIB << 3; P1OUT = NIB 0x00; P1OUT = NIB 0x04; P1OUT = NIB 0x00; //0XXX X000 //0XXX X100 //0XXX X000 void LCD_Write(char string[]) int LCD_i=0; CHAR=string[0]; //initial value // NOTE LCD_i being used as a breakout condition MAX LENGTH =100 for (LCD_i=1; (CHAR!= '~') && (LCD_i < 100); LCD_i ++) _delay_cycles(2000); NIB = CHAR & 0xF0; NIB = NIB >> 1; P1OUT = NIB 0x01; //0XXX X001 P1OUT = NIB 0x05; //0XXX X101 P1OUT = NIB 0x01; //0XXX X001 _delay_cycles(2000); NIB = CHAR & 0x0F; NIB = NIB << 3; P1OUT = NIB 0x01; P1OUT = NIB 0x05; P1OUT = NIB 0x01; //0XXX X001 //0XXX X101 //0XXX X001 CHAR=string[LCD_i]; void LCD_Init(void) P1DIR=0xFF; LCD_CRWrite(0x33); _delay_cycles(40000); LCD_CRWrite(0x32); _delay_cycles(40000); LCD_CRWrite(0x2C); _delay_cycles(40000); LCD_CRWrite(0x0F); _delay_cycles(40000); LCD_CRWrite(0x01); _delay_cycles(40000); int KeyPad(void)
37 Page 37/42 KeyPress=0xFF; P4DIR=0x0F; P4OUT = BIT0; //R1 high if (0x11 ==P4IN) KeyPress=1; else if (0x21==P4IN) KeyPress=2; else if (0x41==P4IN) KeyPress=3; else if (0x81==P4IN) KeyPress=0xA; P4OUT = BIT1; if (0x12 ==P4IN) KeyPress=4; else if (0x22==P4IN) KeyPress=5; else if (0x42==P4IN) KeyPress=6; else if (0x82==P4IN) KeyPress=0xB; P4OUT = BIT2; if (0x14 ==P4IN) KeyPress=7; else if (0x24==P4IN) KeyPress=8; else if (0x44==P4IN) KeyPress=9; else if (0x84==P4IN) KeyPress=0xC; P4OUT = BIT3; if (0x18 ==P4IN) KeyPress=0xE; else if (0x28==P4IN) KeyPress=0; else if (0x48==P4IN) KeyPress=0xF; else if (0x88==P4IN) KeyPress=0xD; return KeyPress; void RTx_Initialization(void) //USCI SPI mode UCB0CTL1 = UCSWRST; //Reset USCI UCB0CTL0 = UCMSB + UCMST + UCSYNC; // x29 // MSB first, master mode, Asynchronous mode UCB0CTL1 = UCSSEL_2; // CLK=SMCLK UCB0BR0 = 128; IE2 = UCB0RXIE + UCB0TXIE; //USCIA0 interupt enable IFG2 &= 0xF0; //clear USCIA0 and USCIB0 interupt flags UCB0TXBUF=0x10; //transmit something UCB0CTL1 &= 0xFE; //clear restet bit (UCSWRST) _bis_sr_register(gie); //general interupt enable IE2 = UCB0RXIE + UCB0TXIE; //USCIA0 interupt enable Data0=0; //data recieved from SPI Data1=0; //raw data window, conains last 16 Recieved bits (two Recieve interupts) Start_Value0 = 0xFA; //first start byte to check for
38 Page 38/42 Start_Value1= 0x70; //second start byte to check for DataLength = 3; //number of bytes of data in a packet // minimum of 3 (2 start bytes + 1 databyte) sync=0; // has data been synched #pragma vector=usciab0tx_vector interrupt void USCI0TX_ISR (void) // IFG2 &= 0xF0; // DB3=UCA0RXBUF; if (TXC < Preamble_Length) //generate preamble UCB0TXBUF=0x33; TXC++; else if (TXC < (Preamble_Length + DataLength + 2)) // int temp1=preamble_length + DataLength -1; UCB0TXBUF=Data[TXC - Preamble_Length]; //transmit data DB[0]=Data[TXC - Preamble_Length]; // debug TXC++; else TXC=0; DB1++; #pragma vector=usciab0rx_vector interrupt void USCI0RX_ISR (void) Data0=UCB0RXBUF; //transfr data to lower data reg UCB0TXBUF=0x00; //Transmit nothing... would change if module is being used as a tranciever Data1=Data1<<8; //shift over 8 to make room for new data Data1 =Data0 & 0x00FF; //Data1=YYXX whare xx is a value in data 0 and Y is old data if (sync!= 0) //fully or partially synced if (sync == 1) //partially synced; try to fully sync Data2 = Data1 & (0x00FF << displacement); //with last recieved byte end of start code //current recieved byte contains data starting at displacement
39 Page 39/42 Data2 = Data2 >> displacement; if (Data2==Start_Value1) //fully synced (second start value confirmed) ++sync; //reciever and transmitter pair synced (sync > 1 indicates synched status) else sync=0; //start_value0 was probably noise; de-sync else if (sync <= (DataLength+1)) //fully synched, get data out RxData[sync-2]=(Data1 >> displacement) & 0x00FF; sync++; //inc sync else //synch greater than DataLength sync=0; //end synch // write into data structure if appropriate if (RxData[1]==Room_A.SSM_ID) // Room_A sent data Is the data a reasonable temperature Room_A.Current_Temp=RxData[2]; else if (RxData[1]==Room_B.SSM_ID) // Room_A sent data Is the data a reasonable temperature Room_B.Current_Temp=RxData[2]; else if (RxData[1]==Room_C.SSM_ID) // Room_A sent data Is the data a reasonable temperature Room_C.Current_Temp=RxData[2]; else if (RxData[1]==Room_D.SSM_ID) // Room_A sent data Is the data a reasonable temperature Room_D.Current_Temp=RxData[2]; else //not synced for (i=0;i<8;i++) //Checks for start value CompWindow=(Data1 & (0x00FF<<i)); //Creates a floating 8 bit comparison "window" EX 0XX0 if i=4 CompWindow=CompWindow>>i; // Shifts 8 bit comparison window back to lsb EX 00XX if (Start_Value0 == CompWindow) //If start value found, do the following EX 00XX == 00AA displacement=i; //offset from lsb sync=1; break; else sync=0; P1OUT=0x00;
40 Page 40/42 // Timer A0 ISR: #pragma vector = TIMERA0_VECTOR interrupt void Timer_A (void) Time++; if (Time==3000) Time=0; // Counting votes for AC configureation if (Sys.Vote > 0) // P2OUT &= 0xF0 P3OUT =0x10; //change this to pin corresponding to heating relay if (Sys.Vote < 0) P2OUT&=0xEF ; //change this to pin corresponding to cooling relay if (Time==0) P2OUT &= 0xEF; //P2.4 off disable tramsmitter IE2 = UCB0RXIE + UCB0TXIE; if (Time==1500) P2OUT = 0x10; //P2.4 on transmitter enabled IE2 = UCB0TXIE; VentControl(Room_A); /* Data[2]=Room_A.SCM_ID; Data[3]=ID; //CCM ID number if (Room_A.Current_Temp > Room_A.Set_Temp) if (Sys.Mode== -1) //AC on room too hot open vent Data[4]=0xFF; //open vent; Sys.Vote--; //vote for cooling else if (Sys.Mode== 1) //Heat on Room to hot close vent Data[4]=0; //close vent;
41 Page 41/42 Sys.Vote--; //vote for cooling else if (Room_A.Current_Temp < Room_A.Set_Temp) if (Sys.Mode== -1) //AC on room too cold close vent Data[4]=0; //close vent; Sys.Vote++; //vote for heating else if (Sys.Mode== 1) //Heat on Room too cold open vent Data[4]=0xFF; //open vent; Sys.Vote++; //vote for heating */ if (Time==2000) VentControl(Room_B); if (Time==2500) VentControl(Room_C); void VentControl (Room Room_X) //THIS Function Decides Weather to open or close a vent (then copies to Data[]) and votes on AC position Data[2]=Room_X.SCM_ID; Data[3]=ID; //CCM ID number if (Room_X.Current_Temp > Room_X.Set_Temp) if (Sys.Mode== -1) //AC on room too hot open vent Data[4]=0xFF; //open vent; Sys.Vote--; //vote for cooling else if (Sys.Mode== 1) //Heat on Room to hot close vent Data[4]=0; //close vent; Sys.Vote--; //vote for cooling else if (Room_X.Current_Temp < Room_X.Set_Temp) if (Sys.Mode== -1) //AC on room too cold close vent
42 Page 42/42 Data[4]=0; //close vent; Sys.Vote++; //vote for heating else if (Sys.Mode== 1) //Heat on Room too cold open vent Data[4]=0xFF; //open vent; Sys.Vote++; //vote for heating
// Conditions for 9600/4=2400 Baud SW UART, SMCLK = 1MHz #define Bitime_5 0x05*4 // ~ 0.5 bit length + small adjustment #define Bitime 13*4//0x0D
/****************************************************************************** * * * 1. Device starts up in LPM3 + blinking LED to indicate device is alive * + Upon first button press, device transitions
More informationInterfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller
Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller 1 INTRODUCTION The objective of this document is to show how to set up SPI/I2C communication between VTI Technologies CMA3000-D01 digital
More informationEEL 4924 Electrical Engineering Design (Senior Design) Team Baudiophile. Wireless Headphones
EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 25 April 2012 Team Baudiophile Wireless Headphones Team Members: Name: Stephen Brewer Name: Eli Chen Project Abstract Our project
More informationTimers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan
CS4101 嵌入式系統概論 Timers and Clocks Prof. Chung-Ta King Department of Computer Science, Taiwan Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008 Recall the Container Thermometer Container
More informationInterfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller
Interfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller 1 INTRODUCTION The objective of this document is to show how to set up SPI/I2C communication between VTI Technologies CMR3000-D01 digital
More informationFall. Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden. George Mason University
Fall 13 Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden George Mason University Introduction The ECE 511 course gave us the opportunity to team up
More information2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II
2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II Instructor: Dr. Hong Ma Oct. 1, 2007 Structure of MSP430 Program 1. Declarations 2. main() 1. Watch-dog timer servicing 2.
More informationECE PRACTICE EXAM #2 Clocks, Timers, and Digital I/O
ECE2049 -- PRACTICE EXAM #2 Clocks, Timers, and Digital I/O Study HW3, Class Notes, Davies Ch 2.6, 5.8, 8, 9.2-3, 9.7, MSP43F5529 User's Guide Ch 5, 17, 28 Work all problems with your note sheet first
More informationCPE 323: MSP430 Timers
CPE 323: MSP430 Timers Aleksandar Milenkovic Electrical and Computer Engineering The University of Alabama in Huntsville milenka@ece.uah.edu http://www.ece.uah.edu/~milenka Outline Watchdog Timer TimerA
More informationCPE/EE 323 Introduction to Embedded Computer Systems Homework V
CPE/EE 323 Introduction to Embedded Computer Systems Homework V 1(15) 2(15) 3(25) 4(25) 5(20) Total Problem #1 (15 points) Power, Low power systems A sensor platform features a microcontroller, a sensor,
More informationName: Clint Furrer Project Number: TI003 Project Description: Safety Walking Lights. Description:
Description: This project addresses the concern and problem of pedestrians walking with automotive traffic. I walk to and from a bus stop every morning and evening for work. There is usually low light
More informationCPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter
CPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter Aleksandar Milenković Email: milenka@uah.edu Web: http://www.ece.uah.edu/~milenka
More informationLab 1: I/O, timers, interrupts on the ez430-rf2500
Lab 1: I/O, timers, interrupts on the ez430-rf2500 UC Berkeley - EE 290Q Thomas Watteyne January 25, 2010 1 The ez430-rf2500 and its Components 1.1 Crash Course on the MSP430f2274 The heart of this platform
More informationECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code
ECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code Reading for Today: Example code Reading for Next Class: Review all since exam 1 HW #4 (on
More informationWhat is an Interrupt?
MSP430 Interrupts What is an Interrupt? Reaction to something in I/O (human, comm link) Usually asynchronous to processor activities interrupt handler or interrupt service routine (ISR) invoked to take
More informationIn-Depth with MSP430 s New Communication Interfaces
In-Depth with MSP430 s New Communication Interfaces Volker Rzehak MSP430 Systems Engineer Texas Instruments 2006 Texas Instruments Inc, Slide 1 Agenda USCI vs. USI Introduction to USI USI communication
More informationCopyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.
Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015. Copyright 2015 by Stephen
More informationUniversity of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.
University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 04 Timer Interrupts Goals: Learn about Timer Interrupts. Learn how to
More informationLab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan
CS4101 Introduction to Embedded Systems Lab 4: Interrupt Prof. Chung-Ta King Department of Computer Science, Taiwan Introduction In this lab, we will learn interrupts of MSP430 Handling interrupts in MSP430
More informationMSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send)
MSP430 Interrupts What is an Interrupt? Reaction to something in I/O (human, comm link) Usually asynchronous to processor activities interrupt handler or interrupt service routine (ISR) invoked to take
More informationECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT
ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT Reading for Today: User's Guide 1.4, Ch 16 Reading for Next Class: Review all since
More informationHacettepe University
MSP430 Teaching Materials Week 5 FUNDAMENTALS OF INTERFACING AND TIMERS for MSP430 Hacettepe University Elements in Basic MCU Interface Power Source Feeds CPU and peripherals Clock Oscillators System synchronization
More informationCPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12. Instructor: Dr Aleksandar Milenkovic Lecture Notes
CPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12 Instructor: Dr Aleksandar Milenkovic Lecture Notes Outline MSP430: System Architecture ADC12 Module DAC12 Module CPE 323 2 ADC12 Introduction
More informationECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #11: More Clocks and Timers
ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #11: More Clocks and Timers Reading for Today: Davie's Ch 8.3-8.4, 8.9-8.10, User's Guide Ch. 17 Reading for Next Class: User's
More informationCPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview
CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview Aleksandar Milenkovic Electrical and Computer Engineering The University of Alabama in Huntsville milenka@ece.uah.edu
More informationTexas Instruments Mixed Signal Processor Tutorial Abstract
Texas Instruments Mixed Signal Processor Tutorial Abstract This tutorial goes through the process of writing a program that uses buttons to manipulate LEDs. One LED will be hard connected to the output
More informationMSP430. More on MSP430
MSP430 More on MSP430 CodeComposer TI recently launched Code Composer Essentials v3. This IDE s latest version (version 3) supports all available MSP430 devices. The new features of CCE v3 include: - Free
More informationLecture 5: MSP430 Interrupt
ECE342 Intro. to Embedded Systems Lecture 5: MSP430 Interrupt Ying Tang Electrical and Computer Engineering Rowan University 1 How A Computer React to Inputs? Polling: the processor regularly looks at
More informationReading: Davies , 8.3-4, , MSP430x55xx User's Guide Ch. 5,17, MSP430F5529 Launchpad User's Guide
ECE2049 Homework #3 Clocks & Timers (Due Thursday 2/8/18 At the BEGINNING of class) Your homework should be neat and professional looking. You will loose points if your HW is not properly submitted (by
More informationTimer Module Timer A. ReadMeFirst
Timer Module Timer A ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) TimerModule Lecture material 3) PinOutSummary 4) InterruptsVectorTable 5) Source code for screencast Interrupt Review Overview A Timer
More informationReading: Davies , 8.3-4, , MSP430x55xx User's Guide Ch. 5,17
ECE2049 Homework #3 Clocks & Timers (Due Tuesday 9/19/17 At the BEGINNING of class) Your homework should be neat and professional looking. You will loose points if your HW is not properly submitted (by
More information4 Degrees of Freedom MEMS Sensor Improvements
4 Degrees of Freedom MEMS Sensor Improvements Design Document Name: Xin Zhou Yue Zhang Team Dec12-09 Ang Lv Nicholas Everett Jenn Grubb Advisor: Degang Chen Client: Bee Line Company Bob Last Updated: Dec
More informationHacettepe University
MSP430 Teaching Materials Week 5 FUNDAMENTALS OF INTERFACING AND TIMERS for MSP430 Hacettepe University Elements in Basic MCU Interface Power Source Feeds CPU and peripherals Clock Oscillators System synchronization
More informationUniversity of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.
University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 08 UART Communication Goals: Learn about UART Communication and the
More informationBlock diagram of processor (Harvard)
Block diagram of processor (Harvard) Register transfer view of Harvard architecture Separate busses for instruction memory and data memory Example: PIC 16 load path OP REG AC 16 16 store path rd wr data
More informationInterrupts CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan
CS4101 嵌入式系統概論 Interrupts Prof. Chung-Ta King Department of Computer Science, Taiwan Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008 Inside MSP430 (MSP430G2551) 1 Introduction
More informationTexas Instruments Microcontroller HOW-TO GUIDE Interfacing Keypad with MSP430F5529
Texas Instruments Microcontroller HOW-TO GUIDE Interfacing Keypad with MSP430F5529 Contents at a Glance PS PRIMER MSP430 kit... 3 Keypad... 4 Interfacing keypad... 4 Interfacing keypad with MSP430F5529...
More informationECE2049: Embedded Computing in Engineering Design C Term Spring 2018
ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #19: Using SPI The LCD Screen and DAC Reading for Today: User's Manual Ch 35, Davies 101.5, DAC datasheet Reading for Next Class:
More informationUniversity of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.
University of Texas at El Paso Electrical and Computer Engineering Department EE 3176 Laboratory for Microprocessors I Fall 2016 LAB 06 Analog to Digital Conversion Goals: Bonus: Pre Lab Questions: Display
More informationUsing peripherals on the MSP430 (if time)
Today's Plan: Announcements Review Activities 1&2 Programming in C Using peripherals on the MSP430 (if time) Activity 3 Announcements: Midterm coming on Feb 9. Will need to write simple programs in C and/or
More informationMSP430F149 P3.4/UTXD0 P3.5/URXD0 P1.5 P1.6 P1.7 MSP430F149 P1.0 P5.4 P5.3 P5.2 P5.1. Figure B-1. BSL Replicator Block Diagram
Appendix B Appendix B MSP430 BSL Replicator Author: Greg Morton, MSP430 Applications B.1 BSL Replicator Overview The BSL Replicator application, executing on a host MSP430F149 device, uses the BSL protocol
More informationLab 4 Interrupts ReadMeFirst
Lab 4 Interrupts ReadMeFirst Lab Folder Content 1) ReadMeFirst 2) Interrupt Vector Table 3) Pin out Summary Objectives Understand how interrupts work Learn to program Interrupt Service Routines in C Language
More informationCommunication methods
Communication methods Communication methods Media and signalling conventions used to transmit data between digital devices Different physical layers methods including: wires, radio frequency (RF), optical
More informationECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #15: More ADC Examples
ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #15: More ADC Examples Reading for Today: TI example code Reading for Next Class: Users Guide 6.2, Davies Ch 6.6-6.9 HW #4 (on
More informationEmbedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory
Embedded Systems 3. Hardware Software Interface Lothar Thiele Computer Engineering and Networks Laboratory Do you Remember? 3 2 3 3 High Level Physical View 3 4 High Level Physical View 3 5 What you will
More informationGetting Started with the MSP430 LaunchPad
Getting Started with the MSP430 LaunchPad Student Guide and Lab Manual Revision 2.01 February 2012 Technical Training Organization Important Notice Important Notice Texas Instruments and its subsidiaries
More informationWeatherSense. EEL4924 Final Design Report. Justin Mills. April 23 rd, 2013
WeatherSense EEL4924 Justin Mills April 23 rd, 2013 Table of Contents Introduction/Project Summary.................................................... 4 Project Features/Objectives.......................................................
More informationCPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B
CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B Aleksandar Milenković Email: milenka@uah.edu Web: http://www.ece.uah.edu/~milenka Objective This
More informationECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)
ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class) Your homework should be neat and professional looking. You will loose points if your HW is not properly
More informationAsservissement en température numérique d'une cavité ultra-stable au LPL pour le Strontium
Asservissement en température numérique d'une cavité ultra-stable au LPL pour le Strontium condition de stabilité +/- 10mK Résultas obtenus : 1mk sur la journée Compte tenu des constantes de temps d'intégration
More informationDesigning for Ultra-Low Power with MSP430
Designing for Ultra-Low Power with MSP430 Christian Hernitscheck MSP430 FAE Europe Texas Instruments 2006 Texas Instruments Inc, Slide 1 Agenda Introduction to Ultra-Low Power Looking for Ultra-Low Power
More informationMonitoring System for a Laundry System with ez430-rf2500 Development Kit
Monitoring System for a Laundry System with ez430-rf2500 Development Kit E90 Senior Design Project David Kwon Department of Engineering Advised by Professor Molter May 08, 2009 Abstract Monitoring system
More informationLogosol Joystick Node LS-731
Features 2 and 3 axis models Travel ±20 deg Non contact hall effect joystick Mechanical MTBF 15,000,000 cycles 3 pushbuttons Up to 2 stick pushbuttons 8 LEDs Member of Logosol s distributed motion control
More informationECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide
APPLICATION NOTE MIKE PAPPAS ECE 492 WINTER 2015 GROUP 2 Texas Instruments MSP430-FR5969 12-Bit ADC Setup Guide March 2015 Table of Contents Preface... 3 Pin Assignments... 4 Configuring the ADC... 4 Sampling
More informationvolatile int results[5]; // variables para la interrupcion del acelerometro //Funciones del acelerometro para mandar y recibir información
Anexo A. Código de programación #include #include #include "lcdlib.h" // variables para guardar informacion de los canales analógicos volatile int results[5]; // variables para la interrupcion
More informationCONTENTS: Program 1 in C:
CONTENTS: 1) Program 1 in C (Blink) 2) Program 2 in C (Interrupt ) 3) ADC example 4) Addressing Modes 5) Selected Assembly instructions 6) ADC10 register descriptions Program 1 in C: /* * PHYS319 Lab3
More informationSupporting Information for. Simultaneous Atomic-Level Visualization and High Precision
Electronic Supplementary Material (ESI) for RSC Advances. This journal is The Royal Society of Chemistry 2017 Supporting Information for Simultaneous Atomic-Level Visualization and High Precision Photocurrent
More informationInterrupts, Low Power Modes
Interrupts, Low Power Modes Registers Status Register Interrupts (Chapter 6 in text) A computer has 2 basic ways to react to inputs: 1) polling: The processor regularly looks at the input and reacts as
More informationCPE 323: MSP430 Serial Communication
CPE 323: MSP430 Serial Communication Aleksandar Milenkovic Electrical and Computer Engineering The University of Alabama in Huntsville milenka@ece.uah.edu http://www.ece.uah.edu/~milenka Outline Introduction
More information@databasescaling Wednesday, 18 th April 2013
andyjpb@ashurst.eu.org @databasescaling Wednesday, 18 th April 2013 OSHUG #24 1 / 56 Writing C For Constrained Systems a@jpb.li @databasescaling Wednesday, 18 th April 2013 OSHUG #24 2 / 56 Writing C For
More informationDesign Document. May Logging DC Wattmeter. Team Member: Advisor : Ailing Mei. Collin Christy. Andrew Kom. Client: Chongli Cai
Design Document May13-06 Logging DC Wattmeter Team Member: Ailing Mei Andrew Kom Chongli Cai David Hoffman Advisor : Collin Christy Client: Garmin International Qiaoya Cui 0 Table of Contents EXECUTIVE
More informationECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO
ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #7: More Digital IO Reading for Today: Davies 7.5-7.9, Users Guide Ch 12 Reading for Next Class: Davies 7.5-7.9, Users Guide
More informationWhy embedded systems?
MSP430 Intro Why embedded systems? Big bang-for-the-buck by adding some intelligence to systems. Embedded Systems are ubiquitous. Embedded Systems more common as prices drop, and power decreases. Which
More informationRF Networking With MSP430 & the ez430-rf2500 Session 2 Miguel Morales, MSP430 Applications 6/5/2008 1
RF Networking With MSP430 & the ez430-rf2500 Session 2 Miguel Morales, MSP430 Applications 6/5/2008 1 Agenda Recap of Session 1 Hardware description Session 2 Lab Overview Lab 2.1 Tilt & Ambient Noise
More informationFinal Design Report 19 April Project Title: Pneumatic Exercise Machine
EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 19 April 2011 Project Title: Pneumatic Exercise Machine Team Members: Gino Tozzi Seok Hyun John Yun Project Abstract The goal
More informationNetwork Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,
Network Embedded Systems Sensor Networks Fall 2013 Hardware Marcus Chang, mchang@cs.jhu.edu 1 Embedded Systems Designed to do one or a few dedicated and/or specific functions Embedded as part of a complete
More informationGetting Started with the MSP430 LaunchPad
Getting Started with the MSP430 LaunchPad Student Guide and Lab Manual Revision 1.0 October 2010 Technical Training Organization Important Notice Important Notice Texas Instruments and its subsidiaries
More informationWireless Sensor Networks (WSN)
Wireless Sensor Networks (WSN) Operating Systems M. Schölzel Operating System Tasks Traditional OS Controlling and protecting access to resources (memory, I/O, computing resources) managing their allocation
More informationIn this module we ll take a look at the MSP430 communications modules and the protocols that can be implemented over them.
Communication Introduction In this module we ll take a look at the MSP430 communications modules and the protocols that can be implemented over them. Objectives USART USCI USI MSP430 One Day Workshop -
More information2002 Mixed Signal Products SLAU056B
User s Guide 22 Mixed Signal Products SLAU56B IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements,
More informationAlex Milenkovich 1. CPE/EE 421 Microcomputers: The MSP430 Introduction. Outline
Outline CPE/EE 421 Microcomputers: The MSP430 Introduction Instructor: Dr Aleksandar Milenkovic Lecture Notes MSP430: An Introduction The MSP430 family Technology Roadmap Typical Applications The MSP430
More informationAnalog Peripherals. Introduction. Objectives
Analog Peripherals Introduction In this section we ll take a look at the MSP430 analog peripherals. It s not possible in this limited amount of time to give you a complete overview of the possible analog
More informationSerial Peripheral Interface (SPI) Last updated 8/7/18
Serial Peripheral Interface (SPI) Last updated 8/7/18 MSP432 SPI eusci = enhanced Universal Serial Communications Interface 2 tj MSP432 SPI ARM (AMBA Compliant) 7/8 bit transmission Master/Slave LSB/MSB
More informationIn this module we ll take a look at the MSP430 communications modules and the protocols that can be implemented over them.
Communication Introduction In this module we ll take a look at the MSP430 communications modules and the protocols that can be implemented over them. Objectives USART USCI USI MSP430 One Day Workshop -
More informationIV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2
IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2 1. Block diagram of MSP430x5xx series micro-controller --------------------- 1 2. CPU architecture of MSP430x5xx ------------------------------------------------
More informationSerial Peripheral Interface (SPI)
Serial Peripheral Interface (SPI) MSP432 SPI eusci = enhanced Universal Serial Communications Interface 2 tj MSP432 SPI ARM (AMBA Compliant) 7/8 bit transmission Master/Slave LSB/MSB first Separate RX/TX
More informationECE2049 Homework #4 Analog-to-Digital Conversion and the ADC12 (Due Thursday 2/15/2018 to box outside AK-011 by 9 am)
ECE2049 Homework #4 Analog-to-Digital Conversion and the ADC12 (Due Thursday 2/15/2018 to box outside AK-011 by 9 am) PLEASE (NEATLY) SHOW ALL WORK! Comment all code well. Do not make the grader guess
More informationUSB Connectivity using MSP430 and TUSB3410
USB Connectivity using MSP430 and TUSB3410 Andreas Dannenberg MSP430 Applications Engineer Texas Instruments 2006 Texas Instruments Inc, Slide 1 Agenda Why USB connectivity? TUSB3410 MSP430 overview USB
More informationAFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision )
AFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision 8-27-08) Changes from Version 9.2 1. The communication baud rate is raised to 9600. 2. Testing with
More informationECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #9: Exam Review w/ Solutions
ECE2049: Embedded Computing in Engineering Design A Term Fall 2018 Lecture #9: Exam Review w/ Solutions Reading for Today: Review all reading and notes, Davies Ch 1, 2, 4,7, MSP430 User's Guide Ch 6.1,
More informationMembers: Mark Kampfer, Richard Robinson
DumbleDoor RFID security system Members: Mark Kampfer, Richard Robinson Final Design Report EEL 4924 Electrical Engineering Design 2 Contents List of Figures... 2 Abstract... 2 Introduction... 3 Project
More informationSpecification E2 Interface
Specification E2 Interface Version 4.1 Name Date Created: Robert Mayr. 15.04.2011 Checked: Haider A. 15.04.2011 Approved: Reason for change: Text corrections TABLE OF CONTENTS 1 INTRODUCTION... 3 1.1 Overview..................................................................................................................
More informationECET 491Senior Design Project Title: Wind Speed Data Logger
ECET 491Senior Design Project Title: Wind Speed Data Logger Department of Computer, Electrical, and Information Technology Indiana University-Purdue University Fort Wayne Date: 02/19/2012 Student: Chuck
More informationDeveloper Notes INSTEON Thermostat v012. Developer Notes. INSTEON Thermostat. Revision History
Developer INSTEON Thermostat v012 Developer INSTEON Thermostat Version 012 June 19, 2012 Revision History Rev Date Comments 001 10/28/11 Initial Release 002 11/4/11 Updated formatting in some sections
More informationMSP430F20xx Device Erratasheet
Errata MSP430F20xx Device Erratasheet 1 Current Version Devices Rev: BCL12 CPU4 FLASH16 SDA3 TA12 TA16 TA22 USI4 USI5 XOSC5 XOSC8 MSP430F2001 D ü ü ü ü ü ü ü ü MSP430F2011 D ü ü ü ü ü ü ü ü MSP430F2002
More informationCN310 Microprocessor Systems Design
CN310 Microprocessor Systems Design Microcontroller Nawin Somyat Department of Electrical and Computer Engineering Thammasat University Outline Course Contents 1 Introduction 2 Simple Computer 3 Microprocessor
More informationTwo Wire Interface (TWI) also commonly called I2C
(TWI) also commonly called I2C MSP432 I2C 2 tj MSP432 I2C ARM (AMBA Compliant) 8 bit transmission word 7/10 bit addressing Multi-master/slave modes 4 slave addresses 4 eusci-b modules 3 tj Overview 8 bit
More informationHands-On: Implementing an RF link with MSP430 and CC1100
Hands-On: Implementing an RF link with MSP430 and CC1100 Keith Quiring MSP430 Applications Engineer Texas Instruments 2006 Texas Instruments Inc, Slide 1 Overview Introduction Target Hardware Library File
More information5xx Active & Low Power Mode Operation
5xx Active & Low Power Mode Operation 38 Lab 2: ULP Operation Lab Goals Learn ULP Best Practices Learn & understand how to configure two key modules of the 5xx to achieve ultra-low power operation. Power
More informationGetting Started with the Texas Instruments ez430
1 of 6 03.01.2009 01:33 HOME Running Your Code>> Getting Started with the Texas Instruments ez430 Working with the Workbench Software Step 1: Each program needs an associated project. The project includes
More informationECE2049-E18 Lecture 6 Notes 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review
ECE2049-E18 Lecture 6 Notes 1 ECE2049: Embedded Computing in Engineering Design E Term 2018 Lecture #6: Exam Review Administrivia Exam 1: Next Tuesday (6/5) HW4: Short assignment, due Tuesday Lab 1: Due
More informationECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:
ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives: This lab will introduce basic embedded systems programming concepts by familiarizing the user with an embedded programming
More informationPIC-I/O Multifunction I/O Controller
J R KERR AUTOMATION ENGINEERING PIC-I/O Multifunction I/O Controller The PIC-I/O multifunction I/O controller is compatible with the PIC-SERVO and PIC-STEP motor control modules and provides the following
More informationFinal Design Report. Project Title: Automatic Storm Shutters. Team Name: Make It Rain
EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 4 August 2009 Project Title: Automatic Storm Shutters Team Name: Make It Rain Team Members: Name: Kyle Weber Name: Zachary Wernlund
More informationC Language Programming through the ADC and the MSP430 (ESCAPE)
OpenStax-CNX module: m46087 1 C Language Programming through the ADC and the MSP430 (ESCAPE) Matthew Johnson Based on C Language Programming through the ADC and the MSP430 by Matthew Johnson This work
More informationLecture test next week
Lecture test next week Write a short program in Assembler doing. You will be given the print outs of all the assembler programs from the manual You can bring any notes you want Today: Announcements General
More informationOEM-ORP ORP. Reads mV mV. Range. 1 reading every 420ms. Response time. Any type & brand. Supported probes. Single point.
V 2.3 Revised /23/18 OEM-ORP Embedded ORP Circuit Reads Range Response time ORP -19.9mV 19.9mV 1 reading every 420ms Supported probes Calibration Temp compensation Data protocol Default I 2 C address Operating
More informationEmprog. Quick Start Guide. Emprog ThunderBench MSP430 FAQ. Version 1.2. Nov Page 1
Emprog ThunderBench MSP430 FAQ Version 1.2 Nov 2014 Page 1 TI MSP430 General FAQ This guide is a quick overview and FAQ related to the Texas Instruments MSP430. If you have any question that is not covered
More informationprinted copy of today s lecture slides Last one out should close the lab door!!!! Please keep the lab clean and organized.
EECS 452 Lecture 23 Today: Handouts: TI MSP430 and Piccolo. printed copy of today s lecture slides Read: about DSP! References: Last one out should close the lab door!!!! Please keep the lab clean and
More informationSMART CONNECTION TO SMART HOME VENTO
SMART CONNECTION TO SMART HOME VENTO Expert A50- W VENTO Expert Duo A30- W EN OPERATION MANUAL VENTO Expert www.blaubergventilatoren.de CONTENTS Purpose...2 Network parameters...3 Control commands...3
More information