--0__=80256A1600345CE18f9e8a93df938690918c80256A1600345CE1 Content-type: text/plain; charset=us-ascii Hi, There is tons of tutorial code on LCDs on various sites (just search for PIC+Hitachi LCD in google)......Most of the trouble I have had is because of initialisation timing issues (and an incorrect early Hitachi data sheet), so observe their minimum timings strictly . Attached is some free PC C LCD driver code from David Tait, just to get the format... (See attached file: testlcd.c) Dan (Embedded Robert Sochon @MITVMA.MIT.EDU> image moved 21/03/2001 09:26 to file: pic31311.pcx) Please respond to pic microcontroller discussion list Sent by: pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: LCD - Can anyone help Security Level:? Internal I am currently trying to use a HD44780 character backlit lcd, but can get no life out of it, it is brand new out of a packet, but despite using a test circuiot and dip switches, it seems that it does not follow a power up routine - despite me trying very hard! It only shows one line when the contrast is up very high, and nothig more - it seems to show no life. DOes anyone have any common problems / recomenmdations to go with these or has anyone shared the same problem? any help will be really greatly a[[preciated as i am totally stuck! Does anyone have any good ideas? Thnk you Robert ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body --0__=80256A1600345CE18f9e8a93df938690918c80256A1600345CE1 Content-type: application/octet-stream; name="testlcd.c" Content-Disposition: attachment; filename="testlcd.c" Content-transfer-encoding: base64 LyoKICogIFRFU1RMQ0QuQwogKgogKiAgVGVzdCBhIEhpdGFjaGkgSEQ0NDc4MCBiYXNlZCBMQ0Qg bW9kdWxlIGJ5IHVzaW5nIHRoZSBQQyBwYXJhbGxlbAogKiAgcG9ydCB0byB3cml0ZSBhIHN0cmlu ZyB0byB0aGUgZGlzcGxheS4gIENvbXBpbGUgd2l0aCBhIEJvcmxhbmQgQwogKiAgb3IgQysrIGNv bXBpbGVyIChET1MgdGFyZ2V0KS4gIFRvIHNpbXBsaWZ5IHRoaW5ncyBsb25nIGRlbGF5cyBhcmUK ICogIHVzZWQgcmF0aGVyIHRoYW4gY2hlY2tpbmcgdGhlIEJVU1kgZmxhZy4gIChOb3RlOiBlYXJs eSB2ZXJzaW9ucyBvZgogKiAgVHVyYm8gQyBoYWQgYSBidWcgaW4gdGhlIGRlbGF5KCkgcm91dGlu ZS4pIAogKgogKgogKiAgVXNhZ2U6CiAqICAgICAgICAgIHRlc3RsY2QgICAgICAgICAgICAgICBw cmludCB0aGUgZGVmYXVsdCBzdHJpbmcKICogICAgICAgICAgdGVzdGxjZCBzdHJpbmcgICAgICAg IHByaW50IHRoZSBnaXZlbiBzdHJpbmcgKGJ1dCBub3QgIi0iKQogKiAgICAgICAgICB0ZXN0bGNk IC0gICAgICAgICAgICAgcHJpbnQgc3RkaW4gKGFuZCBzY3JvbGwgaWYgbmVjZXNzYXJ5KQogKgog KgogKiAgVGhlIExDRCBpcyBjb25uZWN0ZWQgd2l0aCBhIDQtYml0IGRhdGEgaW50ZXJmYWNlOgog KgogKiAgICAgICAgTFBUIFNpZ25hbCAgICAgTFBUIHBpbiAgICAgIExDRCBTaWduYWwgICAgTENE IHBpbgogKiAgICAgICAgPT09PT09PT09PSAgICAgPT09PT09PSAgICAgID09PT09PT09PT0gICAg PT09PT09PQogKiAgICAgICBTRUxFQ1QgUFJJTlRFUiAgICAxNyAgICAgICAgICAgIERCNyAgICAg ICAgICAgMTQKICogICAgICAgSU5JVCBQUklOVEVSICAgICAgMTYgICAgICAgICAgICBEQjYgICAg ICAgICAgIDEzCiAqICAgICAgIEFVVE8gTElORUZFRUQgICAgIDE0ICAgICAgICAgICAgREI1ICAg ICAgICAgICAxMgogKiAgICAgICBTVFJPQkUgICAgICAgICAgICAgMSAgICAgICAgICAgIERCNCAg ICAgICAgICAgMTEKICogICAgICAgRDAgICAgICAgICAgICAgICAgIDIgICAgICAgICAgICBFTiAg ICAgICAgICAgICA2CiAqICAgICAgIEQxICAgICAgICAgICAgICAgICAzICAgICAgICAgICAgUi9X ICAgICAgICAgICAgNQogKiAgICAgICBEMiAgICAgICAgICAgICAgICAgNCAgICAgICAgICAgIFJT ICAgICAgICAgICAgIDQKICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBW TyAgKCopICAgICAgICAzCiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg VkREICgrNVYpICAgICAgMgogKiAgICAgICBHTkQgICAgICAgICAgICAgICAyNSAgICAgICAgICAg IFZTUyAgICAgICAgICAgIDEKICoKICoKICogICAgICAgKCopIFZPIGlzIGNvbm5lY3RlZCB0byB0 aGUgc2xpZGVyIG9mIGEgMTBrIHBvdCBiZXR3ZWVuIFZERAogKiAgICAgICAgICAgYW5kIFZTUwog KgogKgogKiAgQ29weXJpZ2h0IChDKSAxOTk2IERhdmlkIFRhaXQKICogIEZyZWUgZm9yIG5vbi1w cm9maXQgdXNlIGFuZCBsaWtlIGFueXRoaW5nIHRoYXQncyBmcmVlIHRoaXMgc29mdHdhcmUKICog IGNvbWVzIHdpdGggYWJzb2x1dGVseSBubyB3YXJyYW50eQogKgogKiAgVmVyc2lvbiAwLjAgIDNy ZCBNYXJjaCAxOTk2CiAqCiAqLwoKI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRkZWYu aD4KI2luY2x1ZGUgPGRvcy5oPgoKI2RlZmluZSBDSEFSUyAgICAgICAgICAgICAgIDE2ICAgICAg ICAgICAgICAgICAgICAgIC8qIExDRCB3aWR0aCBpbiBjaGFycyAqLwojZGVmaW5lIG91dF9kYXRh KHcpICAgICAgICAgb3V0cG9ydGIoY19yZWcsKHcpXjB4QikgLyogYml0cyAzLDEsMCBpbnZlcnRl ZCAqLwojZGVmaW5lIG91dF9jbnRsKGVuLHJ3LHJzKSAgb3V0cG9ydGIoZF9yZWcsKGVuKXwoKHJ3 KTw8MSl8KChycyk8PDIpKQojZGVmaW5lIG1vdmVfdG8oYSkgICAgICAgICAgd3JpdGU4KDB4ODAr YSwwLDEpCiNk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SAqLwogICAgd3JpdGU0KDMsMCw1 KTsgICAgICAgICAgICAvKiBzZXQgOC1iaXQgbW9kZSAqLwogICAgd3JpdGU0KDMsMCw1KTsgICAg ICAgICAgICAvKiBhbmQgYWdhaW4gKi8KICAgIHdyaXRlNCgzLDAsNSk7ICAgICAgICAgICAgLyog YW5kIGFnYWluICovCiAgICB3cml0ZTQoMiwwLDUpOyAgICAgICAgICAgIC8qIHNldCA0LWJpdCBt b2RlICovCiAgICB3cml0ZTgoMHgyMCs4Km4sMCw1KTsgICAgIC8qIHNldCA0LWJpdCBtb2RlLCBu KzEgbGluZXMsIDV4NyBkb3RzICovCiAgICB3cml0ZTgoNiwwLDUpOyAgICAgICAgICAgIC8qIHNl dCBjdXJzb3IgdG8gbW92ZSBmb3J3YXJkICovCiAgICB3cml0ZTgoMSwwLDUpOyAgICAgICAgICAg IC8qIGNsZWFyIGRpc3BsYXkgKi8KICAgIHdyaXRlOCgweEYsMCw1KTsgICAgICAgICAgLyogZGlz cGxheSBvbiwgY3Vyc29yIG9uLCBibGluayAqLwogICAgaWRsZSgpOwp9CgoKdm9pZCBwcmludChj aGFyICpzKQp7CiAgICB3aGlsZSAoICpzICkKCXdyaXRlOCgqcysrLDEsMSk7CiAgICBpZGxlKCk7 Cn0KCgp2b2lkIHNjcm9sbCh2b2lkKQp7CiAgICBpbnQgYywgbj0wOwoKICAgIGluaXRfbGNkKDAp OyAgICAgICAgICAgICAgICAgICAgICAgLyogc2VsZWN0IG9uZSBsaW5lIG1vZGUgKi8KICAgIGN1 cl9vZmYoKTsKICAgIHdoaWxlICggKGM9Z2V0Y2hhcigpKSAhPSBFT0YgKSB7CglpZiAoIG4gPT0g Q0hBUlMgKQoJICAgIHdyaXRlOCg3LDAsMSk7ICAgICAgICAgICAgIC8qIG5lZWQgdG8gZW5hYmxl IHNjcm9sbGluZyBub3cgKi8KCXdyaXRlOChjLDEsMSk7CglkZWxheSgxNTApOwoJKytuOwogICAg fQogICAgaWRsZSgpOwp9CgoKdm9pZCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKICAg IHNldHVwKCk7CiAgICBpbml0X2xjZCgxKTsgICAgICAgICAgICAgICAgICAgICAgICAvKiB0d28g bGluZSBtb2RlICovCgogICAgaWYgKCBhcmdjIDwgMiApIHsgICAgICAgICAgICAgICAgICAgLyog cHJpbnQgZGVmYXVsdCBzdHJpbmcgKi8KCXByaW50KCJMb29rOiIpOwoJbW92ZV90byg0MCk7Cglw cmludCgiNGJpdCBtb2RlIHdvcmtzISIpOwoJaG9tZSgpOwoJY3VyX29mZigpOwoJaWRsZSgpOwog ICAgfSBlbHNlIGlmICggKmFyZ3ZbMV09PSctJyApCglzY3JvbGwoKTsgICAgICAgICAgICAgICAg ICAgICAgIC8qIG9yIHByaW50IHN0ZGluICovCiAgICBlbHNlCglwcmludChhcmd2WzFdKTsgICAg ICAgICAgICAgICAgIC8qIG9yIHByaW50IGFyZ3VtZW50ICovCn0K --0__=80256A1600345CE18f9e8a93df938690918c80256A1600345CE1 Content-type: application/octet-stream; name="pic31311.pcx" Content-Disposition: attachment; filename="pic31311.pcx" Content-transfer-encoding: base64 CgUBCAAAAABBADEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAABQgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA= --0__=80256A1600345CE18f9e8a93df938690918c80256A1600345CE1-- -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body