KEG-012 A.K.A. EMMA AND DAVE’S GROUPS Design Projects
Week 1 Recap What (we hope) you learned last week… The Task First Challenge Documenting your journey (wordpress.com)
The Task Race to the wall Week 6: 23/02/2015 Basic kit provided Start on black, hit wall, return to black (AND STOP!) RoboSumo Week 12: 20/04/2015 Good idea to supplement kit provided (max. budget €70) Competition to find and force your opponent off the table, or to avoid being forced off yourself (table is black with a white edge). Last semester’s tournament details can be found below: robosumo-tournament-information/ robosumo-tournament-information/
First Challenge LED Key challenge Basic circuit components MSP430 and LaunchPad MSP430 and LaunchPad C programming C programming Binary Binary Images sourced from and
MSP430 and LaunchPad Device Pinout Connections for programming Power MUST be going to the chip (Vcc) Connect LaunchPad to chip: GND TEST RST Important pins to note: Vcc: ~3.3 V GND (DVss) TEST & RST Inputs/Outputs Port 1: P1.0-P1.7 Port 2: P2.0-P2.7 Image from the datasheet for the MSP430G2452 available at:
C programming Documentation At the start of your code always include something similar to: // // Description of code for MSP430G2553 or MSP430G2452 // Written by NAME last modifed DATE // See // Throughout your code include comments! Include the library for the MSP430 #include Main program int main( void ) { } Disable watchdog timer WDTCTL = WDTPW + WDTHOLD; The watchdog timer is a safety mechanism which will carry out a controlled system restart should a software problem arise. It will reset the system if a specified time interval elapses. We disable this within our program as it is not necessary. Specify pin directions i.e. inputs vs. outputs (P1DIR/P2DIR) Inputs = 0 Outputs = 1 Each bit or pin must be specified. The default is 0 i.e. input. Outputs(P1OUT/P2OUT) It is not possible to just write one single bit/pin. Thus you must specify the full byte e.g. to turn on P1.2 and leave all other pins of port 1 low, you would type P1OUT = 0b ; Delay intervals __delay_cycles(X) Where X is the number of cycles to pause for. For the MSP430G4252 this equates to approximately X microseconds.
Binary Binary is a numbering system just like decimal or hexadecimal. Binarydecimal hexadecimal Instead of counting to the base 10 (decimal) or 16 (hexadecimal), it counts to the base 2. In C programming a binary number is written as: 0bXXXXXXXX Each X refers to an individual bit of the byte of memory for the specific number. Least significant (LSB) vs. most significant (MSB) bit LSB = bit with lowest weighting or value (furthest right) MSB = bit with highest weighting or value (furthest left)
Documenting your journey ALL students MUST maintain a blog of their experiences (wordpress.com) This accounts for part of your grade and should be taken seriously from the start. See more details here: on/ on/ Technical content IS required! Some issues encountered by students last semester have been addressed in the following post: entriesthe-basics/ entriesthe-basics/