├── .gitattributes ├── .gitignore ├── BoosterPack Layout.png ├── BoosterPack Schema.pdf ├── KiCad ├── SHARP Mem Display BP-cache.lib ├── SHARP Mem Display BP.cmp ├── SHARP Mem Display BP.kicad_pcb ├── SHARP Mem Display BP.net ├── SHARP Mem Display BP.pro └── SHARP Mem Display BP.sch ├── README.md ├── doublewide.asm ├── energia ├── Readme.md └── libraries │ └── SHARPMemLCDTxt │ ├── Examples │ └── SHARPTest │ │ ├── SHARPTest.ino │ │ └── tilogo.h │ ├── SHARPMemLCDTxt.cpp │ ├── SHARPMemLCDTxt.h │ ├── font.h │ ├── keywords.txt │ └── license.txt ├── font.h └── main.c /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /BoosterPack Layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astuder/MSP430-sharp-LS013B4DN02-memory-display/1c10191fd3f510ba7bfacc9f1454193bed672237/BoosterPack Layout.png -------------------------------------------------------------------------------- /BoosterPack Schema.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astuder/MSP430-sharp-LS013B4DN02-memory-display/1c10191fd3f510ba7bfacc9f1454193bed672237/BoosterPack Schema.pdf -------------------------------------------------------------------------------- /KiCad/SHARP Mem Display BP-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: 1/26/2014 9:09:04 PM 2 | #encoding utf-8 3 | # 4 | # +3.3V 5 | # 6 | DEF +3.3V #PWR 0 0 Y Y 1 F P 7 | F0 "#PWR" 0 -40 30 H I C CNN 8 | F1 "+3.3V" 0 110 30 H V C CNN 9 | F2 "~" 0 0 60 H V C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | ALIAS +3,3V 12 | DRAW 13 | X +3.3V 1 0 0 0 U 30 30 0 0 W N 14 | C 0 60 20 0 1 0 N 15 | P 3 0 1 0 0 0 0 40 0 40 N 16 | ENDDRAW 17 | ENDDEF 18 | # 19 | # +5V 20 | # 21 | DEF +5V #PWR 0 40 Y Y 1 F P 22 | F0 "#PWR" 0 90 20 H I C CNN 23 | F1 "+5V" 0 90 30 H V C CNN 24 | F2 "~" 0 0 60 H V C CNN 25 | F3 "~" 0 0 60 H V C CNN 26 | DRAW 27 | X +5V 1 0 0 0 U 20 20 0 0 W N 28 | C 0 50 20 0 1 0 N 29 | P 4 0 1 0 0 0 0 30 0 30 0 30 N 30 | ENDDRAW 31 | ENDDEF 32 | # 33 | # C 34 | # 35 | DEF C C 0 10 N Y 1 F N 36 | F0 "C" 0 100 40 H V L CNN 37 | F1 "C" 6 -85 40 H V L CNN 38 | F2 "~" 38 -150 30 H V C CNN 39 | F3 "~" 0 0 60 H V C CNN 40 | $FPLIST 41 | SM* 42 | C? 43 | C1-1 44 | $ENDFPLIST 45 | DRAW 46 | P 2 0 1 20 -80 -30 80 -30 N 47 | P 2 0 1 20 -80 30 80 30 N 48 | X ~ 1 0 200 170 D 40 40 1 1 P 49 | X ~ 2 0 -200 170 U 40 40 1 1 P 50 | ENDDRAW 51 | ENDDEF 52 | # 53 | # CONN_10 54 | # 55 | DEF CONN_10 P 0 40 Y N 1 F N 56 | F0 "P" -50 0 60 V V C CNN 57 | F1 "CONN_10" 50 0 60 V V C CNN 58 | F2 "~" 0 0 60 H V C CNN 59 | F3 "~" 0 0 60 H V C CNN 60 | DRAW 61 | S -100 500 100 -500 0 1 0 N 62 | X P1 1 -350 450 250 R 50 50 1 1 P I 63 | X P2 2 -350 350 250 R 50 50 1 1 P I 64 | X P3 3 -350 250 250 R 50 50 1 1 P I 65 | X P4 4 -350 150 250 R 50 50 1 1 P I 66 | X P5 5 -350 50 250 R 50 50 1 1 P I 67 | X P6 6 -350 -50 250 R 50 50 1 1 P I 68 | X P7 7 -350 -150 250 R 50 50 1 1 P I 69 | X P8 8 -350 -250 250 R 50 50 1 1 P I 70 | X P9 9 -350 -350 250 R 50 50 1 1 P I 71 | X P10 10 -350 -450 250 R 50 50 1 1 P I 72 | ENDDRAW 73 | ENDDEF 74 | # 75 | # GND 76 | # 77 | DEF ~GND #PWR 0 0 Y Y 1 F P 78 | F0 "#PWR" 0 0 30 H I C CNN 79 | F1 "GND" 0 -70 30 H I C CNN 80 | F2 "~" 0 0 60 H V C CNN 81 | F3 "~" 0 0 60 H V C CNN 82 | DRAW 83 | P 4 0 1 0 -50 0 0 -50 50 0 -50 0 N 84 | X GND 1 0 0 0 U 30 30 1 1 W N 85 | ENDDRAW 86 | ENDDEF 87 | # 88 | # JUMPER 89 | # 90 | DEF JUMPER JP 0 30 Y N 1 F N 91 | F0 "JP" 0 150 60 H V C CNN 92 | F1 "JUMPER" 0 -80 40 H V C CNN 93 | F2 "~" 0 0 60 H V C CNN 94 | F3 "~" 0 0 60 H V C CNN 95 | DRAW 96 | A 0 -26 125 1426 373 0 1 0 N -98 50 99 50 97 | C -100 0 35 0 1 0 N 98 | C 100 0 35 0 1 0 N 99 | X 1 1 -300 0 165 R 60 60 0 1 P 100 | X 2 2 300 0 165 L 60 60 0 1 P 101 | ENDDRAW 102 | ENDDEF 103 | # 104 | # JUMPER3 105 | # 106 | DEF JUMPER3 JP 0 30 Y N 1 F N 107 | F0 "JP" 50 -100 40 H V L CNN 108 | F1 "JUMPER3" 0 100 40 H V C CNN 109 | F2 "~" 0 0 60 H V C CNN 110 | F3 "~" 0 0 60 H V C CNN 111 | DRAW 112 | A -60 10 64 386 1413 0 1 0 N -10 50 -110 50 113 | A 60 10 64 386 1413 0 1 0 N 110 50 10 50 114 | C -120 0 35 0 1 0 N 115 | C 0 0 36 0 1 0 N 116 | C 120 0 35 0 1 0 N 117 | X 1 1 -250 0 95 R 40 40 0 1 P 118 | X 2 2 0 -100 60 U 40 40 0 1 P 119 | X 3 3 250 0 95 L 40 40 0 1 P 120 | ENDDRAW 121 | ENDDEF 122 | # 123 | #End Library 124 | -------------------------------------------------------------------------------- /KiCad/SHARP Mem Display BP.cmp: -------------------------------------------------------------------------------- 1 | Cmp-Mod V01 Created by PcbNew date = 1/26/2014 9:04:11 PM 2 | 3 | BeginCmp 4 | TimeStamp = /52E4B126; 5 | Reference = C1; 6 | ValeurCmp = .1 uF; 7 | IdModule = SM0805; 8 | EndCmp 9 | 10 | BeginCmp 11 | TimeStamp = /52E4B135; 12 | Reference = C2; 13 | ValeurCmp = 1 uF; 14 | IdModule = SM0805; 15 | EndCmp 16 | 17 | BeginCmp 18 | TimeStamp = /52E4B144; 19 | Reference = C3; 20 | ValeurCmp = 1 uF; 21 | IdModule = SM0805; 22 | EndCmp 23 | 24 | BeginCmp 25 | TimeStamp = /52E5E46A; 26 | Reference = JP1; 27 | ValeurCmp = JUMPER; 28 | IdModule = GS2; 29 | EndCmp 30 | 31 | BeginCmp 32 | TimeStamp = /52E5E52A; 33 | Reference = JP2; 34 | ValeurCmp = JUMPER; 35 | IdModule = GS2; 36 | EndCmp 37 | 38 | BeginCmp 39 | TimeStamp = /52E5E3E4; 40 | Reference = JP3; 41 | ValeurCmp = JUMPER; 42 | IdModule = GS2; 43 | EndCmp 44 | 45 | BeginCmp 46 | TimeStamp = /52E5E5C3; 47 | Reference = JP4; 48 | ValeurCmp = JUMPER; 49 | IdModule = GS2; 50 | EndCmp 51 | 52 | BeginCmp 53 | TimeStamp = /52E5E577; 54 | Reference = JP5; 55 | ValeurCmp = JUMPER; 56 | IdModule = GS2; 57 | EndCmp 58 | 59 | BeginCmp 60 | TimeStamp = /52E5DAF9; 61 | Reference = JP6; 62 | ValeurCmp = JUMPER3; 63 | IdModule = GS3; 64 | EndCmp 65 | 66 | BeginCmp 67 | TimeStamp = /52E5E2B1; 68 | Reference = JP7; 69 | ValeurCmp = JUMPER3; 70 | IdModule = GS3; 71 | EndCmp 72 | 73 | BeginCmp 74 | TimeStamp = /52E4A1EC; 75 | Reference = P1; 76 | ValeurCmp = LaunchPad Left; 77 | IdModule = SIL-10-W; 78 | EndCmp 79 | 80 | BeginCmp 81 | TimeStamp = /52E4A1FB; 82 | Reference = P2; 83 | ValeurCmp = LaunchPad Right; 84 | IdModule = SIL-10-W; 85 | EndCmp 86 | 87 | BeginCmp 88 | TimeStamp = /52E4A1A4; 89 | Reference = P3; 90 | ValeurCmp = Display Zebra; 91 | IdModule = SHARP_Mem_Disp_Zebra; 92 | EndCmp 93 | 94 | BeginCmp 95 | TimeStamp = /52E4A1B3; 96 | Reference = P4; 97 | ValeurCmp = Display FPC; 98 | IdModule = Kyocera_FPC_6288_10; 99 | EndCmp 100 | 101 | BeginCmp 102 | TimeStamp = /52E5D9E2; 103 | Reference = P5; 104 | ValeurCmp = LaunchPad Left 2; 105 | IdModule = SIL-10-W; 106 | EndCmp 107 | 108 | BeginCmp 109 | TimeStamp = /52E5D9F6; 110 | Reference = P6; 111 | ValeurCmp = LaunchPad Right 2; 112 | IdModule = SIL-10-W; 113 | EndCmp 114 | 115 | EndListe 116 | -------------------------------------------------------------------------------- /KiCad/SHARP Mem Display BP.net: -------------------------------------------------------------------------------- 1 | (export (version D) 2 | (design 3 | (source "C:/Users/Adrian2/SkyDrive/Code/KiCad/SHARP Mem Display BP/SHARP Mem Display BP.sch") 4 | (date "1/26/2014 9:08:55 PM") 5 | (tool "eeschema (2013-07-07 BZR 4022)-stable")) 6 | (components 7 | (comp (ref P3) 8 | (value "Display Zebra") 9 | (libsource (lib conn) (part CONN_10)) 10 | (sheetpath (names /) (tstamps /)) 11 | (tstamp 52E4A1A4)) 12 | (comp (ref P4) 13 | (value "Display FPC") 14 | (libsource (lib conn) (part CONN_10)) 15 | (sheetpath (names /) (tstamps /)) 16 | (tstamp 52E4A1B3)) 17 | (comp (ref P1) 18 | (value "LaunchPad Left") 19 | (libsource (lib conn) (part CONN_10)) 20 | (sheetpath (names /) (tstamps /)) 21 | (tstamp 52E4A1EC)) 22 | (comp (ref P2) 23 | (value "LaunchPad Right") 24 | (libsource (lib conn) (part CONN_10)) 25 | (sheetpath (names /) (tstamps /)) 26 | (tstamp 52E4A1FB)) 27 | (comp (ref C1) 28 | (value ".1 uF") 29 | (libsource (lib device) (part C)) 30 | (sheetpath (names /) (tstamps /)) 31 | (tstamp 52E4B126)) 32 | (comp (ref C2) 33 | (value "1 uF") 34 | (libsource (lib device) (part C)) 35 | (sheetpath (names /) (tstamps /)) 36 | (tstamp 52E4B135)) 37 | (comp (ref C3) 38 | (value "1 uF") 39 | (libsource (lib device) (part C)) 40 | (sheetpath (names /) (tstamps /)) 41 | (tstamp 52E4B144)) 42 | (comp (ref P5) 43 | (value "LaunchPad Left 2") 44 | (libsource (lib conn) (part CONN_10)) 45 | (sheetpath (names /) (tstamps /)) 46 | (tstamp 52E5D9E2)) 47 | (comp (ref P6) 48 | (value "LaunchPad Right 2") 49 | (libsource (lib conn) (part CONN_10)) 50 | (sheetpath (names /) (tstamps /)) 51 | (tstamp 52E5D9F6)) 52 | (comp (ref JP6) 53 | (value VDD) 54 | (libsource (lib device) (part JUMPER3)) 55 | (sheetpath (names /) (tstamps /)) 56 | (tstamp 52E5DAF9)) 57 | (comp (ref JP7) 58 | (value EXTMOD) 59 | (libsource (lib device) (part JUMPER3)) 60 | (sheetpath (names /) (tstamps /)) 61 | (tstamp 52E5E2B1)) 62 | (comp (ref JP3) 63 | (value SCLK) 64 | (libsource (lib device) (part JUMPER)) 65 | (sheetpath (names /) (tstamps /)) 66 | (tstamp 52E5E3E4)) 67 | (comp (ref JP1) 68 | (value MOSI) 69 | (libsource (lib device) (part JUMPER)) 70 | (sheetpath (names /) (tstamps /)) 71 | (tstamp 52E5E46A)) 72 | (comp (ref JP2) 73 | (value CS) 74 | (libsource (lib device) (part JUMPER)) 75 | (sheetpath (names /) (tstamps /)) 76 | (tstamp 52E5E52A)) 77 | (comp (ref JP5) 78 | (value DISP) 79 | (libsource (lib device) (part JUMPER)) 80 | (sheetpath (names /) (tstamps /)) 81 | (tstamp 52E5E577)) 82 | (comp (ref JP4) 83 | (value EXTIN) 84 | (libsource (lib device) (part JUMPER)) 85 | (sheetpath (names /) (tstamps /)) 86 | (tstamp 52E5E5C3))) 87 | (libparts 88 | (libpart (lib device) (part C) 89 | (description "Condensateur non polarise") 90 | (footprints 91 | (fp SM*) 92 | (fp C?) 93 | (fp C1-1)) 94 | (fields 95 | (field (name Reference) C) 96 | (field (name Value) C) 97 | (field (name Footprint) ~) 98 | (field (name Datasheet) ~)) 99 | (pins 100 | (pin (num 1) (name ~) (type passive)) 101 | (pin (num 2) (name ~) (type passive)))) 102 | (libpart (lib device) (part JUMPER) 103 | (fields 104 | (field (name Reference) JP) 105 | (field (name Value) JUMPER) 106 | (field (name Footprint) ~) 107 | (field (name Datasheet) ~)) 108 | (pins 109 | (pin (num 1) (name 1) (type passive)) 110 | (pin (num 2) (name 2) (type passive)))) 111 | (libpart (lib device) (part JUMPER3) 112 | (fields 113 | (field (name Reference) JP) 114 | (field (name Value) JUMPER3) 115 | (field (name Footprint) ~) 116 | (field (name Datasheet) ~)) 117 | (pins 118 | (pin (num 1) (name 1) (type passive)) 119 | (pin (num 2) (name 2) (type passive)) 120 | (pin (num 3) (name 3) (type passive)))) 121 | (libpart (lib conn) (part CONN_10) 122 | (description "Symbole general de connecteur") 123 | (fields 124 | (field (name Reference) P) 125 | (field (name Value) CONN_10)) 126 | (pins 127 | (pin (num 1) (name P1) (type passive)) 128 | (pin (num 2) (name P2) (type passive)) 129 | (pin (num 3) (name P3) (type passive)) 130 | (pin (num 4) (name P4) (type passive)) 131 | (pin (num 5) (name P5) (type passive)) 132 | (pin (num 6) (name P6) (type passive)) 133 | (pin (num 7) (name P7) (type passive)) 134 | (pin (num 8) (name P8) (type passive)) 135 | (pin (num 9) (name P9) (type passive)) 136 | (pin (num 10) (name P10) (type passive))))) 137 | (libraries 138 | (library (logical device) 139 | (uri "C:\\Program Files (x86)\\KiCad\\share\\library\\device.lib")) 140 | (library (logical conn) 141 | (uri "C:\\Program Files (x86)\\KiCad\\share\\library\\conn.lib"))) 142 | (nets 143 | (net (code 1) (name /VDD) 144 | (node (ref P3) (pin 7)) 145 | (node (ref P4) (pin 7)) 146 | (node (ref P4) (pin 6)) 147 | (node (ref P3) (pin 6)) 148 | (node (ref JP6) (pin 2)) 149 | (node (ref JP7) (pin 1)) 150 | (node (ref C3) (pin 1)) 151 | (node (ref C2) (pin 1))) 152 | (net (code 2) (name +5V) 153 | (node (ref P5) (pin 1)) 154 | (node (ref JP6) (pin 3))) 155 | (net (code 3) (name +3.3V) 156 | (node (ref JP6) (pin 1)) 157 | (node (ref P1) (pin 1))) 158 | (net (code 4) (name /DISP) 159 | (node (ref JP5) (pin 2)) 160 | (node (ref P3) (pin 5)) 161 | (node (ref C1) (pin 1)) 162 | (node (ref P4) (pin 5))) 163 | (net (code 5) (name "") 164 | (node (ref P6) (pin 2))) 165 | (net (code 6) (name GND) 166 | (node (ref JP7) (pin 3)) 167 | (node (ref P5) (pin 2)) 168 | (node (ref P4) (pin 10)) 169 | (node (ref P4) (pin 9)) 170 | (node (ref P3) (pin 10)) 171 | (node (ref P3) (pin 9)) 172 | (node (ref P2) (pin 1)) 173 | (node (ref C3) (pin 2)) 174 | (node (ref C2) (pin 2)) 175 | (node (ref C1) (pin 2))) 176 | (net (code 7) (name "") 177 | (node (ref P5) (pin 3))) 178 | (net (code 8) (name "") 179 | (node (ref P5) (pin 4))) 180 | (net (code 9) (name "") 181 | (node (ref P5) (pin 5))) 182 | (net (code 10) (name "") 183 | (node (ref P5) (pin 6))) 184 | (net (code 11) (name "") 185 | (node (ref P5) (pin 7))) 186 | (net (code 12) (name "") 187 | (node (ref P5) (pin 8))) 188 | (net (code 13) (name "") 189 | (node (ref P5) (pin 9))) 190 | (net (code 14) (name "") 191 | (node (ref P5) (pin 10))) 192 | (net (code 15) (name "") 193 | (node (ref P6) (pin 1))) 194 | (net (code 16) (name "") 195 | (node (ref P6) (pin 3))) 196 | (net (code 17) (name "") 197 | (node (ref P6) (pin 4))) 198 | (net (code 18) (name "") 199 | (node (ref P6) (pin 5))) 200 | (net (code 19) (name "") 201 | (node (ref P6) (pin 6))) 202 | (net (code 20) (name "") 203 | (node (ref P6) (pin 7))) 204 | (net (code 21) (name "") 205 | (node (ref P6) (pin 8))) 206 | (net (code 22) (name "") 207 | (node (ref P6) (pin 9))) 208 | (net (code 23) (name "") 209 | (node (ref P6) (pin 10))) 210 | (net (code 24) (name "") 211 | (node (ref JP1) (pin 1)) 212 | (node (ref P2) (pin 6))) 213 | (net (code 25) (name "") 214 | (node (ref JP4) (pin 1)) 215 | (node (ref P1) (pin 5))) 216 | (net (code 26) (name /CMOD) 217 | (node (ref P3) (pin 8)) 218 | (node (ref JP7) (pin 2)) 219 | (node (ref P4) (pin 8))) 220 | (net (code 27) (name "") 221 | (node (ref P1) (pin 6))) 222 | (net (code 28) (name "") 223 | (node (ref JP3) (pin 1)) 224 | (node (ref P1) (pin 7))) 225 | (net (code 29) (name "") 226 | (node (ref JP5) (pin 1)) 227 | (node (ref P1) (pin 8))) 228 | (net (code 30) (name "") 229 | (node (ref P1) (pin 9))) 230 | (net (code 31) (name "") 231 | (node (ref P1) (pin 10))) 232 | (net (code 32) (name "") 233 | (node (ref P2) (pin 2))) 234 | (net (code 33) (name "") 235 | (node (ref P2) (pin 3))) 236 | (net (code 34) (name "") 237 | (node (ref P2) (pin 4))) 238 | (net (code 35) (name "") 239 | (node (ref P2) (pin 5))) 240 | (net (code 36) (name "") 241 | (node (ref P1) (pin 4))) 242 | (net (code 37) (name "") 243 | (node (ref P2) (pin 7))) 244 | (net (code 38) (name "") 245 | (node (ref P2) (pin 8)) 246 | (node (ref JP2) (pin 1))) 247 | (net (code 39) (name "") 248 | (node (ref P2) (pin 9))) 249 | (net (code 40) (name "") 250 | (node (ref P2) (pin 10))) 251 | (net (code 41) (name "") 252 | (node (ref P1) (pin 2))) 253 | (net (code 42) (name "") 254 | (node (ref P1) (pin 3))) 255 | (net (code 43) (name /SCLK) 256 | (node (ref P4) (pin 1)) 257 | (node (ref P3) (pin 1)) 258 | (node (ref JP3) (pin 2))) 259 | (net (code 44) (name /SI) 260 | (node (ref P4) (pin 2)) 261 | (node (ref JP1) (pin 2)) 262 | (node (ref P3) (pin 2))) 263 | (net (code 45) (name /SCS) 264 | (node (ref P4) (pin 3)) 265 | (node (ref P3) (pin 3)) 266 | (node (ref JP2) (pin 2))) 267 | (net (code 46) (name /CIN) 268 | (node (ref JP4) (pin 2)) 269 | (node (ref P3) (pin 4)) 270 | (node (ref P4) (pin 4))))) -------------------------------------------------------------------------------- /KiCad/SHARP Mem Display BP.pro: -------------------------------------------------------------------------------- 1 | update=1/27/2014 4:25:53 PM 2 | version=1 3 | last_client=pcbnew 4 | [cvpcb] 5 | version=1 6 | NetIExt=net 7 | [cvpcb/libraries] 8 | EquName1=devcms 9 | [general] 10 | version=1 11 | [eeschema] 12 | version=1 13 | LibDir=../libraries 14 | NetFmtName= 15 | RptD_X=0 16 | RptD_Y=100 17 | RptLab=1 18 | LabSize=60 19 | [eeschema/libraries] 20 | LibName1=power 21 | LibName2=device 22 | LibName3=transistors 23 | LibName4=conn 24 | LibName5=linear 25 | LibName6=regul 26 | LibName7=74xx 27 | LibName8=cmos4000 28 | LibName9=adc-dac 29 | LibName10=memory 30 | LibName11=xilinx 31 | LibName12=special 32 | LibName13=microcontrollers 33 | LibName14=dsp 34 | LibName15=microchip 35 | LibName16=analog_switches 36 | LibName17=motorola 37 | LibName18=texas 38 | LibName19=intel 39 | LibName20=audio 40 | LibName21=interface 41 | LibName22=digital-audio 42 | LibName23=philips 43 | LibName24=display 44 | LibName25=cypress 45 | LibName26=siliconi 46 | LibName27=opto 47 | LibName28=atmel 48 | LibName29=contrib 49 | LibName30=valves 50 | LibName31=myparts 51 | [pcbnew] 52 | version=1 53 | LastNetListRead= 54 | UseCmpFile=1 55 | PadDrill=0.600000000000 56 | PadDrillOvalY=0.600000000000 57 | PadSizeH=1.500000000000 58 | PadSizeV=1.500000000000 59 | PcbTextSizeV=1.500000000000 60 | PcbTextSizeH=1.500000000000 61 | PcbTextThickness=0.300000000000 62 | ModuleTextSizeV=1.000000000000 63 | ModuleTextSizeH=1.000000000000 64 | ModuleTextSizeThickness=0.150000000000 65 | SolderMaskClearance=0.000000000000 66 | SolderMaskMinWidth=0.000000000000 67 | DrawSegmentWidth=0.200000000000 68 | BoardOutlineThickness=0.100000000000 69 | ModuleOutlineThickness=0.150000000000 70 | [pcbnew/libraries] 71 | LibDir=../modules 72 | LibName1=myparts 73 | LibName2=sockets 74 | LibName3=connect 75 | LibName4=discret 76 | LibName5=pin_array 77 | LibName6=divers 78 | LibName7=smd_capacitors 79 | LibName8=smd_resistors 80 | LibName9=smd_crystal&oscillator 81 | LibName10=smd_dil 82 | LibName11=smd_transistors 83 | LibName12=libcms 84 | LibName13=display 85 | LibName14=led 86 | LibName15=dip_sockets 87 | LibName16=pga_sockets 88 | LibName17=valves 89 | LibName18=43oh_Logo 90 | -------------------------------------------------------------------------------- /KiCad/SHARP Mem Display BP.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | LIBS:power 3 | LIBS:device 4 | LIBS:transistors 5 | LIBS:conn 6 | LIBS:linear 7 | LIBS:regul 8 | LIBS:74xx 9 | LIBS:cmos4000 10 | LIBS:adc-dac 11 | LIBS:memory 12 | LIBS:xilinx 13 | LIBS:special 14 | LIBS:microcontrollers 15 | LIBS:dsp 16 | LIBS:microchip 17 | LIBS:analog_switches 18 | LIBS:motorola 19 | LIBS:texas 20 | LIBS:intel 21 | LIBS:audio 22 | LIBS:interface 23 | LIBS:digital-audio 24 | LIBS:philips 25 | LIBS:display 26 | LIBS:cypress 27 | LIBS:siliconi 28 | LIBS:opto 29 | LIBS:atmel 30 | LIBS:contrib 31 | LIBS:valves 32 | LIBS:myparts 33 | LIBS:SHARP Mem Display BP-cache 34 | EELAYER 27 0 35 | EELAYER END 36 | $Descr A4 11693 8268 37 | encoding utf-8 38 | Sheet 1 1 39 | Title "SHARP Memory Display BoosterPack" 40 | Date "27 jan 2014" 41 | Rev "A" 42 | Comp "" 43 | Comment1 "" 44 | Comment2 "" 45 | Comment3 "" 46 | Comment4 "" 47 | $EndDescr 48 | $Comp 49 | L CONN_10 P3 50 | U 1 1 52E4A1A4 51 | P 7450 3750 52 | F 0 "P3" V 7400 3750 60 0000 C CNN 53 | F 1 "Display Zebra" V 7500 3750 60 0000 C CNN 54 | F 2 "" H 7450 3750 60 0000 C CNN 55 | F 3 "" H 7450 3750 60 0000 C CNN 56 | 1 7450 3750 57 | 1 0 0 -1 58 | $EndComp 59 | $Comp 60 | L CONN_10 P4 61 | U 1 1 52E4A1B3 62 | P 8850 3750 63 | F 0 "P4" V 8800 3750 60 0000 C CNN 64 | F 1 "Display FPC" V 8900 3750 60 0000 C CNN 65 | F 2 "" H 8850 3750 60 0000 C CNN 66 | F 3 "" H 8850 3750 60 0000 C CNN 67 | 1 8850 3750 68 | 1 0 0 -1 69 | $EndComp 70 | $Comp 71 | L CONN_10 P1 72 | U 1 1 52E4A1EC 73 | P 4350 3750 74 | F 0 "P1" V 4300 3750 60 0000 C CNN 75 | F 1 "LaunchPad Left" V 4400 3750 60 0000 C CNN 76 | F 2 "" H 4350 3750 60 0000 C CNN 77 | F 3 "" H 4350 3750 60 0000 C CNN 78 | 1 4350 3750 79 | -1 0 0 -1 80 | $EndComp 81 | $Comp 82 | L CONN_10 P2 83 | U 1 1 52E4A1FB 84 | P 4350 5100 85 | F 0 "P2" V 4300 5100 60 0000 C CNN 86 | F 1 "LaunchPad Right" V 4400 5100 60 0000 C CNN 87 | F 2 "" H 4350 5100 60 0000 C CNN 88 | F 3 "" H 4350 5100 60 0000 C CNN 89 | 1 4350 5100 90 | -1 0 0 -1 91 | $EndComp 92 | $Comp 93 | L GND #PWR01 94 | U 1 1 52E4A40C 95 | P 8000 5900 96 | F 0 "#PWR01" H 8000 5900 30 0001 C CNN 97 | F 1 "GND" H 8000 5830 30 0001 C CNN 98 | F 2 "" H 8000 5900 60 0000 C CNN 99 | F 3 "" H 8000 5900 60 0000 C CNN 100 | 1 8000 5900 101 | 1 0 0 -1 102 | $EndComp 103 | Wire Wire Line 104 | 5300 3900 4700 3900 105 | Wire Wire Line 106 | 5300 3300 5300 3900 107 | Wire Wire Line 108 | 5500 5350 4700 5350 109 | Wire Wire Line 110 | 4700 2850 4700 3300 111 | Wire Wire Line 112 | 8000 5800 8000 5900 113 | Connection ~ 8000 5800 114 | Wire Wire Line 115 | 6600 4100 7100 4100 116 | Wire Wire Line 117 | 6600 4200 7100 4200 118 | Wire Wire Line 119 | 4700 4650 4950 4650 120 | Wire Wire Line 121 | 4700 4000 5600 4000 122 | $Comp 123 | L C C1 124 | U 1 1 52E4B126 125 | P 7600 5500 126 | F 0 "C1" H 7600 5600 40 0000 L CNN 127 | F 1 ".1 uF" H 7606 5415 40 0000 L CNN 128 | F 2 "~" H 7638 5350 30 0000 C CNN 129 | F 3 "~" H 7600 5500 60 0000 C CNN 130 | 1 7600 5500 131 | 1 0 0 -1 132 | $EndComp 133 | $Comp 134 | L C C2 135 | U 1 1 52E4B135 136 | P 7900 5500 137 | F 0 "C2" H 7900 5600 40 0000 L CNN 138 | F 1 "1 uF" H 7906 5415 40 0000 L CNN 139 | F 2 "~" H 7938 5350 30 0000 C CNN 140 | F 3 "~" H 7900 5500 60 0000 C CNN 141 | 1 7900 5500 142 | 1 0 0 -1 143 | $EndComp 144 | $Comp 145 | L C C3 146 | U 1 1 52E4B144 147 | P 8200 5500 148 | F 0 "C3" H 8200 5600 40 0000 L CNN 149 | F 1 "1 uF" H 8206 5415 40 0000 L CNN 150 | F 2 "~" H 8238 5350 30 0000 C CNN 151 | F 3 "~" H 8200 5500 60 0000 C CNN 152 | 1 8200 5500 153 | 1 0 0 -1 154 | $EndComp 155 | Wire Wire Line 156 | 7600 5700 7600 5800 157 | Wire Wire Line 158 | 7900 5700 7900 5800 159 | Connection ~ 7900 5800 160 | Wire Wire Line 161 | 8200 5700 8200 5800 162 | Connection ~ 8200 5800 163 | Wire Wire Line 164 | 8500 3300 8250 3300 165 | Wire Wire Line 166 | 8500 3400 8250 3400 167 | Wire Wire Line 168 | 8500 3500 8250 3500 169 | Wire Wire Line 170 | 8500 3600 8250 3600 171 | Wire Wire Line 172 | 8500 3700 8250 3700 173 | Wire Wire Line 174 | 8500 3800 8250 3800 175 | Wire Wire Line 176 | 8500 3900 8250 3900 177 | Wire Wire Line 178 | 8500 4000 8250 4000 179 | Wire Wire Line 180 | 8500 4100 8250 4100 181 | Wire Wire Line 182 | 8500 4200 8250 4200 183 | Text Label 8350 3300 0 60 ~ 0 184 | SCLK 185 | Text Label 8350 3400 0 60 ~ 0 186 | SI 187 | Text Label 8350 3500 0 60 ~ 0 188 | SCS 189 | Text Label 8350 3600 0 60 ~ 0 190 | CIN 191 | Text Label 8350 3700 0 60 ~ 0 192 | DISP 193 | Text Label 8350 3800 0 60 ~ 0 194 | VDDA 195 | Text Label 8350 3900 0 60 ~ 0 196 | VDD 197 | Text Label 8350 4000 0 60 ~ 0 198 | CMOD 199 | Text Label 8350 4100 0 60 ~ 0 200 | VSS 201 | Text Label 8350 4200 0 60 ~ 0 202 | VSSA 203 | Text Label 6800 3300 0 60 ~ 0 204 | SCLK 205 | Text Label 6800 3400 0 60 ~ 0 206 | SI 207 | Text Label 6800 3500 0 60 ~ 0 208 | SCS 209 | Text Label 6800 3600 0 60 ~ 0 210 | CIN 211 | Text Label 6800 3700 0 60 ~ 0 212 | DISP 213 | Text Label 6800 3800 0 60 ~ 0 214 | VDDA 215 | Text Label 6800 3900 0 60 ~ 0 216 | VDD 217 | Wire Wire Line 218 | 6600 4000 7100 4000 219 | Text Label 6800 4000 0 60 ~ 0 220 | CMOD 221 | Text Label 6800 4100 0 60 ~ 0 222 | VSS 223 | Text Label 6800 4200 0 60 ~ 0 224 | VSSA 225 | $Comp 226 | L CONN_10 P5 227 | U 1 1 52E5D9E2 228 | P 3450 3750 229 | F 0 "P5" V 3400 3750 60 0000 C CNN 230 | F 1 "LaunchPad Left 2" V 3500 3750 60 0000 C CNN 231 | F 2 "" H 3450 3750 60 0000 C CNN 232 | F 3 "" H 3450 3750 60 0000 C CNN 233 | 1 3450 3750 234 | -1 0 0 -1 235 | $EndComp 236 | $Comp 237 | L CONN_10 P6 238 | U 1 1 52E5D9F6 239 | P 3450 5100 240 | F 0 "P6" V 3400 5100 60 0000 C CNN 241 | F 1 "LaunchPad Right 2" V 3500 5100 60 0000 C CNN 242 | F 2 "" H 3450 5100 60 0000 C CNN 243 | F 3 "" H 3450 5100 60 0000 C CNN 244 | 1 3450 5100 245 | -1 0 0 -1 246 | $EndComp 247 | $Comp 248 | L JUMPER3 JP6 249 | U 1 1 52E5DAF9 250 | P 6100 2150 251 | F 0 "JP6" H 6150 2050 40 0000 L CNN 252 | F 1 "VDD" H 6100 2250 40 0000 C CNN 253 | F 2 "~" H 6100 2150 60 0000 C CNN 254 | F 3 "~" H 6100 2150 60 0000 C CNN 255 | 1 6100 2150 256 | 1 0 0 -1 257 | $EndComp 258 | Wire Wire Line 259 | 6100 2250 6100 2750 260 | Wire Wire Line 261 | 6100 2450 6250 2450 262 | Wire Wire Line 263 | 6250 2450 6250 2750 264 | Connection ~ 6100 2450 265 | Text Label 6100 2700 1 60 ~ 0 266 | VDD 267 | Text Label 6250 2700 1 60 ~ 0 268 | VDDA 269 | $Comp 270 | L +5V #PWR02 271 | U 1 1 52E5DCAA 272 | P 3800 2850 273 | F 0 "#PWR02" H 3800 2940 20 0001 C CNN 274 | F 1 "+5V" H 3800 2940 30 0000 C CNN 275 | F 2 "" H 3800 2850 60 0000 C CNN 276 | F 3 "" H 3800 2850 60 0000 C CNN 277 | 1 3800 2850 278 | 1 0 0 -1 279 | $EndComp 280 | Wire Wire Line 281 | 3800 2850 3800 3300 282 | $Comp 283 | L +3.3V #PWR03 284 | U 1 1 52E5DD29 285 | P 4700 2850 286 | F 0 "#PWR03" H 4700 2810 30 0001 C CNN 287 | F 1 "+3.3V" H 4700 2960 30 0000 C CNN 288 | F 2 "" H 4700 2850 60 0000 C CNN 289 | F 3 "" H 4700 2850 60 0000 C CNN 290 | 1 4700 2850 291 | 1 0 0 -1 292 | $EndComp 293 | Wire Wire Line 294 | 5850 2150 5600 2150 295 | Text Label 5600 2150 0 60 ~ 0 296 | +3.3V 297 | Wire Wire Line 298 | 6350 2150 6650 2150 299 | Text Label 6600 2150 2 60 ~ 0 300 | +5V 301 | Wire Wire Line 302 | 7600 5300 7600 4850 303 | Wire Wire Line 304 | 7900 5300 7900 4850 305 | Wire Wire Line 306 | 8200 5300 8200 4850 307 | Text Label 7600 5100 1 60 ~ 0 308 | DISP 309 | Text Label 7900 5100 1 60 ~ 0 310 | VDDA 311 | Text Label 8200 5100 1 60 ~ 0 312 | VDD 313 | Wire Wire Line 314 | 8500 5800 8500 4850 315 | Connection ~ 8500 5800 316 | Wire Wire Line 317 | 8800 5800 8800 4850 318 | Text Label 8500 5100 1 60 ~ 0 319 | VSS 320 | Text Label 8800 5100 1 60 ~ 0 321 | VSSA 322 | Wire Wire Line 323 | 7100 3900 6600 3900 324 | Wire Wire Line 325 | 7100 3800 6600 3800 326 | Wire Wire Line 327 | 7600 5800 8800 5800 328 | $Comp 329 | L GND #PWR04 330 | U 1 1 52E5E1F1 331 | P 4950 4800 332 | F 0 "#PWR04" H 4950 4800 30 0001 C CNN 333 | F 1 "GND" H 4950 4730 30 0001 C CNN 334 | F 2 "" H 4950 4800 60 0000 C CNN 335 | F 3 "" H 4950 4800 60 0000 C CNN 336 | 1 4950 4800 337 | 1 0 0 -1 338 | $EndComp 339 | Wire Wire Line 340 | 4950 4650 4950 4800 341 | Wire Wire Line 342 | 3800 3400 4000 3400 343 | Wire Wire Line 344 | 4000 3400 4000 3550 345 | $Comp 346 | L GND #PWR05 347 | U 1 1 52E5E26B 348 | P 4000 3550 349 | F 0 "#PWR05" H 4000 3550 30 0001 C CNN 350 | F 1 "GND" H 4000 3480 30 0001 C CNN 351 | F 2 "" H 4000 3550 60 0000 C CNN 352 | F 3 "" H 4000 3550 60 0000 C CNN 353 | 1 4000 3550 354 | 1 0 0 -1 355 | $EndComp 356 | $Comp 357 | L JUMPER3 JP7 358 | U 1 1 52E5E2B1 359 | P 7800 2150 360 | F 0 "JP7" H 7850 2050 40 0000 L CNN 361 | F 1 "EXTMOD" H 7800 2250 40 0000 C CNN 362 | F 2 "~" H 7800 2150 60 0000 C CNN 363 | F 3 "~" H 7800 2150 60 0000 C CNN 364 | 1 7800 2150 365 | 1 0 0 -1 366 | $EndComp 367 | Wire Wire Line 368 | 7550 2150 7300 2150 369 | Wire Wire Line 370 | 8050 2150 8350 2150 371 | Wire Wire Line 372 | 7800 2250 7800 2750 373 | Text Label 7800 2700 1 60 ~ 0 374 | CMOD 375 | Text Label 7300 2150 0 60 ~ 0 376 | VDD 377 | Text Label 8350 2150 2 60 ~ 0 378 | GND 379 | Wire Wire Line 380 | 4700 3700 5200 3700 381 | Wire Wire Line 382 | 5200 3700 5200 3600 383 | $Comp 384 | L JUMPER JP3 385 | U 1 1 52E5E3E4 386 | P 5900 3300 387 | F 0 "JP3" H 5900 3450 60 0000 C CNN 388 | F 1 "SCLK" H 5900 3220 40 0000 C CNN 389 | F 2 "~" H 5900 3300 60 0000 C CNN 390 | F 3 "~" H 5900 3300 60 0000 C CNN 391 | 1 5900 3300 392 | 1 0 0 -1 393 | $EndComp 394 | Wire Wire Line 395 | 6200 3300 7100 3300 396 | $Comp 397 | L JUMPER JP1 398 | U 1 1 52E5E46A 399 | P 5450 5150 400 | F 0 "JP1" H 5450 5300 60 0000 C CNN 401 | F 1 "MOSI" H 5450 5070 40 0000 C CNN 402 | F 2 "~" H 5450 5150 60 0000 C CNN 403 | F 3 "~" H 5450 5150 60 0000 C CNN 404 | 1 5450 5150 405 | 1 0 0 -1 406 | $EndComp 407 | Wire Wire Line 408 | 4700 5150 5150 5150 409 | Wire Wire Line 410 | 7100 3400 6400 3400 411 | Wire Wire Line 412 | 6400 3400 6400 5150 413 | Wire Wire Line 414 | 6400 5150 5750 5150 415 | $Comp 416 | L JUMPER JP2 417 | U 1 1 52E5E52A 418 | P 5800 5350 419 | F 0 "JP2" H 5800 5500 60 0000 C CNN 420 | F 1 "CS" H 5800 5270 40 0000 C CNN 421 | F 2 "~" H 5800 5350 60 0000 C CNN 422 | F 3 "~" H 5800 5350 60 0000 C CNN 423 | 1 5800 5350 424 | 1 0 0 -1 425 | $EndComp 426 | Wire Wire Line 427 | 7100 3500 6500 3500 428 | Wire Wire Line 429 | 6500 3500 6500 5350 430 | Wire Wire Line 431 | 6500 5350 6100 5350 432 | $Comp 433 | L JUMPER JP5 434 | U 1 1 52E5E577 435 | P 5900 4000 436 | F 0 "JP5" H 5900 4150 60 0000 C CNN 437 | F 1 "DISP" H 5900 3920 40 0000 C CNN 438 | F 2 "~" H 5900 4000 60 0000 C CNN 439 | F 3 "~" H 5900 4000 60 0000 C CNN 440 | 1 5900 4000 441 | 1 0 0 -1 442 | $EndComp 443 | Wire Wire Line 444 | 7100 3700 6200 3700 445 | Wire Wire Line 446 | 6200 3700 6200 4000 447 | $Comp 448 | L JUMPER JP4 449 | U 1 1 52E5E5C3 450 | P 5900 3600 451 | F 0 "JP4" H 5900 3750 60 0000 C CNN 452 | F 1 "EXTIN" H 5900 3520 40 0000 C CNN 453 | F 2 "~" H 5900 3600 60 0000 C CNN 454 | F 3 "~" H 5900 3600 60 0000 C CNN 455 | 1 5900 3600 456 | 1 0 0 -1 457 | $EndComp 458 | Wire Wire Line 459 | 7100 3600 6200 3600 460 | Wire Wire Line 461 | 5200 3600 5600 3600 462 | Wire Wire Line 463 | 5300 3300 5600 3300 464 | $EndSCHEMATC 465 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Example of using SHARP Memory LCD LS013B4DN04 with MSP430G2553 2 | ============================================================== 3 | 4 | This is a simple library for TI MSP430G2553 to write characters to SHARP LS013B4DN04 5 | Memory Display using USCI for hardware SPI. 6 | 7 | SHARP LS013B4DN04 is a very low power 1.35 inch, 96x96 pixel LCD display. It uses 8 | less than 15 uW when displaying a static image. 9 | http://www.sharpmemorylcd.com/1-35-inch-memory-lcd.html 10 | 11 | This code also works with the predecessor LS013B4DN02 and should work with any 12 | display of that series with compatible pinouts. 13 | 14 | The project also includes a matching BoosterPack to mount the display on a MSP430 LaunchPad. 15 | More information about the BoosterPack can be found on 43oh: 16 | http://forum.43oh.com/topic/4979-sharp-memory-display-booster-pack/ 17 | 18 | Pinout MSP430 -> Display 19 | * P1.0: LED (VCOM status display) 20 | * P1.5: SCLK (SPI clock) 21 | * P1.7: SI (SPI data) 22 | * P2.0: DISP (display on/off) 23 | * P2.5: SCS (SPI chip select) 24 | * GND: GND 25 | * VCC: VDD and VDDA 26 | 27 | After adjusting for different pin-out (DISP,SCS), this code also works with the official SHARP LCD BoosterPack by Texas Instruments. 28 | http://www.ti.com/tool/430BOOST-SHARP96 29 | 30 | This code should also work with the Adafruit SHARP Memory Display Breakout 31 | http://www.adafruit.com/products/1393 32 | 33 | A library and example for Energia can be found in the Energia subfolder of this project. 34 | This library should also work with Arduino (untested). 35 | -------------------------------------------------------------------------------- /doublewide.asm: -------------------------------------------------------------------------------- 1 | ;----------------------------------- 2 | ; doublewide.asm 3 | ; 4 | ; doubleWideAsm - duplicate pixels from byte to word 5 | 6 | .global doubleWideAsm 7 | 8 | ; R12 input character byte 9 | ; R13 input linebuff address to receive word 10 | ; R14 temp for output word 11 | ; R15 temp for bit count 12 | 13 | doubleWideAsm: 14 | MOV.B #8, R15 ; set bit counter to 8 15 | nextPixel: 16 | RRA.B R12 ; shift pixel into carry 17 | RRC.W R14 ; shift pixel into word 18 | RRA.W R14 ; duplicate pixel 19 | DEC.B R15 ; decrease bit counter 20 | JNZ nextPixel ; not done yet 21 | MOV.B R14, 1(R13) ; store 1st byte in linebuff not using MOV.W as linebuff position might be odd 22 | SWPB R14 ; get access to 2nd byte 23 | MOV.B R14, 0(R13) ; store 2nd byte in linebuff 24 | RET ; done 25 | -------------------------------------------------------------------------------- /energia/Readme.md: -------------------------------------------------------------------------------- 1 | Basic Library for SHARP Memory LCD 2 | ================================== 3 | 4 | Created by Adrian Studer, June 2014. 5 | Distributed under MIT License, see license.txt for details. 6 | 7 | Basic library for SHARP Memory LCD. Developed with Energia and tested on MSP430G2553, MSP430F5529, Tiva TM4C123 8 | and CC3200 LaunchPads with 43oh and TI SHARP Memory LCD BoosterPacks. To run on Tiva and CC3200, Energia 9 | 0101E0013 or newer is required. 10 | 11 | While untested, this library should work with other LaunchPads as well as Arduino. It should also work with 12 | SHARP Memory LCD breakout boards sold by Adafruit, Kuzyatech and others. 13 | 14 | Methods 15 | ------- 16 | 17 | *SHARPMemLCDTxt(CS,DISP,VCOM)* Constructor of display class 18 | - CS: SPI chip select pin, default 13, set to 6 for TI BoosterPack 19 | - DISP: Pin to turn on/off display, default 8, set to 5 for TI BoosterPack 20 | - VCOM: Pin for hardware LCD polarity inversion, default 0, set to 5 for 43oh and 19 for TI BoosterPack (see VCOM section below) 21 | 22 | *begin()* Initialize display, including SPI library. Should be called within setup() section of your sketch. 23 | 24 | *on()* Turns display on 25 | 26 | *off()* Turns display off 27 | 28 | *clear()* Clears display contents 29 | 30 | *print(text,line,options)* Prints line of text 31 | - text: Text string to be displayed, only ASCII 32 through 90 (0-9, uppercase A-Z, some punctuation) 32 | - line: Vertical position of text 33 | - options: Formatting options, combinable by adding them together. DISP_INVERT, DISP_HIGH, DISP_WIDE 34 | 35 | *bitmap(bitmap,width,height,line,options)* Displays bitmap 36 | - bitmap: byte array 37 | - width: width of bitmap in pixels (should be multiple of 8) 38 | - height: heigth of bitmap in pixels 39 | - line: vertical position 40 | - options: Formatting options. DISP_INVERT 41 | 42 | *pulse(force)* Manually toggle VCOM (see VCOM section below) 43 | - force: If set to 0 (default) will only toggle VCOM if last call was at least 500ms ago. If set to 1, VCOM will toggled with each call. 44 | 45 | Display size 46 | ------------ 47 | 48 | The library as provided is for a screen size of 96x96 pixels. This is the dimension of the LCDs on the BoosterPacks and compatible with any 1.35" diagonal SHARP Memory LCD (LS013B4DN01, 02 and 04). You can adjust this library to different display sizes by editing PIXELS_X and PIXELS_Y in SHARPMemLCDTxt.h. 49 | 50 | SPI 51 | --- 52 | 53 | This library uses SPI to communicate with the display. If you want to use a different SPI module than the default, you will need to edit the SPI configuration inside the begin() method. 54 | 55 | Also note that this library will reconfigure SPI bit order to LSB each time it is called. You may need to adjust other libraries that rely on SPI to be compatible with this one. 56 | 57 | 58 | VCOM and LCD polarity inversion 59 | ------------------------------- 60 | 61 | SHARP Memory LCDs require an alternating signal VCOM to avoid DC bias buildup. DC bias over time may cause stuck pixels. 62 | The frequency of this singal varies by LCD model, but is typically specified as 0.5-30 Hz. 63 | 64 | The *print* and *bitmap* methods of this library automatically alternate polarity approximately twice per second. 65 | If your program updates the display less often, it is recommended to call *pulse* yourself at least once a second. 66 | 67 | SHARP Memory LCDs have two ways to provide the VCOM signal. One is by software with a special command, the other in hardware by 68 | wiggling the EXTCOMM pin. The method to use is determined by the state of the EXTMODE pin. By default EXTMODE is set to software 69 | on both BoosterPacks, modifyable with solder bridges. 70 | 71 | This library by default uses the software method to toggle VCOM. If your BoosterPack is configured for receiving VCOM by hardware, 72 | the pin connected to EXTCOMM is set as 3rd parameter of the SHARPMemLCDTxt constructor. 73 | 74 | It would be convenient to setup a timer interrupt to toggle VCOM by calling *pulse*. This will work fine in hardware mode. However, 75 | in software mode this can cause problems if the SPI library is using interrupts (not an issue with Energia and MSP430 Launchpads). 76 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/Examples/SHARPTest/SHARPTest.ino: -------------------------------------------------------------------------------- 1 | // Created by Adrian Studer, June 2014. 2 | // Distributed under MIT License, see license.txt for details. 3 | 4 | #include 5 | #include 6 | #include "tilogo.h" 7 | 8 | SHARPMemLCDTxt display; // configured for 43oh BoosterPack 9 | //SHARPMemLCDTxt display(6,5); // configured for official TI BoosterPack 10 | 11 | char text_buffer[8]; 12 | 13 | void setup() 14 | { 15 | // Turn on LCD power with offical TI BoosterPack 16 | // pinMode(2, OUTPUT); 17 | // digitalWrite(2, HIGH); 18 | 19 | display.begin(); // configure display 20 | 21 | display.clear(); 22 | display.on(); 23 | 24 | // display TI logo for 2 seconds 25 | display.bitmap(pixel_ti_logo, 96, 96, 0); 26 | delay(2000); 27 | display.clear(); 28 | 29 | // write static text 30 | display.print("HELLO WORLD!", 8); 31 | display.print(" ", 64, DISP_INVERT); 32 | display.print(" SHARP ", 72, DISP_INVERT + DISP_WIDE); 33 | display.print(" MEMORY LCD ", 80, DISP_INVERT); 34 | display.print(" ", 88, DISP_INVERT); 35 | } 36 | 37 | void loop() 38 | { 39 | // wait a while 40 | delay(500); 41 | 42 | // update pseudo clock 43 | long time = millis() / 1000; 44 | 45 | int time_minute = time / 60 % 99; 46 | int time_second = time % 60; 47 | 48 | text_buffer[0] = ' '; 49 | text_buffer[1] = time_minute / 10 + '0'; 50 | text_buffer[2] = time_minute % 10 + '0'; 51 | text_buffer[3] = ':'; 52 | text_buffer[4] = time_second / 10 + '0'; 53 | text_buffer[5] = time_second % 10 + '0'; 54 | text_buffer[6] = 0; 55 | 56 | display.print(text_buffer, 32, DISP_HIGH + DISP_WIDE); 57 | } 58 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/Examples/SHARPTest/tilogo.h: -------------------------------------------------------------------------------- 1 | // TI Logo 96x96px 2 | static const unsigned char pixel_ti_logo[] = 3 | { 4 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 5 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 6 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 7 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 8 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 9 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 10 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 11 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 12 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 13 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 14 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 15 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 16 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 17 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 18 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 19 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 20 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 21 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 22 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 23 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 24 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff, 25 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 26 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 27 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 28 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 29 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0x80, 0xff, 0xff, 0xff, 0xff, 30 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0x81, 0xff, 0xff, 0xff, 0xff, 31 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xe7, 0xc0, 0x1f, 0xff, 0xff, 32 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xff, 33 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0xff, 0xff, 34 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0e, 0x03, 0xc0, 0x00, 0xff, 0xff, 35 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1e, 0x03, 0x80, 0x00, 0xff, 0xff, 36 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1e, 0x07, 0x80, 0x00, 0xff, 0xff, 37 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1e, 0x07, 0x80, 0x00, 0xff, 0xff, 38 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1c, 0x07, 0x80, 0x00, 0xff, 0xff, 39 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x07, 0xfc, 0x07, 0xfc, 0x00, 0xff, 0xff, 40 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x07, 0xfc, 0x07, 0xfc, 0x00, 0xff, 0xff, 41 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xfc, 0x0f, 0xfc, 0x00, 0xff, 0xff, 42 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xfc, 0x0f, 0xfc, 0x00, 0xff, 0xff, 43 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xf8, 0x0f, 0xf8, 0x00, 0xff, 0xff, 44 | 0xff, 0xff, 0xff, 0xfe, 0x00, 0x0f, 0xf8, 0x0f, 0xf8, 0x00, 0x7f, 0xff, 45 | 0xff, 0xf0, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x1f, 0xf8, 0x00, 0x7f, 0xff, 46 | 0xff, 0xf0, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x1f, 0xf8, 0x00, 0x3f, 0xff, 47 | 0xff, 0xf8, 0x00, 0x00, 0x00, 0x1f, 0xf8, 0x1f, 0xf0, 0x00, 0x1f, 0xff, 48 | 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1e, 0x00, 0x00, 0x0f, 0xff, 49 | 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1c, 0x00, 0x00, 0x0f, 0xff, 50 | 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3c, 0x00, 0x00, 0x0f, 0xff, 51 | 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3c, 0x00, 0x00, 0x0f, 0xff, 52 | 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x3c, 0x00, 0x00, 0x0f, 0xff, 53 | 0xff, 0xff, 0x80, 0x00, 0x00, 0x01, 0xe0, 0x38, 0x00, 0x00, 0x0f, 0xff, 54 | 0xff, 0xff, 0xc0, 0x00, 0x00, 0x01, 0xe0, 0x38, 0x00, 0x00, 0x0f, 0xff, 55 | 0xff, 0xff, 0xe0, 0x00, 0x00, 0x01, 0xe0, 0x78, 0x00, 0x00, 0x0f, 0xff, 56 | 0xff, 0xff, 0xf0, 0x00, 0x00, 0x01, 0xe0, 0x78, 0x00, 0x00, 0x0f, 0xff, 57 | 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xc0, 0x70, 0x00, 0x00, 0x0f, 0xff, 58 | 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xc0, 0x70, 0x00, 0x00, 0x0f, 0xff, 59 | 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xc0, 0x70, 0x00, 0x00, 0x1f, 0xff, 60 | 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xf8, 0x00, 0x00, 0x1f, 0xff, 61 | 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0x1f, 0xff, 62 | 0xff, 0xff, 0xfe, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0xff, 0xff, 63 | 0xff, 0xff, 0xfe, 0x00, 0x7c, 0x03, 0xff, 0xff, 0x80, 0x03, 0xff, 0xff, 64 | 0xff, 0xff, 0xff, 0x00, 0xff, 0x03, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 65 | 0xff, 0xff, 0xff, 0x81, 0xff, 0x01, 0xff, 0xff, 0x00, 0x3f, 0xff, 0xff, 66 | 0xff, 0xff, 0xff, 0xc3, 0xff, 0x81, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 67 | 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xfe, 0x01, 0xff, 0xff, 0xff, 68 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xfc, 0x03, 0xff, 0xff, 0xff, 69 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xe0, 0x07, 0xff, 0xff, 0xff, 70 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 71 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 72 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 73 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 74 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 75 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 76 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 77 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 78 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 79 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 80 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 81 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 82 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xff, 83 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 84 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 85 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0xff, 0xff, 0xff, 0xff, 86 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0xff, 0xff, 0xff, 0xff, 87 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 88 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 89 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 90 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 91 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 92 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 93 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 94 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 95 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 96 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 97 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 98 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 99 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 100 | }; 101 | 102 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/SHARPMemLCDTxt.cpp: -------------------------------------------------------------------------------- 1 | // Created by Adrian Studer, April 2014. 2 | // Distributed under MIT License, see license.txt for details. 3 | 4 | #include 5 | #include 6 | #include "SHARPMemLCDTxt.h" 7 | #include "font.h" 8 | 9 | #define CMD_WR 0x01 10 | #define CMD_CLR 0x04 11 | #define CMD_NOP 0x00 12 | #define CMD_VCOM 0x02 13 | 14 | volatile char spi_busy = 0; 15 | 16 | SHARPMemLCDTxt::SHARPMemLCDTxt(char pinCS, char pinDISP, char pinVCOM) 17 | : m_pinCS(pinCS), m_pinDISP(pinDISP), m_pinVCOM(pinVCOM), m_stateVCOM(0) 18 | { 19 | } 20 | 21 | SHARPMemLCDTxt::~SHARPMemLCDTxt() 22 | { 23 | } 24 | 25 | void SHARPMemLCDTxt::begin() 26 | { 27 | pinMode(m_pinCS, OUTPUT); 28 | pinMode(m_pinDISP, OUTPUT); 29 | 30 | digitalWrite(m_pinCS, LOW); 31 | digitalWrite(m_pinDISP, LOW); 32 | 33 | if (m_pinVCOM != 0) { 34 | pinMode(m_pinVCOM, OUTPUT); 35 | } else { 36 | m_millis = millis(); 37 | } 38 | 39 | // configure SPI 40 | SPI.begin(); 41 | SPI.setBitOrder(0); // bit order LSB first 42 | SPI.setClockDivider(F_CPU/1000000); // run SPI at 1MHz 43 | } 44 | 45 | void SHARPMemLCDTxt::on() 46 | { 47 | digitalWrite(m_pinDISP, HIGH); 48 | } 49 | 50 | void SHARPMemLCDTxt::off() 51 | { 52 | digitalWrite(m_pinDISP, LOW); 53 | } 54 | 55 | void SHARPMemLCDTxt::clear() 56 | { 57 | spi_busy = 1; 58 | 59 | SPI.setBitOrder(0); // bit order LSB first 60 | 61 | digitalWrite(m_pinCS, HIGH); 62 | SPI.transfer(CMD_CLR | m_stateVCOM); 63 | SPI.transfer(0); 64 | digitalWrite(m_pinCS, LOW); 65 | 66 | spi_busy = 0; 67 | } 68 | 69 | void SHARPMemLCDTxt::print(const char* text, char line, char options) 70 | { 71 | pulse(0); 72 | 73 | SPI.setBitOrder(0); // bit order LSB first 74 | 75 | // c = char 76 | // b = bitmap 77 | // i = text index 78 | // j = line buffer index 79 | // k = char line 80 | unsigned char c, b, i, j, k; 81 | 82 | // rendering happens line-by-line because this display can only be written by line 83 | k = 0; 84 | while (k < 8 && line < PIXELS_Y) { // loop for 8 character lines while within display 85 | i = 0; 86 | j = 0; 87 | while (j < (PIXELS_X/8) && (c = text[i]) != 0) { // while we did not reach end of line or string 88 | if (c < ' ' || c > 'Z') { // invalid characters are replace with SPACE 89 | c = ' '; 90 | } 91 | 92 | c = c - 32; // convert character to index in font table 93 | b = font8x8[(c*8)+k]; // retrieve byte defining one line of character 94 | 95 | if (!(options & DISP_INVERT)) { // invert bits if DISP_INVERT is _NOT_ selected 96 | b = ~b;// pixels are LOW active 97 | } 98 | 99 | if ((options & DISP_WIDE) && (c != 0)) { // double width rendering if DISP_WIDE and character is not SPACE 100 | doubleWide(b, j); 101 | j += 2; // we've written two bytes to buffer 102 | } else { // else regular rendering 103 | m_buffer[j] = b; // store pixels in line buffer 104 | j++; // we've written one byte to buffer 105 | } 106 | 107 | i++; // next character 108 | } 109 | 110 | while (j < (PIXELS_X/8)) { // pad line for empty characters 111 | m_buffer[j] = 0xff; 112 | j++; 113 | } 114 | 115 | writeBuffer(line++); // write line buffer to display 116 | 117 | if (options & DISP_HIGH && line < PIXELS_Y) { // repeat line if DISP_HIGH is selected 118 | writeBuffer(line++); 119 | } 120 | 121 | k++; // next pixel line 122 | } 123 | } 124 | 125 | void SHARPMemLCDTxt::pulse(int force) 126 | { 127 | int update = 1; 128 | 129 | if (!force) { 130 | unsigned long time = millis(); 131 | if (time - m_millis > 500) { 132 | m_millis = time; 133 | } else { 134 | update = 0; 135 | } 136 | } 137 | 138 | if (update) { 139 | if (m_pinVCOM != 0) { 140 | digitalWrite(m_pinVCOM, HIGH); 141 | delayMicroseconds(1); 142 | digitalWrite(m_pinVCOM, LOW); 143 | } else { 144 | m_stateVCOM ^= CMD_VCOM; 145 | if (!spi_busy) { 146 | spi_busy = 1; 147 | SPI.setBitOrder(0); // bit order LSB first 148 | digitalWrite(m_pinCS, HIGH); 149 | SPI.transfer(CMD_NOP | m_stateVCOM); 150 | SPI.transfer(0); 151 | digitalWrite(m_pinCS, LOW); 152 | spi_busy = 0; 153 | } 154 | } 155 | } 156 | } 157 | 158 | void SHARPMemLCDTxt::bitmap(const unsigned char* bitmap, int width, int height, char line, char options) 159 | { 160 | pulse(0); 161 | 162 | SPI.setBitOrder(0); // bit order LSB first 163 | 164 | if (!bitmap) return; 165 | 166 | unsigned char b; 167 | int i = 0; 168 | int p = 0; 169 | int x = width/8; 170 | 171 | while (height > 0 && line < PIXELS_Y) { 172 | while (i < PIXELS_X/8 && i < x) { 173 | b = bitmap[p+i]; 174 | if (!(options & DISP_INVERT)) { // invert bits if DISP_INVERT is _NOT_ selected 175 | b = ~b;// pixels are LOW active 176 | } 177 | m_buffer[i] = b; 178 | i++; 179 | } 180 | writeBuffer(line); 181 | p += x; 182 | i = 0; 183 | height--; 184 | line++; 185 | } 186 | } 187 | 188 | void SHARPMemLCDTxt::doubleWide(char b, char j) 189 | { 190 | int i = 8; 191 | unsigned int c = 0; 192 | 193 | do { 194 | c <<= 2; 195 | if (b & 0x80) { 196 | c |= 3; 197 | } 198 | b <<= 1; 199 | i--; 200 | } while (i != 0); 201 | 202 | m_buffer[j] = c >> 8; 203 | m_buffer[j+1] = c & 0xff; 204 | } 205 | 206 | void SHARPMemLCDTxt::writeBuffer(char line) 207 | { 208 | if (line > PIXELS_Y) return; // ignore writing to invalid lines 209 | 210 | spi_busy = 1; 211 | 212 | digitalWrite(m_pinCS, HIGH); 213 | 214 | SPI.transfer(CMD_WR | m_stateVCOM); // send command to write line(s) 215 | 216 | SPI.transfer(line+1); // send line address 217 | 218 | SPI.setBitOrder(1); // switch SPI to MSB first for proper bitmap orientation 219 | 220 | char j = 0; 221 | while (j < (PIXELS_X/8)) { // write pixels / 8 bytes 222 | SPI.transfer(m_buffer[j++]); 223 | } 224 | 225 | SPI.transfer(0); // transfer 16 bit to latch buffers and end transmission 226 | SPI.transfer(0); 227 | 228 | SPI.setBitOrder(0); // switch SPI back to LSB first for commands 229 | 230 | digitalWrite(m_pinCS, LOW); 231 | 232 | spi_busy = 0; 233 | } 234 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/SHARPMemLCDTxt.h: -------------------------------------------------------------------------------- 1 | // Created by Adrian Studer, April 2014. 2 | // Distributed under MIT License, see license.txt for details. 3 | 4 | #ifndef __SHARPMEMLCDTXT_H__ 5 | #define __SHARPMEMLCDTXT_H__ 6 | 7 | #define DISP_INVERT 1 8 | #define DISP_WIDE 2 9 | #define DISP_HIGH 4 10 | 11 | #ifndef PIXELS_X 12 | #define PIXELS_X 96 13 | #endif 14 | 15 | #ifndef PIXELS_Y 16 | #define PIXELS_Y 96 17 | #endif 18 | 19 | class SHARPMemLCDTxt 20 | { 21 | private: 22 | char m_pinCS; 23 | char m_pinDISP; 24 | char m_pinVCOM; 25 | char m_stateVCOM; 26 | unsigned long m_millis; 27 | char m_buffer[PIXELS_X/8]; 28 | 29 | void writeBuffer(char line); 30 | void doubleWide(char b, char j); 31 | 32 | public: 33 | SHARPMemLCDTxt(char pinCS = 13, 34 | char pinDISP = 8, 35 | char pinVCOM = 0); 36 | ~SHARPMemLCDTxt(); 37 | void begin(); 38 | void clear(); 39 | void on(); 40 | void off(); 41 | void print(const char* text, char line, char options = 0); 42 | void pulse(int force = 0); 43 | void bitmap(const unsigned char* bitmap, int width, int height, char line, char options = 0); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/font.h: -------------------------------------------------------------------------------- 1 | // Created by Adrian Studer, April 2014. 2 | // Distributed under MIT License, see license.txt for details. 3 | 4 | #ifndef FONT_H_ 5 | #define FONT_H_ 6 | 7 | // ASCII offset 32, i.e. starts with SPACE. Ends with upper case Z. 8 | 9 | const unsigned char font8x8[] = { 10 | /* 0 ' ' */ 11 | /* 00000000 */ 0, 12 | /* 00000000 */ 0, 13 | /* 00000000 */ 0, 14 | /* 00000000 */ 0, 15 | /* 00000000 */ 0, 16 | /* 00000000 */ 0, 17 | /* 00000000 */ 0, 18 | /* 00000000 */ 0, 19 | /* 1 '!' */ 20 | /* 00110000 */ 0x30, 21 | /* 00110000 */ 0x30, 22 | /* 00110000 */ 0x30, 23 | /* 00110000 */ 0x30, 24 | /* 00110000 */ 0x30, 25 | /* 00000000 */ 0, 26 | /* 00110000 */ 0x30, 27 | /* 00000000 */ 0, 28 | /* 2 '"' */ 29 | /* 01101100 */ 0x6c, 30 | /* 01101100 */ 0x6c, 31 | /* 01101100 */ 0x6c, 32 | /* 00000000 */ 0, 33 | /* 00000000 */ 0, 34 | /* 00000000 */ 0, 35 | /* 00000000 */ 0, 36 | /* 00000000 */ 0, 37 | /* 3 '#' */ 38 | /* 01101100 */ 0x6c, 39 | /* 01101100 */ 0x6c, 40 | /* 11111110 */ 0xfe, 41 | /* 01101100 */ 0x6c, 42 | /* 11111110 */ 0xfe, 43 | /* 01101100 */ 0x6c, 44 | /* 01101100 */ 0x6c, 45 | /* 00000000 */ 0, 46 | /* 4 '$' */ 47 | /* 00011000 */ 0x18, 48 | /* 01111110 */ 0x7e, 49 | /* 11011000 */ 0xd8, 50 | /* 01111100 */ 0x7c, 51 | /* 00011010 */ 0x1a, 52 | /* 11111100 */ 0xfc, 53 | /* 00011000 */ 0x18, 54 | /* 00000000 */ 0, 55 | /* 5 '%' */ 56 | /* 01100000 */ 0x60, 57 | /* 01100110 */ 0x66, 58 | /* 00001100 */ 0xc, 59 | /* 00011000 */ 0x18, 60 | /* 00110000 */ 0x30, 61 | /* 01100110 */ 0x66, 62 | /* 01000110 */ 0x46, 63 | /* 00000000 */ 0, 64 | /* 6 '&' */ 65 | /* 01110000 */ 0x70, 66 | /* 11011000 */ 0xd8, 67 | /* 11010000 */ 0xd0, 68 | /* 01110000 */ 0x70, 69 | /* 11011010 */ 0xda, 70 | /* 11001100 */ 0xcc, 71 | /* 01111010 */ 0x7a, 72 | /* 00000000 */ 0, 73 | /* 7 ''' */ 74 | /* 00111000 */ 0x38, 75 | /* 00011000 */ 0x18, 76 | /* 00110000 */ 0x30, 77 | /* 00000000 */ 0, 78 | /* 00000000 */ 0, 79 | /* 00000000 */ 0, 80 | /* 00000000 */ 0, 81 | /* 00000000 */ 0, 82 | /* 8 '(' */ 83 | /* 00011000 */ 0x18, 84 | /* 00110000 */ 0x30, 85 | /* 01100000 */ 0x60, 86 | /* 01100000 */ 0x60, 87 | /* 01100000 */ 0x60, 88 | /* 00110000 */ 0x30, 89 | /* 00011000 */ 0x18, 90 | /* 00000000 */ 0, 91 | /* 9 ')' */ 92 | /* 01100000 */ 0x60, 93 | /* 00110000 */ 0x30, 94 | /* 00011000 */ 0x18, 95 | /* 00011000 */ 0x18, 96 | /* 00011000 */ 0x18, 97 | /* 00110000 */ 0x30, 98 | /* 01100000 */ 0x60, 99 | /* 00000000 */ 0, 100 | /* a '*' */ 101 | /* 00110000 */ 0x30, 102 | /* 10110100 */ 0xb4, 103 | /* 01111000 */ 0x78, 104 | /* 00110000 */ 0x30, 105 | /* 01111000 */ 0x78, 106 | /* 10110100 */ 0xb4, 107 | /* 00110000 */ 0x30, 108 | /* 00000000 */ 0, 109 | /* b '+' */ 110 | /* 00000000 */ 0, 111 | /* 00110000 */ 0x30, 112 | /* 00110000 */ 0x30, 113 | /* 11111100 */ 0xfc, 114 | /* 00110000 */ 0x30, 115 | /* 00110000 */ 0x30, 116 | /* 00000000 */ 0, 117 | /* 00000000 */ 0, 118 | /* c ',' */ 119 | /* 00000000 */ 0, 120 | /* 00000000 */ 0, 121 | /* 00000000 */ 0, 122 | /* 00000000 */ 0, 123 | /* 00000000 */ 0, 124 | /* 11100000 */ 0xe0, 125 | /* 01100000 */ 0x60, 126 | /* 11000000 */ 0xc0, 127 | /* d '-' */ 128 | /* 00000000 */ 0, 129 | /* 00000000 */ 0, 130 | /* 00000000 */ 0, 131 | /* 01111100 */ 0x7c, 132 | /* 00000000 */ 0, 133 | /* 00000000 */ 0, 134 | /* 00000000 */ 0, 135 | /* 00000000 */ 0, 136 | /* e '.' */ 137 | /* 00000000 */ 0, 138 | /* 00000000 */ 0, 139 | /* 00000000 */ 0, 140 | /* 00000000 */ 0, 141 | /* 00000000 */ 0, 142 | /* 01110000 */ 0x70, 143 | /* 01110000 */ 0x70, 144 | /* 00000000 */ 0, 145 | /* f '/' */ 146 | /* 00000000 */ 0, 147 | /* 00001100 */ 0xc, 148 | /* 00011000 */ 0x18, 149 | /* 00110000 */ 0x30, 150 | /* 01100000 */ 0x60, 151 | /* 11000000 */ 0xc0, 152 | /* 10000000 */ 0x80, 153 | /* 00000000 */ 0, 154 | /* 10 '0' */ 155 | /* 00111000 */ 0x38, 156 | /* 11000110 */ 0xc6, 157 | /* 11001110 */ 0xce, 158 | /* 11010110 */ 0xd6, 159 | /* 11100110 */ 0xe6, 160 | /* 11000110 */ 0xc6, 161 | /* 00111000 */ 0x38, 162 | /* 00000000 */ 0, 163 | /* 11 '1' */ 164 | /* 00110000 */ 0x30, 165 | /* 01110000 */ 0x70, 166 | /* 00110000 */ 0x30, 167 | /* 00110000 */ 0x30, 168 | /* 00110000 */ 0x30, 169 | /* 00110000 */ 0x30, 170 | /* 01111000 */ 0x78, 171 | /* 00000000 */ 0, 172 | /* 12 '2' */ 173 | /* 01111000 */ 0x78, 174 | /* 11001100 */ 0xcc, 175 | /* 00001100 */ 0xc, 176 | /* 00011000 */ 0x18, 177 | /* 00110000 */ 0x30, 178 | /* 01100000 */ 0x60, 179 | /* 11111100 */ 0xfc, 180 | /* 00000000 */ 0, 181 | /* 13 '3' */ 182 | /* 11111100 */ 0xfc, 183 | /* 00011000 */ 0x18, 184 | /* 00110000 */ 0x30, 185 | /* 00011000 */ 0x18, 186 | /* 00001100 */ 0xc, 187 | /* 11001100 */ 0xcc, 188 | /* 01111000 */ 0x78, 189 | /* 00000000 */ 0, 190 | /* 14 '4' */ 191 | /* 00111000 */ 0x38, 192 | /* 01111000 */ 0x78, 193 | /* 11011000 */ 0xd8, 194 | /* 10011000 */ 0x98, 195 | /* 11111100 */ 0xfc, 196 | /* 00011000 */ 0x18, 197 | /* 00011000 */ 0x18, 198 | /* 00000000 */ 0, 199 | /* 15 '5' */ 200 | /* 11111100 */ 0xfc, 201 | /* 11000000 */ 0xc0, 202 | /* 11111000 */ 0xf8, 203 | /* 00001100 */ 0xc, 204 | /* 00001100 */ 0xc, 205 | /* 11001100 */ 0xcc, 206 | /* 01111000 */ 0x78, 207 | /* 00000000 */ 0, 208 | /* 16 '6' */ 209 | /* 00111000 */ 0x38, 210 | /* 01100000 */ 0x60, 211 | /* 11000000 */ 0xc0, 212 | /* 11111000 */ 0xf8, 213 | /* 11001100 */ 0xcc, 214 | /* 11001100 */ 0xcc, 215 | /* 01111000 */ 0x78, 216 | /* 00000000 */ 0, 217 | /* 17 '7' */ 218 | /* 11111100 */ 0xfc, 219 | /* 00001100 */ 0xc, 220 | /* 00011000 */ 0x18, 221 | /* 00110000 */ 0x30, 222 | /* 01100000 */ 0x60, 223 | /* 01100000 */ 0x60, 224 | /* 01100000 */ 0x60, 225 | /* 00000000 */ 0, 226 | /* 18 '8' */ 227 | /* 01111000 */ 0x78, 228 | /* 11001100 */ 0xcc, 229 | /* 11001100 */ 0xcc, 230 | /* 01111000 */ 0x78, 231 | /* 11001100 */ 0xcc, 232 | /* 11001100 */ 0xcc, 233 | /* 01111000 */ 0x78, 234 | /* 00000000 */ 0, 235 | /* 19 '9' */ 236 | /* 01111000 */ 0x78, 237 | /* 11001100 */ 0xcc, 238 | /* 11001100 */ 0xcc, 239 | /* 01111100 */ 0x7c, 240 | /* 00001100 */ 0xc, 241 | /* 00011000 */ 0x18, 242 | /* 01110000 */ 0x70, 243 | /* 00000000 */ 0, 244 | /* 1a ':' */ 245 | /* 00000000 */ 0, 246 | /* 00111000 */ 0x38, 247 | /* 00111000 */ 0x38, 248 | /* 00000000 */ 0, 249 | /* 00111000 */ 0x38, 250 | /* 00111000 */ 0x38, 251 | /* 00000000 */ 0, 252 | /* 00000000 */ 0, 253 | /* 1b ';' */ 254 | /* 00000000 */ 0, 255 | /* 00111000 */ 0x38, 256 | /* 00111000 */ 0x38, 257 | /* 00000000 */ 0, 258 | /* 00111000 */ 0x38, 259 | /* 00011000 */ 0x18, 260 | /* 00110000 */ 0x30, 261 | /* 00000000 */ 0, 262 | /* 1c '<' */ 263 | /* 00011000 */ 0x18, 264 | /* 00110000 */ 0x30, 265 | /* 01100000 */ 0x60, 266 | /* 11000000 */ 0xc0, 267 | /* 01100000 */ 0x60, 268 | /* 00110000 */ 0x30, 269 | /* 00011000 */ 0x18, 270 | /* 00000000 */ 0, 271 | /* 1d '=' */ 272 | /* 00000000 */ 0, 273 | /* 00000000 */ 0, 274 | /* 01111100 */ 0x7c, 275 | /* 00000000 */ 0, 276 | /* 01111100 */ 0x7c, 277 | /* 00000000 */ 0, 278 | /* 00000000 */ 0, 279 | /* 00000000 */ 0, 280 | /* 1e '>' */ 281 | /* 01100000 */ 0x60, 282 | /* 00110000 */ 0x30, 283 | /* 00011000 */ 0x18, 284 | /* 00001100 */ 0xc, 285 | /* 00011000 */ 0x18, 286 | /* 00110000 */ 0x30, 287 | /* 01100000 */ 0x60, 288 | /* 00000000 */ 0, 289 | /* 1f '?' */ 290 | /* 01111000 */ 0x78, 291 | /* 11001100 */ 0xcc, 292 | /* 00001100 */ 0xc, 293 | /* 00011000 */ 0x18, 294 | /* 00110000 */ 0x30, 295 | /* 00000000 */ 0, 296 | /* 00110000 */ 0x30, 297 | /* 00000000 */ 0, 298 | /* 20 '@' */ 299 | /* 00111000 */ 0x38, 300 | /* 11001100 */ 0xcc, 301 | /* 11010110 */ 0xd6, 302 | /* 11010110 */ 0xd6, 303 | /* 11011100 */ 0xdc, 304 | /* 11000000 */ 0xc0, 305 | /* 00111000 */ 0x38, 306 | /* 00000000 */ 0, 307 | /* 21 'A' */ 308 | /* 01111000 */ 0x78, 309 | /* 11001100 */ 0xcc, 310 | /* 11001100 */ 0xcc, 311 | /* 11111100 */ 0xfc, 312 | /* 11001100 */ 0xcc, 313 | /* 11001100 */ 0xcc, 314 | /* 11001100 */ 0xcc, 315 | /* 00000000 */ 0, 316 | /* 22 'B' */ 317 | /* 11111000 */ 0xf8, 318 | /* 11001100 */ 0xcc, 319 | /* 11001100 */ 0xcc, 320 | /* 11111000 */ 0xf8, 321 | /* 11001100 */ 0xcc, 322 | /* 11001100 */ 0xcc, 323 | /* 11111000 */ 0xf8, 324 | /* 00000000 */ 0, 325 | /* 23 'C' */ 326 | /* 01111000 */ 0x78, 327 | /* 11001100 */ 0xcc, 328 | /* 11000000 */ 0xc0, 329 | /* 11000000 */ 0xc0, 330 | /* 11000000 */ 0xc0, 331 | /* 11001100 */ 0xcc, 332 | /* 01111000 */ 0x78, 333 | /* 00000000 */ 0, 334 | /* 24 'D' */ 335 | /* 11110000 */ 0xf0, 336 | /* 11011000 */ 0xd8, 337 | /* 11001100 */ 0xcc, 338 | /* 11001100 */ 0xcc, 339 | /* 11001100 */ 0xcc, 340 | /* 11011000 */ 0xd8, 341 | /* 11110000 */ 0xf0, 342 | /* 00000000 */ 0, 343 | /* 25 'E' */ 344 | /* 11111100 */ 0xfc, 345 | /* 11000000 */ 0xc0, 346 | /* 11000000 */ 0xc0, 347 | /* 11111000 */ 0xf8, 348 | /* 11000000 */ 0xc0, 349 | /* 11000000 */ 0xc0, 350 | /* 11111100 */ 0xfc, 351 | /* 00000000 */ 0, 352 | /* 26 'F' */ 353 | /* 11111100 */ 0xfc, 354 | /* 11000000 */ 0xc0, 355 | /* 11000000 */ 0xc0, 356 | /* 11111000 */ 0xf8, 357 | /* 11000000 */ 0xc0, 358 | /* 11000000 */ 0xc0, 359 | /* 11000000 */ 0xc0, 360 | /* 00000000 */ 0, 361 | /* 27 'G' */ 362 | /* 01111000 */ 0x78, 363 | /* 11001100 */ 0xcc, 364 | /* 11000000 */ 0xc0, 365 | /* 11011100 */ 0xdc, 366 | /* 11001100 */ 0xcc, 367 | /* 11001100 */ 0xcc, 368 | /* 01111100 */ 0x7c, 369 | /* 00000000 */ 0, 370 | /* 28 'H' */ 371 | /* 11001100 */ 0xcc, 372 | /* 11001100 */ 0xcc, 373 | /* 11001100 */ 0xcc, 374 | /* 11111100 */ 0xfc, 375 | /* 11001100 */ 0xcc, 376 | /* 11001100 */ 0xcc, 377 | /* 11001100 */ 0xcc, 378 | /* 00000000 */ 0, 379 | /* 29 'I' */ 380 | /* 01111110 */ 0x7e, 381 | /* 00011000 */ 0x18, 382 | /* 00011000 */ 0x18, 383 | /* 00011000 */ 0x18, 384 | /* 00011000 */ 0x18, 385 | /* 00011000 */ 0x18, 386 | /* 01111110 */ 0x7e, 387 | /* 00000000 */ 0, 388 | /* 2a 'J' */ 389 | /* 00111100 */ 0x3c, 390 | /* 00011000 */ 0x18, 391 | /* 00011000 */ 0x18, 392 | /* 00011000 */ 0x18, 393 | /* 00011000 */ 0x18, 394 | /* 11011000 */ 0xd8, 395 | /* 01110000 */ 0x70, 396 | /* 00000000 */ 0, 397 | /* 2b 'K' */ 398 | /* 11001100 */ 0xcc, 399 | /* 11011000 */ 0xd8, 400 | /* 11110000 */ 0xf0, 401 | /* 11100000 */ 0xe0, 402 | /* 11110000 */ 0xf0, 403 | /* 11011000 */ 0xd8, 404 | /* 11001100 */ 0xcc, 405 | /* 00000000 */ 0, 406 | /* 2c 'L' */ 407 | /* 11000000 */ 0xc0, 408 | /* 11000000 */ 0xc0, 409 | /* 11000000 */ 0xc0, 410 | /* 11000000 */ 0xc0, 411 | /* 11000000 */ 0xc0, 412 | /* 11000000 */ 0xc0, 413 | /* 11111100 */ 0xfc, 414 | /* 00000000 */ 0, 415 | /* 2d 'M' */ 416 | /* 11000110 */ 0xc6, 417 | /* 11101110 */ 0xee, 418 | /* 11111110 */ 0xfe, 419 | /* 11010110 */ 0xd6, 420 | /* 11000110 */ 0xc6, 421 | /* 11000110 */ 0xc6, 422 | /* 11000110 */ 0xc6, 423 | /* 00000000 */ 0, 424 | /* 2e 'N' */ 425 | /* 11001100 */ 0xcc, 426 | /* 11001100 */ 0xcc, 427 | /* 11101100 */ 0xec, 428 | /* 11111100 */ 0xfc, 429 | /* 11011100 */ 0xdc, 430 | /* 11001100 */ 0xcc, 431 | /* 11001100 */ 0xcc, 432 | /* 00000000 */ 0, 433 | /* 2f 'O' */ 434 | /* 01111000 */ 0x78, 435 | /* 11001100 */ 0xcc, 436 | /* 11001100 */ 0xcc, 437 | /* 11001100 */ 0xcc, 438 | /* 11001100 */ 0xcc, 439 | /* 11001100 */ 0xcc, 440 | /* 01111000 */ 0x78, 441 | /* 00000000 */ 0, 442 | /* 30 'P' */ 443 | /* 11111000 */ 0xf8, 444 | /* 11001100 */ 0xcc, 445 | /* 11001100 */ 0xcc, 446 | /* 11111000 */ 0xf8, 447 | /* 11000000 */ 0xc0, 448 | /* 11000000 */ 0xc0, 449 | /* 11000000 */ 0xc0, 450 | /* 00000000 */ 0, 451 | /* 31 'Q' */ 452 | /* 01111100 */ 0x7c, 453 | /* 11000110 */ 0xc6, 454 | /* 11000110 */ 0xc6, 455 | /* 11000110 */ 0xc6, 456 | /* 11010110 */ 0xd6, 457 | /* 11001000 */ 0xc8, 458 | /* 01110100 */ 0x74, 459 | /* 00000000 */ 0, 460 | /* 32 'R' */ 461 | /* 11111000 */ 0xf8, 462 | /* 11001100 */ 0xcc, 463 | /* 11001100 */ 0xcc, 464 | /* 11111000 */ 0xf8, 465 | /* 11110000 */ 0xf0, 466 | /* 11011000 */ 0xd8, 467 | /* 11001100 */ 0xcc, 468 | /* 00000000 */ 0, 469 | /* 33 'S' */ 470 | /* 01111100 */ 0x7c, 471 | /* 11000000 */ 0xc0, 472 | /* 11000000 */ 0xc0, 473 | /* 01111000 */ 0x78, 474 | /* 00001100 */ 0xc, 475 | /* 00001100 */ 0xc, 476 | /* 11111000 */ 0xf8, 477 | /* 00000000 */ 0, 478 | /* 34 'T' */ 479 | /* 11111100 */ 0xfc, 480 | /* 00110000 */ 0x30, 481 | /* 00110000 */ 0x30, 482 | /* 00110000 */ 0x30, 483 | /* 00110000 */ 0x30, 484 | /* 00110000 */ 0x30, 485 | /* 00110000 */ 0x30, 486 | /* 00000000 */ 0, 487 | /* 35 'U' */ 488 | /* 11001100 */ 0xcc, 489 | /* 11001100 */ 0xcc, 490 | /* 11001100 */ 0xcc, 491 | /* 11001100 */ 0xcc, 492 | /* 11001100 */ 0xcc, 493 | /* 11001100 */ 0xcc, 494 | /* 01111000 */ 0x78, 495 | /* 00000000 */ 0, 496 | /* 36 'V' */ 497 | /* 11001100 */ 0xcc, 498 | /* 11001100 */ 0xcc, 499 | /* 11001100 */ 0xcc, 500 | /* 11001100 */ 0xcc, 501 | /* 11001100 */ 0xcc, 502 | /* 01111000 */ 0x78, 503 | /* 00110000 */ 0x30, 504 | /* 00000000 */ 0, 505 | /* 37 'W' */ 506 | /* 11000110 */ 0xc6, 507 | /* 11000110 */ 0xc6, 508 | /* 11000110 */ 0xc6, 509 | /* 11010110 */ 0xd6, 510 | /* 11010110 */ 0xd6, 511 | /* 11111110 */ 0xfe, 512 | /* 01101100 */ 0x6c, 513 | /* 00000000 */ 0, 514 | /* 38 'X' */ 515 | /* 11000110 */ 0xc6, 516 | /* 11000110 */ 0xc6, 517 | /* 01101100 */ 0x6c, 518 | /* 00111000 */ 0x38, 519 | /* 01101100 */ 0x6c, 520 | /* 11000110 */ 0xc6, 521 | /* 11000110 */ 0xc6, 522 | /* 00000000 */ 0, 523 | /* 39 'Y' */ 524 | /* 11001100 */ 0xcc, 525 | /* 11001100 */ 0xcc, 526 | /* 11001100 */ 0xcc, 527 | /* 01111000 */ 0x78, 528 | /* 00110000 */ 0x30, 529 | /* 00110000 */ 0x30, 530 | /* 00110000 */ 0x30, 531 | /* 00000000 */ 0, 532 | /* 3a 'Z' */ 533 | /* 11111100 */ 0xfc, 534 | /* 00001100 */ 0xc, 535 | /* 00011000 */ 0x18, 536 | /* 00110000 */ 0x30, 537 | /* 01100000 */ 0x60, 538 | /* 11000000 */ 0xc0, 539 | /* 11111100 */ 0xfc, 540 | /* 00000000 */ 0, 541 | }; 542 | 543 | #endif /* FONT_H_ */ 544 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/keywords.txt: -------------------------------------------------------------------------------- 1 | SHARPMemLCDTxt KEYWORD1 2 | 3 | begin KEYWORD2 4 | clear KEYWORD2 5 | on KEYWORD2 6 | off KEYWORD2 7 | print KEYWORD2 8 | pulse KEYWORD2 9 | bitmap KEYWORD2 10 | 11 | DISP_INVERT LITERAL1 12 | DISP_WIDE LITERAL1 13 | DISP_HIGH LITERAL1 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /energia/libraries/SHARPMemLCDTxt/license.txt: -------------------------------------------------------------------------------- 1 | SHARP Memory LCD Text Library Copyright (c) 2014 Adrian Studer 2 | 3 | The MIT License (MIT) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /font.h: -------------------------------------------------------------------------------- 1 | /* 2 | * font.h 3 | * 4 | * Created on: Jul 21, 2012 5 | * Author: adrian 6 | */ 7 | 8 | #ifndef FONT_H_ 9 | #define FONT_H_ 10 | 11 | // ASCII offset 32, i.e. starts with SPACE. Ends with upper case Z. 12 | 13 | const unsigned char font8x8[] = { 14 | /* 0 ' ' */ 15 | /* 00000000 */ 0, 16 | /* 00000000 */ 0, 17 | /* 00000000 */ 0, 18 | /* 00000000 */ 0, 19 | /* 00000000 */ 0, 20 | /* 00000000 */ 0, 21 | /* 00000000 */ 0, 22 | /* 00000000 */ 0, 23 | /* 1 '!' */ 24 | /* 00110000 */ 0x30, 25 | /* 00110000 */ 0x30, 26 | /* 00110000 */ 0x30, 27 | /* 00110000 */ 0x30, 28 | /* 00110000 */ 0x30, 29 | /* 00000000 */ 0, 30 | /* 00110000 */ 0x30, 31 | /* 00000000 */ 0, 32 | /* 2 '"' */ 33 | /* 01101100 */ 0x6c, 34 | /* 01101100 */ 0x6c, 35 | /* 01101100 */ 0x6c, 36 | /* 00000000 */ 0, 37 | /* 00000000 */ 0, 38 | /* 00000000 */ 0, 39 | /* 00000000 */ 0, 40 | /* 00000000 */ 0, 41 | /* 3 '#' */ 42 | /* 01101100 */ 0x6c, 43 | /* 01101100 */ 0x6c, 44 | /* 11111110 */ 0xfe, 45 | /* 01101100 */ 0x6c, 46 | /* 11111110 */ 0xfe, 47 | /* 01101100 */ 0x6c, 48 | /* 01101100 */ 0x6c, 49 | /* 00000000 */ 0, 50 | /* 4 '$' */ 51 | /* 00011000 */ 0x18, 52 | /* 01111110 */ 0x7e, 53 | /* 11011000 */ 0xd8, 54 | /* 01111100 */ 0x7c, 55 | /* 00011010 */ 0x1a, 56 | /* 11111100 */ 0xfc, 57 | /* 00011000 */ 0x18, 58 | /* 00000000 */ 0, 59 | /* 5 '%' */ 60 | /* 01100000 */ 0x60, 61 | /* 01100110 */ 0x66, 62 | /* 00001100 */ 0xc, 63 | /* 00011000 */ 0x18, 64 | /* 00110000 */ 0x30, 65 | /* 01100110 */ 0x66, 66 | /* 01000110 */ 0x46, 67 | /* 00000000 */ 0, 68 | /* 6 '&' */ 69 | /* 01110000 */ 0x70, 70 | /* 11011000 */ 0xd8, 71 | /* 11010000 */ 0xd0, 72 | /* 01110000 */ 0x70, 73 | /* 11011010 */ 0xda, 74 | /* 11001100 */ 0xcc, 75 | /* 01111010 */ 0x7a, 76 | /* 00000000 */ 0, 77 | /* 7 ''' */ 78 | /* 00111000 */ 0x38, 79 | /* 00011000 */ 0x18, 80 | /* 00110000 */ 0x30, 81 | /* 00000000 */ 0, 82 | /* 00000000 */ 0, 83 | /* 00000000 */ 0, 84 | /* 00000000 */ 0, 85 | /* 00000000 */ 0, 86 | /* 8 '(' */ 87 | /* 00011000 */ 0x18, 88 | /* 00110000 */ 0x30, 89 | /* 01100000 */ 0x60, 90 | /* 01100000 */ 0x60, 91 | /* 01100000 */ 0x60, 92 | /* 00110000 */ 0x30, 93 | /* 00011000 */ 0x18, 94 | /* 00000000 */ 0, 95 | /* 9 ')' */ 96 | /* 01100000 */ 0x60, 97 | /* 00110000 */ 0x30, 98 | /* 00011000 */ 0x18, 99 | /* 00011000 */ 0x18, 100 | /* 00011000 */ 0x18, 101 | /* 00110000 */ 0x30, 102 | /* 01100000 */ 0x60, 103 | /* 00000000 */ 0, 104 | /* a '*' */ 105 | /* 00110000 */ 0x30, 106 | /* 10110100 */ 0xb4, 107 | /* 01111000 */ 0x78, 108 | /* 00110000 */ 0x30, 109 | /* 01111000 */ 0x78, 110 | /* 10110100 */ 0xb4, 111 | /* 00110000 */ 0x30, 112 | /* 00000000 */ 0, 113 | /* b '+' */ 114 | /* 00000000 */ 0, 115 | /* 00110000 */ 0x30, 116 | /* 00110000 */ 0x30, 117 | /* 11111100 */ 0xfc, 118 | /* 00110000 */ 0x30, 119 | /* 00110000 */ 0x30, 120 | /* 00000000 */ 0, 121 | /* 00000000 */ 0, 122 | /* c ',' */ 123 | /* 00000000 */ 0, 124 | /* 00000000 */ 0, 125 | /* 00000000 */ 0, 126 | /* 00000000 */ 0, 127 | /* 00000000 */ 0, 128 | /* 11100000 */ 0xe0, 129 | /* 01100000 */ 0x60, 130 | /* 11000000 */ 0xc0, 131 | /* d '-' */ 132 | /* 00000000 */ 0, 133 | /* 00000000 */ 0, 134 | /* 00000000 */ 0, 135 | /* 01111100 */ 0x7c, 136 | /* 00000000 */ 0, 137 | /* 00000000 */ 0, 138 | /* 00000000 */ 0, 139 | /* 00000000 */ 0, 140 | /* e '.' */ 141 | /* 00000000 */ 0, 142 | /* 00000000 */ 0, 143 | /* 00000000 */ 0, 144 | /* 00000000 */ 0, 145 | /* 00000000 */ 0, 146 | /* 01110000 */ 0x70, 147 | /* 01110000 */ 0x70, 148 | /* 00000000 */ 0, 149 | /* f '/' */ 150 | /* 00000000 */ 0, 151 | /* 00001100 */ 0xc, 152 | /* 00011000 */ 0x18, 153 | /* 00110000 */ 0x30, 154 | /* 01100000 */ 0x60, 155 | /* 11000000 */ 0xc0, 156 | /* 10000000 */ 0x80, 157 | /* 00000000 */ 0, 158 | /* 10 '0' */ 159 | /* 00111000 */ 0x38, 160 | /* 11000110 */ 0xc6, 161 | /* 11001110 */ 0xce, 162 | /* 11010110 */ 0xd6, 163 | /* 11100110 */ 0xe6, 164 | /* 11000110 */ 0xc6, 165 | /* 00111000 */ 0x38, 166 | /* 00000000 */ 0, 167 | /* 11 '1' */ 168 | /* 00110000 */ 0x30, 169 | /* 01110000 */ 0x70, 170 | /* 00110000 */ 0x30, 171 | /* 00110000 */ 0x30, 172 | /* 00110000 */ 0x30, 173 | /* 00110000 */ 0x30, 174 | /* 01111000 */ 0x78, 175 | /* 00000000 */ 0, 176 | /* 12 '2' */ 177 | /* 01111000 */ 0x78, 178 | /* 11001100 */ 0xcc, 179 | /* 00001100 */ 0xc, 180 | /* 00011000 */ 0x18, 181 | /* 00110000 */ 0x30, 182 | /* 01100000 */ 0x60, 183 | /* 11111100 */ 0xfc, 184 | /* 00000000 */ 0, 185 | /* 13 '3' */ 186 | /* 11111100 */ 0xfc, 187 | /* 00011000 */ 0x18, 188 | /* 00110000 */ 0x30, 189 | /* 00011000 */ 0x18, 190 | /* 00001100 */ 0xc, 191 | /* 11001100 */ 0xcc, 192 | /* 01111000 */ 0x78, 193 | /* 00000000 */ 0, 194 | /* 14 '4' */ 195 | /* 00111000 */ 0x38, 196 | /* 01111000 */ 0x78, 197 | /* 11011000 */ 0xd8, 198 | /* 10011000 */ 0x98, 199 | /* 11111100 */ 0xfc, 200 | /* 00011000 */ 0x18, 201 | /* 00011000 */ 0x18, 202 | /* 00000000 */ 0, 203 | /* 15 '5' */ 204 | /* 11111100 */ 0xfc, 205 | /* 11000000 */ 0xc0, 206 | /* 11111000 */ 0xf8, 207 | /* 00001100 */ 0xc, 208 | /* 00001100 */ 0xc, 209 | /* 11001100 */ 0xcc, 210 | /* 01111000 */ 0x78, 211 | /* 00000000 */ 0, 212 | /* 16 '6' */ 213 | /* 00111000 */ 0x38, 214 | /* 01100000 */ 0x60, 215 | /* 11000000 */ 0xc0, 216 | /* 11111000 */ 0xf8, 217 | /* 11001100 */ 0xcc, 218 | /* 11001100 */ 0xcc, 219 | /* 01111000 */ 0x78, 220 | /* 00000000 */ 0, 221 | /* 17 '7' */ 222 | /* 11111100 */ 0xfc, 223 | /* 00001100 */ 0xc, 224 | /* 00011000 */ 0x18, 225 | /* 00110000 */ 0x30, 226 | /* 01100000 */ 0x60, 227 | /* 01100000 */ 0x60, 228 | /* 01100000 */ 0x60, 229 | /* 00000000 */ 0, 230 | /* 18 '8' */ 231 | /* 01111000 */ 0x78, 232 | /* 11001100 */ 0xcc, 233 | /* 11001100 */ 0xcc, 234 | /* 01111000 */ 0x78, 235 | /* 11001100 */ 0xcc, 236 | /* 11001100 */ 0xcc, 237 | /* 01111000 */ 0x78, 238 | /* 00000000 */ 0, 239 | /* 19 '9' */ 240 | /* 01111000 */ 0x78, 241 | /* 11001100 */ 0xcc, 242 | /* 11001100 */ 0xcc, 243 | /* 01111100 */ 0x7c, 244 | /* 00001100 */ 0xc, 245 | /* 00011000 */ 0x18, 246 | /* 01110000 */ 0x70, 247 | /* 00000000 */ 0, 248 | /* 1a ':' */ 249 | /* 00000000 */ 0, 250 | /* 00111000 */ 0x38, 251 | /* 00111000 */ 0x38, 252 | /* 00000000 */ 0, 253 | /* 00111000 */ 0x38, 254 | /* 00111000 */ 0x38, 255 | /* 00000000 */ 0, 256 | /* 00000000 */ 0, 257 | /* 1b ';' */ 258 | /* 00000000 */ 0, 259 | /* 00111000 */ 0x38, 260 | /* 00111000 */ 0x38, 261 | /* 00000000 */ 0, 262 | /* 00111000 */ 0x38, 263 | /* 00011000 */ 0x18, 264 | /* 00110000 */ 0x30, 265 | /* 00000000 */ 0, 266 | /* 1c '<' */ 267 | /* 00011000 */ 0x18, 268 | /* 00110000 */ 0x30, 269 | /* 01100000 */ 0x60, 270 | /* 11000000 */ 0xc0, 271 | /* 01100000 */ 0x60, 272 | /* 00110000 */ 0x30, 273 | /* 00011000 */ 0x18, 274 | /* 00000000 */ 0, 275 | /* 1d '=' */ 276 | /* 00000000 */ 0, 277 | /* 00000000 */ 0, 278 | /* 01111100 */ 0x7c, 279 | /* 00000000 */ 0, 280 | /* 01111100 */ 0x7c, 281 | /* 00000000 */ 0, 282 | /* 00000000 */ 0, 283 | /* 00000000 */ 0, 284 | /* 1e '>' */ 285 | /* 01100000 */ 0x60, 286 | /* 00110000 */ 0x30, 287 | /* 00011000 */ 0x18, 288 | /* 00001100 */ 0xc, 289 | /* 00011000 */ 0x18, 290 | /* 00110000 */ 0x30, 291 | /* 01100000 */ 0x60, 292 | /* 00000000 */ 0, 293 | /* 1f '?' */ 294 | /* 01111000 */ 0x78, 295 | /* 11001100 */ 0xcc, 296 | /* 00001100 */ 0xc, 297 | /* 00011000 */ 0x18, 298 | /* 00110000 */ 0x30, 299 | /* 00000000 */ 0, 300 | /* 00110000 */ 0x30, 301 | /* 00000000 */ 0, 302 | /* 20 '@' */ 303 | /* 00111000 */ 0x38, 304 | /* 11001100 */ 0xcc, 305 | /* 11010110 */ 0xd6, 306 | /* 11010110 */ 0xd6, 307 | /* 11011100 */ 0xdc, 308 | /* 11000000 */ 0xc0, 309 | /* 00111000 */ 0x38, 310 | /* 00000000 */ 0, 311 | /* 21 'A' */ 312 | /* 01111000 */ 0x78, 313 | /* 11001100 */ 0xcc, 314 | /* 11001100 */ 0xcc, 315 | /* 11111100 */ 0xfc, 316 | /* 11001100 */ 0xcc, 317 | /* 11001100 */ 0xcc, 318 | /* 11001100 */ 0xcc, 319 | /* 00000000 */ 0, 320 | /* 22 'B' */ 321 | /* 11111000 */ 0xf8, 322 | /* 11001100 */ 0xcc, 323 | /* 11001100 */ 0xcc, 324 | /* 11111000 */ 0xf8, 325 | /* 11001100 */ 0xcc, 326 | /* 11001100 */ 0xcc, 327 | /* 11111000 */ 0xf8, 328 | /* 00000000 */ 0, 329 | /* 23 'C' */ 330 | /* 01111000 */ 0x78, 331 | /* 11001100 */ 0xcc, 332 | /* 11000000 */ 0xc0, 333 | /* 11000000 */ 0xc0, 334 | /* 11000000 */ 0xc0, 335 | /* 11001100 */ 0xcc, 336 | /* 01111000 */ 0x78, 337 | /* 00000000 */ 0, 338 | /* 24 'D' */ 339 | /* 11110000 */ 0xf0, 340 | /* 11011000 */ 0xd8, 341 | /* 11001100 */ 0xcc, 342 | /* 11001100 */ 0xcc, 343 | /* 11001100 */ 0xcc, 344 | /* 11011000 */ 0xd8, 345 | /* 11110000 */ 0xf0, 346 | /* 00000000 */ 0, 347 | /* 25 'E' */ 348 | /* 11111100 */ 0xfc, 349 | /* 11000000 */ 0xc0, 350 | /* 11000000 */ 0xc0, 351 | /* 11111000 */ 0xf8, 352 | /* 11000000 */ 0xc0, 353 | /* 11000000 */ 0xc0, 354 | /* 11111100 */ 0xfc, 355 | /* 00000000 */ 0, 356 | /* 26 'F' */ 357 | /* 11111100 */ 0xfc, 358 | /* 11000000 */ 0xc0, 359 | /* 11000000 */ 0xc0, 360 | /* 11111000 */ 0xf8, 361 | /* 11000000 */ 0xc0, 362 | /* 11000000 */ 0xc0, 363 | /* 11000000 */ 0xc0, 364 | /* 00000000 */ 0, 365 | /* 27 'G' */ 366 | /* 01111000 */ 0x78, 367 | /* 11001100 */ 0xcc, 368 | /* 11000000 */ 0xc0, 369 | /* 11011100 */ 0xdc, 370 | /* 11001100 */ 0xcc, 371 | /* 11001100 */ 0xcc, 372 | /* 01111100 */ 0x7c, 373 | /* 00000000 */ 0, 374 | /* 28 'H' */ 375 | /* 11001100 */ 0xcc, 376 | /* 11001100 */ 0xcc, 377 | /* 11001100 */ 0xcc, 378 | /* 11111100 */ 0xfc, 379 | /* 11001100 */ 0xcc, 380 | /* 11001100 */ 0xcc, 381 | /* 11001100 */ 0xcc, 382 | /* 00000000 */ 0, 383 | /* 29 'I' */ 384 | /* 01111110 */ 0x7e, 385 | /* 00011000 */ 0x18, 386 | /* 00011000 */ 0x18, 387 | /* 00011000 */ 0x18, 388 | /* 00011000 */ 0x18, 389 | /* 00011000 */ 0x18, 390 | /* 01111110 */ 0x7e, 391 | /* 00000000 */ 0, 392 | /* 2a 'J' */ 393 | /* 00111100 */ 0x3c, 394 | /* 00011000 */ 0x18, 395 | /* 00011000 */ 0x18, 396 | /* 00011000 */ 0x18, 397 | /* 00011000 */ 0x18, 398 | /* 11011000 */ 0xd8, 399 | /* 01110000 */ 0x70, 400 | /* 00000000 */ 0, 401 | /* 2b 'K' */ 402 | /* 11001100 */ 0xcc, 403 | /* 11011000 */ 0xd8, 404 | /* 11110000 */ 0xf0, 405 | /* 11100000 */ 0xe0, 406 | /* 11110000 */ 0xf0, 407 | /* 11011000 */ 0xd8, 408 | /* 11001100 */ 0xcc, 409 | /* 00000000 */ 0, 410 | /* 2c 'L' */ 411 | /* 11000000 */ 0xc0, 412 | /* 11000000 */ 0xc0, 413 | /* 11000000 */ 0xc0, 414 | /* 11000000 */ 0xc0, 415 | /* 11000000 */ 0xc0, 416 | /* 11000000 */ 0xc0, 417 | /* 11111100 */ 0xfc, 418 | /* 00000000 */ 0, 419 | /* 2d 'M' */ 420 | /* 11000110 */ 0xc6, 421 | /* 11101110 */ 0xee, 422 | /* 11111110 */ 0xfe, 423 | /* 11010110 */ 0xd6, 424 | /* 11000110 */ 0xc6, 425 | /* 11000110 */ 0xc6, 426 | /* 11000110 */ 0xc6, 427 | /* 00000000 */ 0, 428 | /* 2e 'N' */ 429 | /* 11001100 */ 0xcc, 430 | /* 11001100 */ 0xcc, 431 | /* 11101100 */ 0xec, 432 | /* 11111100 */ 0xfc, 433 | /* 11011100 */ 0xdc, 434 | /* 11001100 */ 0xcc, 435 | /* 11001100 */ 0xcc, 436 | /* 00000000 */ 0, 437 | /* 2f 'O' */ 438 | /* 01111000 */ 0x78, 439 | /* 11001100 */ 0xcc, 440 | /* 11001100 */ 0xcc, 441 | /* 11001100 */ 0xcc, 442 | /* 11001100 */ 0xcc, 443 | /* 11001100 */ 0xcc, 444 | /* 01111000 */ 0x78, 445 | /* 00000000 */ 0, 446 | /* 30 'P' */ 447 | /* 11111000 */ 0xf8, 448 | /* 11001100 */ 0xcc, 449 | /* 11001100 */ 0xcc, 450 | /* 11111000 */ 0xf8, 451 | /* 11000000 */ 0xc0, 452 | /* 11000000 */ 0xc0, 453 | /* 11000000 */ 0xc0, 454 | /* 00000000 */ 0, 455 | /* 31 'Q' */ 456 | /* 01111100 */ 0x7c, 457 | /* 11000110 */ 0xc6, 458 | /* 11000110 */ 0xc6, 459 | /* 11000110 */ 0xc6, 460 | /* 11010110 */ 0xd6, 461 | /* 11001000 */ 0xc8, 462 | /* 01110100 */ 0x74, 463 | /* 00000000 */ 0, 464 | /* 32 'R' */ 465 | /* 11111000 */ 0xf8, 466 | /* 11001100 */ 0xcc, 467 | /* 11001100 */ 0xcc, 468 | /* 11111000 */ 0xf8, 469 | /* 11110000 */ 0xf0, 470 | /* 11011000 */ 0xd8, 471 | /* 11001100 */ 0xcc, 472 | /* 00000000 */ 0, 473 | /* 33 'S' */ 474 | /* 01111100 */ 0x7c, 475 | /* 11000000 */ 0xc0, 476 | /* 11000000 */ 0xc0, 477 | /* 01111000 */ 0x78, 478 | /* 00001100 */ 0xc, 479 | /* 00001100 */ 0xc, 480 | /* 11111000 */ 0xf8, 481 | /* 00000000 */ 0, 482 | /* 34 'T' */ 483 | /* 11111100 */ 0xfc, 484 | /* 00110000 */ 0x30, 485 | /* 00110000 */ 0x30, 486 | /* 00110000 */ 0x30, 487 | /* 00110000 */ 0x30, 488 | /* 00110000 */ 0x30, 489 | /* 00110000 */ 0x30, 490 | /* 00000000 */ 0, 491 | /* 35 'U' */ 492 | /* 11001100 */ 0xcc, 493 | /* 11001100 */ 0xcc, 494 | /* 11001100 */ 0xcc, 495 | /* 11001100 */ 0xcc, 496 | /* 11001100 */ 0xcc, 497 | /* 11001100 */ 0xcc, 498 | /* 01111000 */ 0x78, 499 | /* 00000000 */ 0, 500 | /* 36 'V' */ 501 | /* 11001100 */ 0xcc, 502 | /* 11001100 */ 0xcc, 503 | /* 11001100 */ 0xcc, 504 | /* 11001100 */ 0xcc, 505 | /* 11001100 */ 0xcc, 506 | /* 01111000 */ 0x78, 507 | /* 00110000 */ 0x30, 508 | /* 00000000 */ 0, 509 | /* 37 'W' */ 510 | /* 11000110 */ 0xc6, 511 | /* 11000110 */ 0xc6, 512 | /* 11000110 */ 0xc6, 513 | /* 11010110 */ 0xd6, 514 | /* 11010110 */ 0xd6, 515 | /* 11111110 */ 0xfe, 516 | /* 01101100 */ 0x6c, 517 | /* 00000000 */ 0, 518 | /* 38 'X' */ 519 | /* 11000110 */ 0xc6, 520 | /* 11000110 */ 0xc6, 521 | /* 01101100 */ 0x6c, 522 | /* 00111000 */ 0x38, 523 | /* 01101100 */ 0x6c, 524 | /* 11000110 */ 0xc6, 525 | /* 11000110 */ 0xc6, 526 | /* 00000000 */ 0, 527 | /* 39 'Y' */ 528 | /* 11001100 */ 0xcc, 529 | /* 11001100 */ 0xcc, 530 | /* 11001100 */ 0xcc, 531 | /* 01111000 */ 0x78, 532 | /* 00110000 */ 0x30, 533 | /* 00110000 */ 0x30, 534 | /* 00110000 */ 0x30, 535 | /* 00000000 */ 0, 536 | /* 3a 'Z' */ 537 | /* 11111100 */ 0xfc, 538 | /* 00001100 */ 0xc, 539 | /* 00011000 */ 0x18, 540 | /* 00110000 */ 0x30, 541 | /* 01100000 */ 0x60, 542 | /* 11000000 */ 0xc0, 543 | /* 11111100 */ 0xfc, 544 | /* 00000000 */ 0, 545 | }; 546 | 547 | #endif /* FONT_H_ */ 548 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | //*************************************************************************************** 2 | // SHARP LS013B4DN04 Memory Display 3 | // 4 | // Simple library for TI MSP430G2 LaunchPad to write characters to SHARP LS013B4DN04 5 | // Memory Display using hardware SPI. 6 | // 7 | // This code also works with the predecessor LS013B4DN02 and should work with any 8 | // display of that series with compatible pinouts. 9 | // 10 | // ACLK = n/a, MCLK = SMCLK = default DCO. Note that display specifies 1MHz max for SCLK 11 | // 12 | // MSP430G2553 13 | // ----------------- 14 | // | P1.0|-->LED (VCOM status display) 15 | // | | 16 | // | P1.5|-->SCLK (SPI clock) 17 | // | | 18 | // | P1.7|-->SI (SPI data) 19 | // | | 20 | // | P2.0|-->DISP (display on/off) 21 | // | | 22 | // | P2.5|-->SCS (SPI chip select) 23 | // 24 | // Display VDD and VDDA connected to LaunchPad VCC 25 | // Display GND connected to LaunchPad GND 26 | // 27 | // LS013B4DN02 is specified for 5V VDD/VDDA but seems to work well with 3V as provided by 28 | // the LaunchPad. LS013B4DN04 specifies VDD/VDDA at 3V. 29 | // 30 | // This code works with the 43oh SHARP Memory LCD BoosterPack 31 | // http://forum.43oh.com/topic/4979-sharp-memory-display-booster-pack/ 32 | // 33 | // Adrian Studer 34 | // March 2014 35 | //*************************************************************************************** 36 | 37 | #include 38 | 39 | #include "font.h" 40 | 41 | #define _LED BIT0 // LED1 used to verify VCOM state 42 | #define _SCLK BIT5 // SPI clock 43 | #define _SDATA BIT7 // SPI data (sent to display) 44 | #define _SCS BIT5 // SPI chip select 45 | #define _DISP BIT0 // Turn display on/off 46 | 47 | #define MLCD_WR 0x01 // MLCD write line command 48 | #define MLCD_CM 0x04 // MLCD clear memory command 49 | #define MLCD_SM 0x00 // MLCD static mode command 50 | #define MLCD_VCOM 0x02 // MLCD VCOM bit 51 | 52 | #define PIXELS_X 96 // display is 96x96 53 | #define PIXELS_Y 96 // display is 96x96 54 | 55 | #define DISP_INVERT 1 // INVERT text 56 | #define DISP_WIDE 2 // double-width text 57 | #define DISP_HIGH 4 // double-height text 58 | 59 | unsigned char LineBuff[PIXELS_X/8]; // line buffer 60 | 61 | volatile unsigned char VCOM; // current state of VCOM (0x04 or 0x00) 62 | 63 | volatile unsigned int timeMSec; // clock milliseconds 64 | volatile unsigned char timeSecond; // clock seconds 65 | volatile unsigned char timeMinute; // clock minutes 66 | 67 | char TextBuff[9]; // buffer to build line of text 68 | 69 | void SPIWriteByte(unsigned char value); 70 | void SPIWriteWord(unsigned int value); 71 | void SPIWriteLine(unsigned char line); 72 | void printSharp(const char* text, unsigned char line, unsigned char options); 73 | 74 | extern void doubleWideAsm(unsigned char c, unsigned char* buff); 75 | 76 | int main(void) 77 | { 78 | // configure WDT 79 | WDTCTL = WDTPW | WDTHOLD; // stop watch dog timer 80 | 81 | P1DIR |= _LED | _SCLK | _SDATA; // set all pins used to output 82 | P1OUT &= ~(_LED | _SCLK | _SDATA); // set all outputs low 83 | 84 | P1SEL |= _SCLK | _SDATA; // connect pins to USCI (secondary peripheral) 85 | P1SEL2 |= _SCLK | _SDATA; // connect pins to USCI (secondary peripheral) 86 | 87 | P2DIR |= _DISP | _SCS; // set all pins used to output 88 | P2OUT &= ~(_DISP | _SCS); // set all outputs low 89 | 90 | // configure UCSI B0 for SPI 91 | UCB0CTL1 |= UCSWRST; // reset USCI B0 92 | UCB0CTL0 = UCCKPH | UCMST | UCMODE_0 | UCSYNC; // read on rising edge, inactive clk low, lsb, 8 bit, master mode, 3 pin SPI, synchronous 93 | UCB0BR0 = 8; UCB0BR1 = 0; // clock scaler = 8, i.e 2 MHz SPI clock 94 | UCB0CTL1 = UCSSEL_2; // clock source SMCLK, clear UCSWRST to enable USCI B0 95 | UCB0CTL1 &= ~UCSWRST; // enable USCI B0 96 | 97 | // setup timer A, to keep time and alternate VCOM at 1Hz 98 | timeMSec = 0; // initialize variables used by "clock" 99 | timeSecond = 0; 100 | timeMinute = 0; 101 | 102 | VCOM = 0; // initialize VCOM, this flag controls LCD polarity 103 | // and has to be toggled every second or so 104 | 105 | TA0CTL = TASSEL_2 + MC_1; // SMCLK (default ~1MHz), up mode 106 | TACCR0 = 1000; // trigger every millisecond 107 | TACCTL0 |= CCIE; // timer 0 interrupt enabled 108 | 109 | P2OUT |= _DISP; // turn display on 110 | 111 | // initialize display 112 | P2OUT |= _SCS; // SCS high, ready talking to display 113 | SPIWriteByte(MLCD_CM | VCOM); // send clear display memory command 114 | SPIWriteByte(0); // send command trailer 115 | P2OUT &= ~_SCS; // SCS lo, finished talking to display 116 | 117 | // write some text to display to demonstrate options 118 | printSharp("HELLO,WORLD?",1,0); 119 | printSharp(" SHARP",16,DISP_WIDE); 120 | printSharp(" MEMORY ",24,DISP_INVERT); 121 | printSharp(" DISPLAY!",32,DISP_HIGH); 122 | printSharp("123456789012",56,0); 123 | 124 | while(1) 125 | { 126 | // show VCOM state on LED1 for visual control 127 | if(VCOM == 0) 128 | { 129 | P1OUT &= ~_LED; 130 | } 131 | else 132 | { 133 | P1OUT |= _LED; 134 | } 135 | 136 | // write clock to display 137 | TextBuff[0] = ' '; 138 | TextBuff[1] = timeMinute / 10 + '0'; 139 | TextBuff[2] = timeMinute % 10 + '0'; 140 | TextBuff[3] = ':'; 141 | TextBuff[4] = timeSecond / 10 + '0'; 142 | TextBuff[5] = timeSecond % 10 + '0'; 143 | TextBuff[6] = 0; 144 | printSharp(TextBuff,72,DISP_HIGH | DISP_WIDE); 145 | 146 | // put display into low-power static mode 147 | P2OUT |= _SCS; // SCS high, ready talking to display 148 | SPIWriteByte(MLCD_SM | VCOM); // send static mode command 149 | SPIWriteByte(0); // send command trailer 150 | P2OUT &= ~_SCS; // SCS lo, finished talking to display 151 | 152 | // sleep for a while 153 | _BIS_SR(LPM0_bits + GIE); // enable interrupts and go to sleep 154 | }; 155 | } 156 | 157 | // write a string to display, truncated after 12 characters 158 | // input: text 0-terminated string 159 | // line vertical position of text, 0-95 160 | // options can be combined using OR 161 | // DISP_INVERT inverted text 162 | // DISP_WIDE double-width text (except for SPACE) 163 | // DISP_HIGH double-height text 164 | void printSharp(const char* text, unsigned char line, unsigned char options) 165 | { 166 | // c = char 167 | // b = bitmap 168 | // i = text index 169 | // j = line buffer index 170 | // k = char line 171 | unsigned char c, b, i, j, k; 172 | 173 | // rendering happens line-by-line because this display can only be written by line 174 | k = 0; 175 | while(k < 8 && line < PIXELS_Y) // loop for 8 character lines while within display 176 | { 177 | i = 0; 178 | j = 0; 179 | while(j < (PIXELS_X/8) && (c = text[i]) != 0) // while we did not reach end of line or string 180 | { 181 | if(c < ' ' || c > 'Z') // invalid characters are replace with SPACE 182 | { 183 | c = ' '; 184 | } 185 | 186 | c = c - 32; // convert character to index in font table 187 | b = font8x8[(c*8)+k]; // retrieve byte defining one line of character 188 | 189 | if(!(options & DISP_INVERT)) // invert bits if DISP_INVERT is _NOT_ selected 190 | { // pixels are LOW active 191 | b = ~b; 192 | } 193 | 194 | if((options & DISP_WIDE) && (c != 0)) // double width rendering if DISP_WIDE and character is not SPACE 195 | { 196 | doubleWideAsm(b, &LineBuff[j]); // implemented in assembly for efficiency/space reasons 197 | j += 2; // we've written two bytes to buffer 198 | } 199 | else // else regular rendering 200 | { 201 | LineBuff[j] = b; // store pixels in line buffer 202 | j++; // we've written one byte to buffer 203 | } 204 | 205 | i++; // next character 206 | } 207 | 208 | while(j < (PIXELS_X/8)) // pad line for empty characters 209 | { 210 | LineBuff[j] = 0xff; 211 | j++; 212 | } 213 | 214 | SPIWriteLine(line++); // write line buffer 215 | 216 | if(options & DISP_HIGH && line < PIXELS_Y) // repeat line if DISP_HIGH is selected 217 | { 218 | SPIWriteLine(line++); 219 | } 220 | 221 | k++; // next pixel line 222 | } 223 | } 224 | 225 | // transfer line buffer to display using SPI 226 | // input: line position where line buffer is rendered 227 | void SPIWriteLine(unsigned char line) 228 | { 229 | P2OUT |= _SCS; // SCS high, ready talking to display 230 | 231 | SPIWriteByte(MLCD_WR | VCOM); // send command to write line(s) 232 | SPIWriteByte(line+1); // send line address 233 | 234 | UCB0CTL0 |= UCMSB; // switch SPI to MSB first for proper bitmap orientation 235 | 236 | unsigned char j = 0; 237 | while(j < (PIXELS_X/8)) // write pixels / 8 bytes 238 | { 239 | UCB0TXBUF = LineBuff[j++]; // transfer byte 240 | while (UCB0STAT & UCBUSY); // wait for transfer to complete 241 | } 242 | 243 | UCB0CTL0 &= ~UCMSB; // switch SPI back to LSB first for commands 244 | 245 | SPIWriteWord(0); // send 16 bit to latch buffers and end transfer 246 | P2OUT &= ~_SCS; // SCS low, finished talking to display 247 | } 248 | 249 | // send one byte over SPI, does not handle SCS 250 | // input: value byte to be sent 251 | void SPIWriteByte(unsigned char value) 252 | { 253 | UCB0TXBUF = value; 254 | while (UCB0STAT & UCBUSY); 255 | } 256 | 257 | // send one byte over SPI, does not handle SCS 258 | // input: value word to be sent 259 | void SPIWriteWord(unsigned int value) 260 | { 261 | UCB0TXBUF = value & 0xff; 262 | while (UCB0STAT & UCBUSY); 263 | 264 | UCB0TXBUF = value >> 8; 265 | while (UCB0STAT & UCBUSY); 266 | } 267 | 268 | // interrupt service routine to handle timer A 269 | #pragma vector=TIMER0_A0_VECTOR 270 | __interrupt void handleTimerA(void) 271 | { 272 | timeMSec++; // count milliseconds 273 | 274 | if(timeMSec == 1000) // if we reached 1 second 275 | { 276 | timeMSec = 0; // reset milliseconds 277 | timeSecond++; // increase seconds 278 | if(timeSecond == 60) // if we reached 1 minute 279 | { 280 | timeSecond = 0; // reset seconds 281 | timeMinute++; // increase minutes 282 | if(timeMinute == 60) // if we reached 1 hour 283 | { 284 | timeMinute = 0; // reset minutes 285 | } 286 | } 287 | 288 | VCOM ^= MLCD_VCOM; // invert polarity bit every second 289 | 290 | _bic_SR_register_on_exit(LPM0_bits); // wake up main loop every second 291 | } 292 | } 293 | 294 | --------------------------------------------------------------------------------