<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6927351</id><updated>2012-01-09T00:50:44.411-08:00</updated><category term='arduino'/><category term='serial'/><category term='isp'/><category term='heroic rescues'/><category term='icsp'/><category term='st9720'/><category term='lcd'/><category term='freeduino'/><category term='vacation'/><category term='electronics'/><title type='text'>(parenthetic)</title><subtitle type='html'>(enriching commentary, parallel speculations, asides, peripheral conceptualizations, and additional interpretations)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://parenthetic.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://parenthetic.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>alang</name><uri>http://www.blogger.com/profile/18257043690169788508</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6927351.post-2394812403127527164</id><published>2012-01-09T00:17:00.000-08:00</published><updated>2012-01-09T00:50:44.424-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='electronics'/><category scheme='http://www.blogger.com/atom/ns#' term='arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='vacation'/><category scheme='http://www.blogger.com/atom/ns#' term='freeduino'/><category scheme='http://www.blogger.com/atom/ns#' term='isp'/><category scheme='http://www.blogger.com/atom/ns#' term='icsp'/><category scheme='http://www.blogger.com/atom/ns#' term='heroic rescues'/><title type='text'>Arduino as ISP</title><content type='html'>I just burned a &lt;a href="http://arduino.cc/en/Hacking/Bootloader" target="_blank"&gt;bootloader&lt;/a&gt; onto an Arduino, using another Arduino as an &lt;a href="http://en.wikipedia.org/wiki/Atmel_AVR#ISP" target="_blank"&gt;In System Programmer&lt;/a&gt; or ISP. The instructions for doing this are on&amp;nbsp;&lt;a href="http://arduino.cc/en/Tutorial/ArduinoISP"&gt;http://arduino.cc/en/Tutorial/ArduinoISP&lt;/a&gt;. All the required software is included in the standard Arduino IDE download, and the only hardware needed is a bunch of wires.&lt;br /&gt;&lt;br /&gt;When assembled it looked like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-IB2WWR50I9A/TwqmNetpyDI/AAAAAAAAAIw/3QDcEwnzVSI/s1600/2arduino.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-IB2WWR50I9A/TwqmNetpyDI/AAAAAAAAAIw/3QDcEwnzVSI/s1600/2arduino.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.freetronics.com/products/twentyten" target="_blank"&gt;Freetronics TwentyTen&lt;/a&gt; on the left is the programmer and the &lt;a href="http://store.nkcelectronics.com/freeduino-arduino-diecimila-compatible-board-complete-kit.html" target="_blank"&gt;NKC Electronics Freeduino&lt;/a&gt; on the right is being programmed. The wires are braided together to make them easier to manage. On the left, they're soldered to header pins. On the right they're soldered to the end six pins of an 8x2 header pin socket I had lying around.&lt;br /&gt;&lt;br /&gt;It turns out that everything Just Worked. After the Freeduino had a bootloader programmed, the Freeduino was able to download sketches like an Arduino should. Hooray.&lt;br /&gt;&lt;br /&gt;You may wonder how one ends up messing around with boot loaders. If you weren't wondering, or you prefer concise stories, you can stop reading now.&lt;br /&gt;&lt;br /&gt;I bought two &lt;a href="http://littlebirdelectronics.com/products/freeduino-usb-complete-kit" target="_blank"&gt;Freeduino kits from Little Bird Electronics&lt;/a&gt;. The idea of soldering up my own Arduino was attractive, and they're cheap enough that I could buy two. Of course, the first one I assembled didn't work.&lt;br /&gt;&lt;br /&gt;My development PC would recognize the Freeduino when it was plugged in, and I could get it to echo characters by removing the CPU and bridging the TX and RX pins. That meant that the FTDI chip was OK. However, it would not allow sketches to be uploaded and pressing the reset button did nothing.&amp;nbsp;An hour of probing with a multi-meter didn't reveal any bad joints either.&lt;br /&gt;&lt;br /&gt;I decided to be both brave and hopeful and assemble the second one. Same result.&lt;br /&gt;&lt;br /&gt;Searching for the avrdude error message "resp 0x00" leads to ladyada's &lt;a href="http://www.ladyada.net/learn/arduino/help.html" target="_blank"&gt;"&lt;span style="background-color: white; font-family: inherit;"&gt;HHHHHEEEEEEEEEEEEEEEEEEEEEEEELLLLLLLLLPPPPPPPPPPPPP!" page&lt;/span&gt;&lt;/a&gt;&amp;nbsp;which indicated that a bad or missing bootloader was the likely cause.&lt;br /&gt;&lt;br /&gt;Once again being brave and hopeful, I moved the 328P from my working Freetronics Arduino to one of the Freeduinos, and - to my amazement - it happily downloaded and ran the blink sketch. Great.&lt;br /&gt;&lt;br /&gt;At that point it was clear that I either the 328Ps shipped with the Freeduinos were both bad (not likely) or that they had incorrect or missing bootloaders (more likely). I recalled that it was possible to use an Arduino to program other Arduinos, though I didn't realize how simple it was :)&lt;br /&gt;&lt;br /&gt;And that's how I ended up burning a bootloader onto an Arduino via another Arduino.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6927351-2394812403127527164?l=parenthetic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://parenthetic.blogspot.com/feeds/2394812403127527164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6927351&amp;postID=2394812403127527164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default/2394812403127527164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default/2394812403127527164'/><link rel='alternate' type='text/html' href='http://parenthetic.blogspot.com/2012/01/arduino-as-isp.html' title='Arduino as ISP'/><author><name>alang</name><uri>http://www.blogger.com/profile/18257043690169788508</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-IB2WWR50I9A/TwqmNetpyDI/AAAAAAAAAIw/3QDcEwnzVSI/s72-c/2arduino.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6927351.post-7096637168237704892</id><published>2012-01-04T22:31:00.000-08:00</published><updated>2012-01-09T00:46:02.731-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='electronics'/><category scheme='http://www.blogger.com/atom/ns#' term='arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='vacation'/><category scheme='http://www.blogger.com/atom/ns#' term='lcd'/><category scheme='http://www.blogger.com/atom/ns#' term='st9720'/><category scheme='http://www.blogger.com/atom/ns#' term='serial'/><title type='text'>Qix on LCD</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Graphical LCD panels are no fun without graphics, so here's a picture of the panel from the last post with a &lt;a href="http://en.wikipedia.org/wiki/Qix" target="_blank"&gt;Qix&lt;/a&gt;-like demo.&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hPccKmgp44M/TwVCvGyS0oI/AAAAAAAAAHE/yO5QOnbxzRY/s1600/IMG_20120105_171955.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-hPccKmgp44M/TwVCvGyS0oI/AAAAAAAAAHE/yO5QOnbxzRY/s1600/IMG_20120105_171955.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The code (&lt;a href="https://github.com/alanvgreen/alans-embedded-hacking/blob/2331f8a8a295915fb96f0d25044f58ccac0d3f36/lcd/main.c" target="_blank"&gt;link&lt;/a&gt;) is still all in one file, hosted up at github. It takes a brute-force approach, using 1K of the Arduino's 2K RAM to contain a bitmap of the display's 8192 pixels. This bitmap is then painted onto the screen whenever an update is needed. I arrived at this solution because, using the serial interface, it is not possible to read the contents of the LCD unit's RAM. Since the protocol requires that 16 bits are updated with each memory set operation, drawing a line without erasing other parts of the display would be difficult without knowing what is already on the screen.&lt;br /&gt;&lt;br /&gt;Repainting the display takes on the order of one hundred milliseconds - plenty fast enough for my needs.&lt;br /&gt;&lt;br /&gt;There are a few tricky things I found along the way:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;When the controller is first reset, the LCD unit's graphical display RAM (GDRAM) is full of garbage that needs to be overwritten.&lt;/li&gt;&lt;li&gt;Graphics and text are displayed simultaneously. Therefore, the textual RAM should be cleared before showing graphics.&lt;/li&gt;&lt;li&gt;As seems to be the way with LCD controllers, finding the GDRAM addresses corresponding to any particular pixel is a little challenging. The ST9720 can support much larger displays, and many GDRAM addresses don't correspond to on-screen pixels. The &lt;a href="https://github.com/alanvgreen/alans-embedded-hacking/blob/2331f8a8a295915fb96f0d25044f58ccac0d3f36/lcd/main.c#L120" target="_blank"&gt;display_refresh()&lt;/a&gt; method looks simple, but was the result of much trial and error.&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;The code includes a &lt;a href="https://github.com/alanvgreen/alans-embedded-hacking/blob/2331f8a8a295915fb96f0d25044f58ccac0d3f36/lcd/main.c#L164" target="_blank"&gt;line drawing function&lt;/a&gt; (&lt;a href="http://en.wikipedia.org/wiki/Bresenham's_line_algorithm" target="_blank"&gt;algorithm&lt;/a&gt;) and a &lt;a href="https://github.com/alanvgreen/alans-embedded-hacking/blob/2331f8a8a295915fb96f0d25044f58ccac0d3f36/lcd/main.c#L210" target="_blank"&gt;circle drawing function&lt;/a&gt; (&lt;a href="http://en.wikipedia.org/wiki/Midpoint_circle_algorithm" target="_blank"&gt;algorithm&lt;/a&gt;), it also manipulates the display bitmap directly. That's most of what I'll need for my projects.&lt;br /&gt;&lt;br /&gt;If&amp;nbsp;you wanted to build a full graphics library for the ST9720, a great place to start is &lt;a href="http://code.google.com/p/glcd-arduino/" target="_blank"&gt;glcd-arduino&lt;/a&gt;, a comprehensive library for a range of &lt;a href="http://www.techtoys.com.hk/Displays/JHD12864J/ks0108.pdf" target="_blank"&gt;KS108&lt;/a&gt;&amp;nbsp;devices. It looks like it would be possible to make it work for a serially-connected ST9720 device with a days' hacking, or less.&lt;br /&gt;&lt;br /&gt;I stole the idea of using a 1K buffer from &lt;a href="http://mikenz.geek.nz/blog/1006/mindkits-128x64-graphic-lcd-and-arduino/" target="_blank"&gt;Mike Cochrane&lt;/a&gt;. As he notes, it's a bit crazy to use 1024 of the 328P's 2048 bytes of RAM just for display.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6927351-7096637168237704892?l=parenthetic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://parenthetic.blogspot.com/feeds/7096637168237704892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6927351&amp;postID=7096637168237704892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default/7096637168237704892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default/7096637168237704892'/><link rel='alternate' type='text/html' href='http://parenthetic.blogspot.com/2012/01/qix-on-lcd.html' title='Qix on LCD'/><author><name>alang</name><uri>http://www.blogger.com/profile/18257043690169788508</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-hPccKmgp44M/TwVCvGyS0oI/AAAAAAAAAHE/yO5QOnbxzRY/s72-c/IMG_20120105_171955.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6927351.post-4241241745436252820</id><published>2011-12-29T00:05:00.001-08:00</published><updated>2011-12-29T05:56:32.509-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='electronics'/><category scheme='http://www.blogger.com/atom/ns#' term='arduino'/><category scheme='http://www.blogger.com/atom/ns#' term='vacation'/><category scheme='http://www.blogger.com/atom/ns#' term='st9720'/><category scheme='http://www.blogger.com/atom/ns#' term='serial'/><title type='text'>Hello, World! in Arduino with an st7920 LCD Panel</title><content type='html'>&lt;div&gt;These holidays, I found some time to hack on Arduino. I ordered a &lt;a href="http://littlebirdelectronics.com/products/graphic-lcd-128-x-64"&gt;128x64 graphic LCD panel&lt;/a&gt; from Little Bird and set about hooking it up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="https://lh5.googleusercontent.com/-DQhcxdvvyqQ/Tvwc2ZSbqAI/AAAAAAAAAFk/Q4u0GTZb4Qo/s512/IMG_20111229_184422.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 512px; height: 411px;" src="https://lh5.googleusercontent.com/-DQhcxdvvyqQ/Tvwc2ZSbqAI/AAAAAAAAAFk/Q4u0GTZb4Qo/s512/IMG_20111229_184422.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;After a bit of confusion - I thought I had ordered &lt;a href="http://littlebirdelectronics.com/products/graphic-lcd-128x64-stn-led-backlight"&gt;another part&lt;/a&gt;, with a different chipset - I eventually had the &lt;a href="http://www.crystalfontz.com/controllers/ST7920.pdf"&gt;datasheet for the st9720&lt;/a&gt; controller chip and another &lt;a href="http://read.pudn.com/downloads135/doc/573419/7920.pdf"&gt;datasheet for the panel&lt;/a&gt;. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The controller chip has 8 bit and 4 pit parallel interfaces, as well as a serial interface. I chose the serial option, with serial signal and clock pulses generated by the ATmega328p's SPI unit. The trickiest part was getting the unit reset correctly after power on. I just wired it to PB0, and controlled it from there.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's the source for my first experiment - displaying text. It's C code compiled with the GNU toolchain. Comments are a little sparse, but all the really important information is at the top of the file.&lt;/div&gt;&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px solid #333; padding: 0.5em 1em;"&gt;/*&lt;br /&gt; * Drive an ST7920 LCD module via the serial interface.&lt;br /&gt; *&lt;br /&gt; * Data sheets:&lt;br /&gt; * - 12864ZB module http://read.pudn.com/downloads135/doc/573419/7920.pdf&lt;br /&gt; *   (in Chinese, but Google Translate is helpful)&lt;br /&gt; * - st7920 &lt;br /&gt; *   LCD controller http://www.crystalfontz.com/controllers/ST7920.pdf&lt;br /&gt; * - 328p MCU &lt;br /&gt; *    http://www.atmel.com/dyn/resources/prod_documents/doc8271.pdf&lt;br /&gt; *&lt;br /&gt; * Configuration&lt;br /&gt; * LCD | 328/Arduino&lt;br /&gt; * ------------------------&lt;br /&gt; * GND | GND&lt;br /&gt; * VCC | 5V&lt;br /&gt; * E   | SCLK == PB5 == D13&lt;br /&gt; * RW  | MOSI == PB3 == D11&lt;br /&gt; * RST | PB0 == D8&lt;br /&gt; * RS  | 5V&lt;br /&gt; * A   | 390R to 5V&lt;br /&gt; * K   | GND&lt;br /&gt; *&lt;br /&gt; * Also bridged JP1 and JP2 to use onboard pot for contrast control.&lt;br /&gt; *&lt;br /&gt; * The trickiest part of getting this right was the control of the reset&lt;br /&gt; * pin. I found it quite finicky, and needing to be cycled just-so.&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;#include &amp;lt;util/delay.h&amp;gt;&lt;br /&gt;#include &amp;lt;inttypes.h&amp;gt;&lt;br /&gt;#include &amp;lt;avr/io.h&amp;gt;&lt;br /&gt;#include &amp;lt;avr/pgmspace.h&amp;gt;&lt;br /&gt;&lt;br /&gt;void spi_init(void) {&lt;br /&gt;   // SPI enable, master mode, clock idle high, sample data on trailing &lt;br /&gt;   // edge, Clock Frequency = Fosc / 8 = 2MHz&lt;br /&gt;   SPCR = 0b01011101;&lt;br /&gt;   SPSR = 0b00000001;&lt;br /&gt;&lt;br /&gt;   // Set SS, MISO and PB0 as outputs&lt;br /&gt;   DDRB = 0xff;&lt;br /&gt;   PORTB = 0x1; // set PB0 - nonreset&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void spi_send(int8_t b) {&lt;br /&gt;   SPDR = b;&lt;br /&gt;   while (!(SPSR &amp;amp; 0x80)) {&lt;br /&gt;       // busy wait&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void lcd_instruction(int8_t ins) {&lt;br /&gt;   spi_send(0b11111000); // 5 1 bits, RS = 0, RW = 0&lt;br /&gt;   spi_send(ins &amp;amp; 0xf0);&lt;br /&gt;   spi_send(ins &amp;lt;&amp;lt; 4);     &lt;br /&gt;   _delay_us(72); &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;void lcd_data(int8_t data) {&lt;br /&gt;     spi_send(0b11111010); // 5 1 bits, RS = 1, RW = 0&lt;br /&gt;     spi_send(data &amp;amp; 0xf0);&lt;br /&gt;     spi_send(data &amp;lt;&amp;lt; 4);&lt;br /&gt;     _delay_us(72);&lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;void lcd_set_cursor(int8_t line, int8_t col) {&lt;br /&gt;     // Contrary to the data sheet, the starting addresses for lines &lt;br /&gt;     // 0, 1, 2 and 3 are 80, 90, 88 and 98&lt;br /&gt;     uint8_t d = 0x80 + col;&lt;br /&gt;     if (line &amp;amp; 1) {&lt;br /&gt;         d |= 0x10;&lt;br /&gt;     }&lt;br /&gt;     if (line &amp;amp; 2) {&lt;br /&gt;         d |= 0x8;&lt;br /&gt;     }&lt;br /&gt;     lcd_instruction(d); &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;// Clears the screen &lt;br /&gt;void lcd_clear() {&lt;br /&gt;     lcd_instruction(0b00000001); // clear&lt;br /&gt;     _delay_ms(2); // Needs 1.62ms delay &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;// Reset, as per page 34 of 7920 data sheet &lt;br /&gt;void lcd_reset() {&lt;br /&gt;      // Bring (PB0) low, then high&lt;br /&gt;     PORTB &amp;amp;= ~0x01;&lt;br /&gt;     _delay_ms(1);&lt;br /&gt;     PORTB |= 0x01;&lt;br /&gt;     _delay_ms(10);&lt;br /&gt;     lcd_instruction(0b00110000); // 8 bit data, basic instructions&lt;br /&gt;     lcd_instruction(0b00110000); // 8 bit data, basic instructions&lt;br /&gt;     lcd_instruction(0b00001100); // display on&lt;br /&gt;     lcd_clear();&lt;br /&gt;     lcd_instruction(0b00000110); // increment, no shift &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;static char string_1[] PROGMEM = "Hello, World!";  &lt;br /&gt;&lt;br /&gt;void lcd_send_str_p(PGM_P p) {&lt;br /&gt;     uint8_t b;&lt;br /&gt;     while (b = pgm_read_byte(p), b) {&lt;br /&gt;         lcd_data(b);&lt;br /&gt;         p++;&lt;br /&gt;     } &lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv) {&lt;br /&gt;     spi_init();&lt;br /&gt;     _delay_ms(10);&lt;br /&gt;     lcd_reset();&lt;br /&gt;     uint8_t i = 0;&lt;br /&gt;     while (1) {&lt;br /&gt;       lcd_instruction(0x80);&lt;br /&gt;       for (uint8_t c = 0; c &amp;lt; 64; c++) {&lt;br /&gt;           lcd_data('1' + (c &amp;gt;&amp;gt; 4));&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       _delay_ms(1000);&lt;br /&gt;       lcd_clear();&lt;br /&gt;&lt;br /&gt;       lcd_instruction(0x80);&lt;br /&gt;       for (uint8_t c = 0; c &amp;lt; 64; c++) {&lt;br /&gt;           lcd_data('A' + (c &amp;gt;&amp;gt; 4));&lt;br /&gt;       }&lt;br /&gt;       _delay_ms(1000);&lt;br /&gt;       lcd_clear();&lt;br /&gt;&lt;br /&gt;       lcd_set_cursor(i, i);&lt;br /&gt;       lcd_send_str_p(string_1);&lt;br /&gt;       i = (i + 1) &amp;amp; 3;&lt;br /&gt;       _delay_ms(1000);&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6927351-4241241745436252820?l=parenthetic.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://parenthetic.blogspot.com/feeds/4241241745436252820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6927351&amp;postID=4241241745436252820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default/4241241745436252820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6927351/posts/default/4241241745436252820'/><link rel='alternate' type='text/html' href='http://parenthetic.blogspot.com/2011/12/hello-world-in-arduino-with-st7920-lcd.html' title='Hello, World! in Arduino with an st7920 LCD Panel'/><author><name>alang</name><uri>http://www.blogger.com/profile/18257043690169788508</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh5.googleusercontent.com/-DQhcxdvvyqQ/Tvwc2ZSbqAI/AAAAAAAAAFk/Q4u0GTZb4Qo/s72-c/IMG_20111229_184422.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
