![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I can diplay characters on lcd a,b c,d,... by using commands mov A,#'A' acall ,display in 89c2051 but i can't diplay the contents of "timer register" time captured by an event event in decimal. is any conversion required? | |
| |
| | (permalink) | |
| Quote:
>> time captured by an event event in decimal. .....do you mean decimal?
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | ||
| |
| | (permalink) |
| Hmm if I understand your problem, you have an alphanumeric 'character' LCD display. This uses ascii characters. The 'value' for your timer....you say 'decimal', but really whether its binary, decimal or hex depends on how you display it What you need to do is convert the 'single' number from your timer, into binary coded decimal. For example, say your timer value is '172', you must send 3 charaters to the LCD. '1', '7', and '2'. After you have three bytes with the values 1,7 and 2...you must convert this to ASCII. From memory, I think you just have to add '30' (decimal) to the value. Hope that helps, if not, explain your problem in more detail. Blueteeth Edit: Oh you're too quick for me eric...
__________________ Inconsistency is the key to flexibility! | |
| |
| | (permalink) |
| i am using 'jhd 162a' lcd i want to display the pulse width "by an external source measured by the controller) on LCD. I NEED THE COVERSION METHOD | |
| |
| | (permalink) |
| Ok, so I assume your microcontroller has already measured the pulse width and has a value stored in a register? Doesthis value relate to a time-base in anyway? like 'ms' ? The 'CONVERSION METHOD' you need is 'binary to decimal conversion'. Either 8 bit for a single byte (0-255) or 16 bit. Google really is a wonderful thing. Just search for 'BCD' and your microcontrollers part number and I'm sure you will come up with something. BT
__________________ Inconsistency is the key to flexibility! | |
| |
| | (permalink) |
| hi, Whats the maximum value of the number you wish to convert fron binary to bcd/ascii? is it 8bits or 16bits? [I have slowed down blueteeth, let you play catch up
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| |
| | (permalink) |
| My Controller May Contain From 03e8 (1000) To 07d0(2000) Last edited by adnan012; 2nd November 2007 at 03:25 PM. | |
| |
| | (permalink) |
| From 1000 Micro Seconds To 2000 Micro Seconds 16-bit | |
| |
| | (permalink) | |
| Quote:
In that case you require a 16bit binary conversion, which will give 5 bcd digits, just drop the MSD and the add 0x30 to the bcd digits to form the ascii characters. As suggested there are lots of 16bit routines on the web,, if you get a problem come back.
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | ||
| |
| | (permalink) |
| Thanks A Lot | |
| |
| | (permalink) |
| IS THIS CODE WILL WORK FOR ME http://www.8052.com/codelib/bintoasc.asm | |
| |
| | (permalink) | |
| Quote:
>>> Purpose: Routine to convert a 16bit binary number in ASCII
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | ||
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Problem with LCD code? | spondootre | Micro Controllers | 15 | 29th April 2008 10:15 AM |
| Is this display burned out? (Sony MD LCD Display) | Amphr_Moth | General Electronics Chat | 4 | 28th October 2007 07:47 PM |
| calculator | chinmay7 | Micro Controllers | 1 | 14th October 2007 01:45 PM |
| PIC16F628A LCD problems. | HerbertMunch | Micro Controllers | 17 | 2nd October 2007 10:20 AM |
| LCD Troubles | Kyle-s4h | Micro Controllers | 13 | 11th September 2007 01:30 PM |