Hello, I have assembly code that calculates a period of a signal and I need the result to be displayed on an LCD,,,HOW CAN I DO THAT? and if any one knows some good websites that might be useful in this case... Thanx.... AA |
|
interfacing 68HC11 with LCD
Started by ●April 15, 2003
Reply by ●April 15, 20032003-04-15
In a message dated 4/15/03 8:54:56 AM Eastern Daylight Time, writes: > I have assembly code that calculates a period of a signal and I need > the result to be displayed on an LCD,,,HOW CAN I DO THAT? and if any > one knows some good websites that might be useful in this case... > Thanx.... > Life's too short to worry about what variable is in what register. Use c. Anyway, the algorithm is the same no matter what language you use... (but with c its already written and in the library ready to use). You want to convert a binary number, say 16 bits, to a bunch of ascii charcters like '1', '2', '3'... so one way is to do it (if the processor has a divide instruction) is to take the number of tenthousands, then get the remainder, then figure out the number of thousands, then get the remainder, then the number of 100s, 10s, the wats left is the units. You do this by doing an integer divide by 10000,1000,100,10... OR you can do repeated subtractions of 10000 in a loop till the answer goes negative, then add one back... thats how many 10000s you have... Phew. So now you have 5 binary numbers.... now you need to send em to the lcd one at a time... I assume you have an lcd that takes ascii characters? Dont forget to add 0x30 to each number to make it ascii..... |