Jun 4, 2013 #1 P pradeep23 Member level 5 Joined Aug 20, 2012 Messages 86 Helped 3 Reputation 6 Reaction score 2 Trophy points 1,288 Activity points 1,866 i want to write embedded c program to add 16 bit number using 8051 microcontroller someone who help to write the program........
i want to write embedded c program to add 16 bit number using 8051 microcontroller someone who help to write the program........
Jun 4, 2013 #2 Z zia Full Member level 5 Joined Sep 24, 2010 Messages 284 Helped 27 Reputation 54 Reaction score 26 Trophy points 1,318 Location Islamabad Pakistan Activity points 2,746 what is the problem unsigned int a=16, b =16; unsigned long result c =0; void main(void) { c = a+b; }
what is the problem unsigned int a=16, b =16; unsigned long result c =0; void main(void) { c = a+b; }
Jun 4, 2013 #3 ragav4456 Full Member level 4 Joined Aug 1, 2012 Messages 228 Helped 19 Reputation 38 Reaction score 17 Trophy points 1,308 Activity points 2,568 Try to learn basics. https://www.engineersgarage.com/
Jun 5, 2013 #4 P pradeep23 Member level 5 Joined Aug 20, 2012 Messages 86 Helped 3 Reputation 6 Reaction score 2 Trophy points 1,288 Activity points 1,866 how can we show the output in keil3 ?
Jun 5, 2013 #5 jayanth.devarayanadurga Banned Joined Dec 4, 2012 Messages 4,280 Helped 822 Reputation 1,654 Reaction score 791 Trophy points 1,393 Location Bangalore, India Activity points 0 Show ouput on what? LCD? GLCD? UART?
Jun 5, 2013 #6 P pradeep23 Member level 5 Joined Aug 20, 2012 Messages 86 Helped 3 Reputation 6 Reaction score 2 Trophy points 1,288 Activity points 1,866 may uart is better or lcd also ok how can i show that ....
Jun 5, 2013 #7 jayanth.devarayanadurga Banned Joined Dec 4, 2012 Messages 4,280 Helped 822 Reputation 1,654 Reaction score 791 Trophy points 1,393 Location Bangalore, India Activity points 0 You have to convert int value to string and then send it to lcd. Do you want the int to string conversion code or LCD Code? If LCD Code. Are you using 8-bit LCD or 4-bit LCD mode?
You have to convert int value to string and then send it to lcd. Do you want the int to string conversion code or LCD Code? If LCD Code. Are you using 8-bit LCD or 4-bit LCD mode?
Jun 5, 2013 #8 Z zia Full Member level 5 Joined Sep 24, 2010 Messages 284 Helped 27 Reputation 54 Reaction score 26 Trophy points 1,318 Location Islamabad Pakistan Activity points 2,746 hi pradeep i think u are absolutly beginers we recommend u to satrt learning from https://www.engineersgarage.com/
hi pradeep i think u are absolutly beginers we recommend u to satrt learning from https://www.engineersgarage.com/
Jun 5, 2013 #9 P pradeep23 Member level 5 Joined Aug 20, 2012 Messages 86 Helped 3 Reputation 6 Reaction score 2 Trophy points 1,288 Activity points 1,866 please help for me how to do like that or can you give some example like that to do... or tell us how to do that program
please help for me how to do like that or can you give some example like that to do... or tell us how to do that program
Jun 5, 2013 #10 jayanth.devarayanadurga Banned Joined Dec 4, 2012 Messages 4,280 Helped 822 Reputation 1,654 Reaction score 791 Trophy points 1,393 Location Bangalore, India Activity points 0 lcd_string() function is an example. You have to change it with your lcd print function. Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 unsigned int op1, op2, result; unsigned char strres[10]; void main(){ result = op1 + op2; strres[0] = result/10000 + 48; strres[1] = (result/1000)%10 + 48; strres[2] = (result/100)%10 + 48; strres[3] = (result/10)%10 + 48; strres[4] = (result/1)%10 + 48; strres[5] = '\0'; lcd_string(strres); }
lcd_string() function is an example. You have to change it with your lcd print function. Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 unsigned int op1, op2, result; unsigned char strres[10]; void main(){ result = op1 + op2; strres[0] = result/10000 + 48; strres[1] = (result/1000)%10 + 48; strres[2] = (result/100)%10 + 48; strres[3] = (result/10)%10 + 48; strres[4] = (result/1)%10 + 48; strres[5] = '\0'; lcd_string(strres); }
Jun 5, 2013 #11 Z zia Full Member level 5 Joined Sep 24, 2010 Messages 284 Helped 27 Reputation 54 Reaction score 26 Trophy points 1,318 Location Islamabad Pakistan Activity points 2,746 google saeedblogspot (a very nice blog from saeed yasin)u wll find many pic and 8051 example