Shawn, I noticed there is duplicated name in my example. here is the correct one. unsigned int16 tmr0_read; // BYTE tmr0L; BYTE tmr0H; tmr0L=tmr0_read>>8; tmr0H=tmr0_read & 0x00FF; Andre -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Andre Abelian Sent: Wednesday, November 15, 2006 8:25 AM To: Microcontroller discussion list - Public. Subject: RE: [EE] Bit shifting Shawn, you need to use "unsigned long" this is how I did it. unsigned long prg_mem; BYTE prg_meml; BYTE prg_memh; prg_meml=prg_mem>>8; prg_memh=prg_mem & 0x00FF; Andre -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Shawn Wilton Sent: Tuesday, November 14, 2006 6:08 PM To: Microcontroller discussion list - Public. Subject: [EE] Bit shifting OK, I must be doing some ridiculous here and I'm just not catching it. Does anyone see anything wrong with this code: //Set page 103 for details regarding the +2 tmr0l = (unsigned char)65000; tmr0h = (unsigned char)(65000 >> 8); //Right shift so the top byte becomes the bottom byte All I'm trying to do is split the 65000 across the two variables, tmr0L and tmr0H. tmr0L is being assigned correctly the lower 8 bits of the 16 bit value, but the tmr0H is being assigned 0. -- Shawn Wilton (b9 Systems) -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist