While the display is being scrolled characters get buffered, and the display then catches up when the scrolling is finished. To avoid needing a large block of identical statements I used these three recursive defines.īy measuring the frequency on the serial pin using the frequency measurement mode on my multimeter I could calculate how long the routine takes to execute. I thought about whether I could use a TimerCounter to do this, but couldnt think of any way to use it to generate an exact number of pulses.ĭetecting overflow of the counter by polling or an interrupt would probably not be precise enough. In my earlier project Tiny Terminal I was able to achieve this with this display its harder because you have to write more data to the display. Its disadvantage is that its asynchronous we cannot tell the transmitting device to pause sending characters, so we have to make sure we process each character before the next one arrives. Return returns the printing position to the start of the next line, calling ScrollDisplay() to scroll the display if necessary.ĭC1, DC2, DC3, and DC4 set the grey level for subsequent characters to 25 grey, 50 grey, 75 grey, and 100 grey respectively. So to write a 6x8 bitmap character to the display you specify the starting row and column, and then write three bytes for each of the eight rows in the character.Ĭurrently the only control characters supported are Return (0x13), and DC1 (0x11) to DC4 (0x14). The scrolling is handled automatically by the displays Display Offset command. When you reach the end of the bottom line of the display it scrolls the display up, just like on a terminal, so you always see the last 8 lines written to the display. These are available from SparkFun 3 or HobbyTronics in the UK 4. The 0.1F capacitor and 33k resistor ensure the display is reset correctly on power-up. The small-signal diode and 10k resistor convert the serial input to 3.3V. It uses the displays built-in hardware scrolling to scroll the display up when the text reaches the end of the last line. The circuit below includes a 3.3V regulator, and a level shifter for the serial input. It allows you to have a text display of eight lines with 42 characters per line, which is just about large enough for reading text, and is ideal for program listings. Both the display and serial input are handled by an 8-pin ATtiny85, and its based on my earlier project Tiny Terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |