Evgeniy 280 Report post Posted November 28, 2017 Так как у pic16f84 недостаточно выводов, меняем его на pic16f628A, переводим его на работу от внутреннего генератора. Код: @ device pic16f628a, cpd_off, protect_off, mclr_off, pwrt_on, wdt_off, INTRC_OSC_NOCLKOUT'*******************************************************************************trisA = %11110000trisB = %00000000'*******************************************************************************LED var portBind1 var portA.0ind2 var portA.1ind3 var portA.2ind4 var portA.3Plus var portA.7 'Кнопка +Minus var portA.6 'Кнопка -Res var portA.5 'Кнопка сбросаTemp var wordi var byten var bytebuf1 var bytebuf2 var bytebuf3 var byte'*******************************************************************************clearled = 0ind1 = 1ind2 = 1ind3 = 1ind4 = 1temp = 100'*******************************************************************************'*******************************************************************************main:button plus, 0,255,255,buf1,1,TPlusbutton minus,0,255,255,buf2,1,TMinusbutton res, 0,255,255,buf3,1,TResetgosub displaygoto main'*******************************************************************************'*******************************************************************************TPlus:temp = temp + 1if temp > 9999 then temp = 0goto main'*******************************************************************************'*******************************************************************************TMinus:temp = temp - 1if temp > 10000 then temp = 9999goto main'*******************************************************************************'*******************************************************************************TReset:temp = 0goto main'*******************************************************************************'******************************* Индикация *************************************Display:for i = 0 to 3n = temp dig iind1 = 1ind2 = 1ind3 = 1ind4 = 1Lookup n,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7F,$6F],ledif i = 0 thenind1 = 1ind2 = 1ind3 = 1ind4 = 0endifif i = 1 thenind1 = 1ind2 = 1ind3 = 0ind4 = 1endifif i = 2 thenind1 = 1ind2 = 0ind3 = 1ind4 = 1endifif i = 3 thenind1 = 0ind2 = 1ind3 = 1ind4 = 1endifpauseus 500next ireturn'******************************************************************************* 8_1.rar 1 VitalForce reacted to this Share this post Link to post Share on other sites
Evgeniy 280 Report post Posted November 28, 2017 https://yadi.sk/d/g125LDt83Q8Snp Share this post Link to post Share on other sites