I'll give it a shot. On 11/14/06, John Chung wrote: > > > > --- Shawn Wilton wrote: > > > 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. > > > > try this > tmr0l = (unsigned char)(((unsigned short int)65000) & > 0x00FF); > tmr0h = (unsigned char)((((unsigned short int)65000) > & 0xFF00)>>8); > > > John > > -- > > > > 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 > > > > > > > > ____________________________________________________________________________________ > Sponsored Link > > $420k for $1,399/mo. > Think You Pay Too Much For Your Mortgage? > Find Out! www.LowerMyBills.com/lre > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Shawn Wilton (b9 Systems) http://b9Systems.com <- New web page -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist