50% if that is the same as a half then right shifting the register will give you 50% of what you had before. Hope thats what you were after Justin -----Original Message----- From: MATTHEWS, DEAN (D.) [mailto:dmatth14@FORD.COM] Sent: Thursday, 21 February 2002 17:15 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]:working out percentages Hello, I am using a PIC16f877 and CCs compiler. Is there a maths function that will enable me to calculate 50% of an integer variable in a register and store the answer in another variable, or would I calculate it myself. Also is an integer 8 bit or 16 bit long. some books say it is 8bit and others 16 bit. Dean Matthews Reliability Engineering Ford Engine Plant Bridgend Waterton industrial estate cf31 3pj South Wales, U.K Tel No: 0044(1656)672597 Fax No: 0044(1656)672558 Email: dmatth14@ford.com Room 25/118 ` Please consider your environmental responsibility before printing this e-mail -----Original Message----- From: M. Adam Davis [mailto:adampic@UBASICS.COM] Sent: 31 January 2002 14:53 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]:16F877 and LCD Since there seems to be a good bit of interest in this, I'll see about modifying one of my current projects to portB instead of A. The code for the 'f877 with the LCD EN and RS on PORTA, and the data lines on PORTC is here: http://ubasics.com/adam/pic/node.c I don't know when I'll have time to modify it, but you can load it up. The first thing it does is sends "Micro Basics HAT" to the top line of a 16x2 LCD display (should be the top line of any display) then goes on to perform its basic duties (which in this case is measuring pulse length on two pins for a 2-axis acceleraometer). To get it to do anything after that you'll need to rip out all the 'while(accel...)' statements. At that point it'll start displaying 3 hex numbers on the bottom line of a 2 line LCD. If you are only using one line on your LCD, make sure you're initializing it correctly. Check out the numerous website and tutorials on initializing alphanumeric LCD displays. My initialization sets up the display for two lines, and while it shouldn't matter it sometimes can. -Adam Michael Pettersson wrote: >Hello All! > >I'm new with PIC and the 16F877 and have started testing the CC5Xfree from >http://www.bknd.com > >I have a project that I would like to start with but I need a LCD for this. >My first attampts was not succesful and now I need some help. > >Could anyone help me with a LCD 4 bit parallell test software with the >cc5xfree software and against the 16F877 micro? > >Thanks! > >Michael > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads