官方HT1621B驱动程序HT48-MCU-对HT1621-LCD控制器的使用(汇编)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

HT48MCUHT1621LCD1HT48MCUHT1621LCDHA0018sHT1621128LCDRAMLCDLCDHT162145HT48R30A-1HT1621,LCDHT1621110101--101100LCDSYSTEMENABLELCDONSYSTEMENABLE10000000001XXDon’tcarebitLCDON10000000011XXDon’tcarebit)SYSTEMDISABLELCDDATAINPUTWR,…RAM101A5A4A3A2A1A0D0D1D2D3101A5~A0D0~D3LCDLCDÆ1621ÆLCDÆLCDÆÆHT1621;1621driver.asm;HT48R30A-1HT1621;;PB1--datum;PB2--WRB;PB3--CSB;PB4--RDBHT48MCUHT1621LCD2;OSC:Ext.Crystal;WDTclocksource:DisableWDT;inputtypePA:SshmittTrigger;Pull-highPA:Pull-highPA;Pull-highPB:Pull-highPB;BZ/BZB:BZENABEL/BZBDISABLE;Fsys:4M;includeht48r30a-1.inccsbequpb.3csbcequpbc.3wrbequpb.2wrbcequpbc.2datumequpb.1datumcequpbc.1rdbequpb.4rdbcequpbc.4ligequpc.3;----------------------------num_memequ[7fh];----------------------------;;,5d_1macrojmp$+1jmp$+1nopendm;-----------lcddriver.section'data'countdb?;code_datumdb?;commandcodeormemorydatumbitscode_datum1db?;onlyusedinread_modify_writemodemem_addrdb?;memortyaddressforselectingsegmenttemp_dadb?t_addr_hdb?;justabuffer;----------------------------lock.SECTION'CODE'HT48MCUHT1621LCD3org00hjmpstartorg04hretiorg08hretistart:clrpb;Initialsetcsbclrpbcsetpbc.0clrpcclrpccclrintcmova,50hmovnum_mem,amova,20hmovmp0,aclr_ram:;initialramclrr0incmp0sdznum_memjmpclr_ram;----------------------------------------ini_status:mova,87hmovtmrc,ashow_k:setlig;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mova,0e3h;NORMALmovcode_datum,acallsend_command;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mova,01h;SYSENABLEmovcode_datum,acallsend_commandLO:HT48MCUHT1621LCD4mova,029h;4com;1/3biasmovcode_datum,acallsend_commandmova,3;LCDOnmovcode_datum,acallsend_commandcallclr_lcm;clslcdjmp$+1jmp$+1callshow_lcm;lightalldotsclrcode_datum;readingthenwritinginthesameaddressmova,4movmem_addr,acallreadmova,07hxora,code_datumsnzzjmperrormova,2movcode_datum,acallsend_commandjmp$+1jmpstart;doitrepeaterror:jmp$;******************************************;Purpose:sendcommand;Parameter:;code_datum:byte;Return:none;Modified:acc,status;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~send_commandprocclrCSBclrdatumCsetdatumclrWRB;COMMANDID'100'd_1setWRB;1HT48MCUHT1621LCD5nopclrdatum;00clrWRBd_1setWRBnopCLRWRBd_1setWRBmovA,8;sendcodemovcount,ALOOP1:clrdatumszcode_datum.7setdatumrlcode_datumclrWRBd_1setWRBsdzcountjmploop1clrWRBd_1setWRBnopsetCSB;closecsbsignal,notselectingthechipretsend_commandendp;-------------------------------;Purpose:writedatumto1621;Parameter:;code_datum:byte;mem_addr:byte;Return:none;Modified:acc,status;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~write:clrCSBclrdatumcsetdatumHT48MCUHT1621LCD6clrWRB;WRITEmodeID'101'd_1setWRBclrdatumclrWRBd_1setWRBsetdatumclrWRBd_1setWRBmova,6movcount,awriteloop1:clrdatumszmem_addr.5;sendingmemoryaddressforselectingsegmentsetdatumclrWRBd_1setWRBrlmem_addrsdzcountjmpwriteloop1mova,4movcount,awriteloop2:clrdatumszcode_datum.0;sendingmemorycontentfordecidingcomments'sstatesetdatumclrWRBd_1setWRBrrcode_datumsdzcountjmpwriteloop2setCSBret;-------------------------------------;Purpose:readdatumfrom1621HT48MCUHT1621LCD7;Parameter:;mem_addr:byte;Return:;code_datum:byte;Modified:acc,status;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~readprocclrCSBclrdatumcsetdatumclrWRB;READmodeID'110'd_1setWRBclrWRBd_1setWRBclrdatumclrWRBd_1setWRBmova,6movcount,areadloop1:clrdatumszmem_addr.5;sendingmemoryaddressforselectingsegmentsetdatumclrWRBd_1setWRBrlmem_addrsdzcountjmpreadloop1setdatumcmova,4movcount,areadloop2:clrRDBd_1HT48MCUHT1621LCD8setRDBrrcode_datumclrcode_datum.3szdatum;sendingmemorycontentfordecidingcomments'sstatesetcode_datum.3sdzcountjmpreadloop2mova,0fhandma,code_datumsetCSBretreadendp;------------------------------------------;Purpose:readdatumfrom1621,thenwriteadatuminthesameregister;Parameter:;mem_addr:byte;Return:none;Modified:acc,status;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~rm_writeprocclrCSBclrdatumcsetdatum;READ-MODIFY-WRITEmodeID‘101’clrWRBd_1setWRBclrdatumclrWRBd_1setWRBsetdatumclrWRBd_1setWRBmova,6movcount,armwloop1:HT48MCUHT1621LCD9clrdatumszmem_addr.5;sendingmemoryaddressforselectingsegmentsetdatumclrWRBd_1setWRBrlmem_addrsdzcountjmprmwloop1setdatumcmova,4movcount,armwloop2:clrRDBd_1setRDBrrcode_datum1clrcode_datum1.3szdatum;readmemorycontentoutsetcode_datum1.3sdzcountjmprmwloop2mova,0fhandma,code_datum1clrdatumcmova,4movcount,amova,temp_daandma,code_datumrmwloop3:clrdatumszcode_datum.0;sendingmemorycontentfordecidingcomments'sstatesetdatumclrWRBd_1setWRBrrcode_datumsdzcountjmprmwloop3setCSBHT48MCUHT1621LCD10retrm_writeendp;------------------------------show_lcm:mova,00hmovt_addr_h,amova,31hmovnum_mem,aclr_n1:mova,t_addr_hmovmem_addr,amova,07hmovcode_datum,acallwriteinct_addr_hsdznum_memjmpclr_n1ret;------------------------------clr_lcm:mova,00hmovt_addr_h,amova,31hmovnum_mem,aclr_n:mova,t_addr_hmovmem_addr,amova,0hmovcode_datum,acallwriteinct_addr_hsdznum_memjmpclr_nret

1 / 10
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功