7STK500_bit-bang - STK 500 and Bit Banging Details Source:

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STK 500 and Bit Banging Details Source: http://www.atmel.com/dyn/resources/prod_documents/doc1925.pdf BJ Furman | ME 106 Intro to Mechatronics | STK 500 and Bit Banging Details.doc | 20FEB2007 Page 1 of 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Bit Banging Details Excerpted from Eric Weddington’s ‘Programming 101’ post in AVRfreaks forum 04OCT2002 http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=40348&highlight=programming+101#40348 Bitwise Operators | bitwise OR & bitwise AND ~ bitwise NOT ^ bitwise EXCLUSIVE OR (XOR) << bit LEFT SHIFT (syntax: quantity_to_shift_left << how_far_to_shift_it) >> bit RIGHT SHIFT (syntax: quantity_to_shift_right >> how_far_to_shift_it) Setting a Bit (i.e., making a particular bit ‘1’) unsigned char test123=0xFE; test123 |= 0x01; // sets bit 0: result = __________________ // same as test123=test123 | 0x01; The value 0x01 is called a ‘bit mask’ Clearing a Bit (i.e., making a particular bit ‘0’) unsigned char test123=0xFE; test123 &= ~0x04; // clears bit 2: result = _____________________
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/08/2010 for the course EE 106 at San Jose State University .

Page1 / 3

7STK500_bit-bang - STK 500 and Bit Banging Details Source:

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online