![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced Member | Hi , Ive read somewhere about how to output data from a MCU to LCD or 7 seg display as follow: The data from MCU normally is in hex, we convert it into BCD (so that each digit is represented as 4 binary), and this BCD is used to index off the look up table to LCD or 7 seg. The table is like follow: (Blank, 0-9) TABLE FCB $7E, $30, $6D, $79, $33, $5B, $5F, $70, $7F, $73, $00 END How these hex number can be used to display in LCD? I ve checked the ASCII table, cant find anyone of them fits. Also, is the table for LCD and 7 seg different? How we can move along the table? Is table recommended? Thanks |
| | |
| | (permalink) | ||
| Super Moderator | Quote:
What you need to do is convert the binary number to it's decimal equivilent - if you look at some of my tutorials (the Analogue input one is one which does it) they include a routine called 'Convert'. This routine (which I downloaded from the PICList) takes a two byte binary number (NumL and NumH) and converts it to five decimal digits - ones, tens etc. I then print it on the LCD using a routine called 'LCD_CharD' which converts the digit to ASCII and prints it on the LCD. My 7 segment LED tutorial shows how to use a table to drive a 7 segment LED. Quote:
| ||
| | |
| | (permalink) |
| Experienced Member | Oh, let me sumaries it. So with LCD: we convert binary to decimal -> pass it into LCD driver with 7 seg display: binary to lookup table of 7 seg codes Please correct me if I am wrong. Thanks PS: I will read more the tut. |
| | |
| | (permalink) | |
| Super Moderator | Quote:
| |
| | |