Sothedisplaylightsupand a istheanodeforthebacklightled.
SohookthattofivevoltsandKayisthecathodeswillhookthattoground, andwecanhookthisdirectlytofivevoteslikethisbecausethemodelsalreadygot a currentlimitingresisterinit.
WhenRegisterSelectislow, weactuallyendupreadingtheaddresscounter a CZwellisthebusyflag, sothosecomeoutaswell, sothere's datawecanreadandwrite, sowehave a readrightflagthere.
Istheprogramaheadrunningandputs a patternof 50 hexoutontheeightbitsthatwehadthereandthenheusesthisrotaterightinstructiontoshiftthebitpatternovereachtimethroughthis.
Sowe'rejustgonnabeusingthetopthreeofthosebits, andthenport B istheeightbitshereontherightthatwe'vegothookedup, buttheninthecode, Oncewedefinethoseaddresseshere, insteadofsaying, store a sixyearsorzeroweaken, saystore, eh?
Port B, Thisisthesameasitwasbefore, buthopefullymaybe a littlebiteasiertomakesenseof.
AndthenthedatadirectionregisteredreportbeisitsixyearsortwoandthedatadirectionregisteredReport A isatsixyearsorthree.
Now, I couldchangethistostore a DDRbe, youknow, tomakeit a littlebitmoreclearthatthis f f issettingthedirectionofthedataforPort B.
Andthenif I want, youknow, maybeit's notclearwhatthisFFevenmeans, becausewhatwe'redoingiswe'reloadingFFintotheregisterandthenwe'restoringthattoaddresssixyearsortwo, whichisthedatadirectionforPort B.
And, youknow, wereallydon't have a choicehereeitherwith a numberoflinesorthenumberofdots, becausethephysicaldisplaywereusinghasfivebyeightdotsforeachcharacter.
Soitwouldlookwrongifwetriedtousethisfiveby 10.
Sowegobacktotheexample.
001 istheinstruction.
Andthenwe'resettingeatbitmood, a twolinedisplay, whichiswhatwe'vegotand a fivebyeightcharacterfund, which, whichisalsowhatwe'vegotthatallsoundslikewhatwewant.
Solet's sendthisinstructiontothedisplay.
Soagain, theinstructionitself 001 andthenwe'regonnahave a onebecausewewanteightbitmodeandthen a oneforthetwolinedisplayandthen a zeroforthefontwantthefivebyeightfontandthenthelasttwobitsaren't used.
Andsoeachcharacterwesendjustshowsupinthenextpositiononthescreensowecouldjusttypeouttextandinorderforthattowork, whatwewantisthateverytimewewrite a character, thisaddresscounterthatkeepstrackofwherethatcharacterisgonnagoonthescreen, wewantthataddresscountertoincrementeachtimewewrite a character, andthat's actuallywhatwe'resettingwithhisnextinstruction.
Soif I canfindthepagewherewehadthisinstructions, herewego.
Entrymodeisiswhenweenterdataintoit.
Whatwhatmotivesitin?
Whatisitdoing?
Sothisincrementaldocumentsays, Dowewantincrementthataddressregistereachtimewesend a character?
Ordowewant a deckermeantit?
Andessentially, whatthatsayingislikewhenwewrite a characterhere, Dowewantthenextcharactertobewrittentotherightofit?
Ordowewanttobewritingbackwards?
Soifwehave, thisisdetrimentthaneachtimewewrote a character, itwoulditwouldDeckerMint, theaddresscounter, andthenextcharacterwouldthengototheleftofthepreviouscharacter.
IsthatStepfourinthisexamplehereandsothenextstepbustatfiveisactuallywritingdatatothedaytodisplayRAM, whichlookslikeitshouldactuallyput a characteronthescreen.
Soifallofthisworkstosendthecharactereach, thequickanddirtywayofsendingmorecharacterswouldbejust a copythiscodeandaddfourletters.
Soif I wantedtoprintthemessageHelloworld, Youknow, I mightnotbethecleanestwayorthemostefficientwaytodoit, but I couldjustcopythisblockofcodeforeachletterandsendeachletterjustlikelikewearehere.
That's what I'm actuallydoinghere.
And I realizedthisisnotthemostefficientwayofwritingcode, butbutthat's okaybecause I justwanttogetthisworkingandthenwecantalkabouthowdoweactuallymakethismoreefficientormakethecodeeasiertoreadherthingslikethat.
Sotherewegoanddefinitelynotproudofthiscode.
Butletmemakesureactuallystolethisright.
Buthere's here.
We'reprintingHelloworld, definitelyusing a lotofcodetodoit, butitshouldwork.
I thinkwecoulddo a lotbetterthanthatAndthat's what I'm gonnadointhenextvideoisyourewritethistobe a lotmoreefficient, but I'm gonnadothatinthenextvideo, sincewe'reactuallygonnaneedtoaddsomemorehardwareinorderforustowritemoreefficientsoftware.