ðåôåðàòû
Ãëàâíàÿ

Ðåôåðàòû ïî àâèàöèè è êîñìîíàâòèêå

Ðåôåðàòû ïî àäìèíèñòðàòèâíîìó ïðàâó

Ðåôåðàòû ïî áåçîïàñíîñòè æèçíåäåÿòåëüíîñòè

Ðåôåðàòû ïî àðáèòðàæíîìó ïðîöåññó

Ðåôåðàòû ïî àðõèòåêòóðå

Ðåôåðàòû ïî àñòðîíîìèè

Ðåôåðàòû ïî áàíêîâñêîìó äåëó

Ðåôåðàòû ïî ñåêñîëîãèè

Ðåôåðàòû ïî èíôîðìàòèêå ïðîãðàììèðîâàíèþ

Ðåôåðàòû ïî áèîëîãèè

Ðåôåðàòû ïî ýêîíîìèêå

Ðåôåðàòû ïî ìîñêâîâåäåíèþ

Ðåôåðàòû ïî ýêîëîãèè

Êðàòêîå ñîäåðæàíèå ïðîèçâåäåíèé

Ðåôåðàòû ïî ôèçêóëüòóðå è ñïîðòó

Òîïèêè ïî àíãëèéñêîìó ÿçûêó

Ðåôåðàòû ïî ìàòåìàòèêå

Ðåôåðàòû ïî ìóçûêå

Îñòàëüíûå ðåôåðàòû

Ðåôåðàòû ïî áèðæåâîìó äåëó

Ðåôåðàòû ïî áîòàíèêå è ñåëüñêîìó õîçÿéñòâó

Ðåôåðàòû ïî áóõãàëòåðñêîìó ó÷åòó è àóäèòó

Ðåôåðàòû ïî âàëþòíûì îòíîøåíèÿì

Ðåôåðàòû ïî âåòåðèíàðèè

Ðåôåðàòû äëÿ âîåííîé êàôåäðû

Ðåôåðàòû ïî ãåîãðàôèè

Ðåôåðàòû ïî ãåîäåçèè

Ðåôåðàòû ïî ãåîëîãèè

Ðåôåðàòû ïî ãåîïîëèòèêå

Ðåôåðàòû ïî ãîñóäàðñòâó è ïðàâó

Ðåôåðàòû ïî ãðàæäàíñêîìó ïðàâó è ïðîöåññó

Ðåôåðàòû ïî êðåäèòîâàíèþ

Ðåôåðàòû ïî åñòåñòâîçíàíèþ

Ðåôåðàòû ïî èñòîðèè òåõíèêè

Ðåôåðàòû ïî æóðíàëèñòèêå

Ðåôåðàòû ïî çîîëîãèè

Ðåôåðàòû ïî èíâåñòèöèÿì

Ðåôåðàòû ïî èíôîðìàòèêå

Èñòîðè÷åñêèå ëè÷íîñòè

Ðåôåðàòû ïî êèáåðíåòèêå

Ðåôåðàòû ïî êîììóíèêàöèè è ñâÿçè

Ðåôåðàòû ïî êîñìåòîëîãèè

Ðåôåðàòû ïî êðèìèíàëèñòèêå

Ðåôåðàòû ïî êðèìèíîëîãèè

Ðåôåðàòû ïî íàóêå è òåõíèêå

Ðåôåðàòû ïî êóëèíàðèè

Ðåôåðàòû ïî êóëüòóðîëîãèè

Êóðñîâàÿ ðàáîòà: Ðàçðàáîòêà öèôðîâîãî èçìåðèòåëÿ êðîâÿíîãî äàâëåíèÿ íà ìèêðîêîíòðîëëåðå MC68HC908JL3

Êóðñîâàÿ ðàáîòà: Ðàçðàáîòêà öèôðîâîãî èçìåðèòåëÿ êðîâÿíîãî äàâëåíèÿ íà ìèêðîêîíòðîëëåðå MC68HC908JL3

ÌÎ ÐÔ

Íîâîñèáèðñêèé êîëëåäæ ýëåêòðîíèêè

ÊÓÐÑÎÂÎÉ ÏÐÎÅÊÒ

Ïî äèñöèïëèíå ìèêðîêîíòðîëëåðû

Íà òåìó: “Ðàçðàáîòêà ÖÈÔÐÎÂÎÃÎ ÈÇÌÅÐÈÒÅËß ÊÐÎÂßÍÎÃÎ ÄÀÂËÅÍÈß íà ìèêðîêîíòðîëëåðå MC68HC908JL3”

Âûïîëíèë: Ìàìàåâ À.Ñ.

Ãð. 9Âò-454

Ïðîâåðèë: Áðèêìàí À.È.

2003


Ñîäåðæàíèå

Ââåäåíèå

1.       Òåõíè÷åñêîå çàäàíèå

2.       Âûáîð è îáîñíîâàíèå ýëåìåíòíîé áàçû

2.1     Âûáîð ìèêðîêîíòðîëëåðà

3.       Ñòðóêòóðíàÿ ñõåìà óñòðîéñòâà

3.1     Ñîñòàâ è íàçíà÷åíèå îòäåëüíûõ ýëåìåíòîâ

3.2     Àíàëèç ðåñóðñîâ ââîäà-âûâîäà

4.       Ñòðóêòóðà àëãîðèòìà ïðîãðàììû

4.1     Îáîáù¸ííàÿ ÁÑÀ

4.2     Ðàáî÷àÿ ÁÑÀ

4.2.1 ÁÑÀ îñíîâíîé ïðîãðàììû.

4.2.2 ÁÑÀ îáðàáîò÷èêà ïðåðûâàíèÿ îò òàéìåðà

4.2.3 ÁÑÀ îáðàáîò÷èêà ïðåðûâàíèé îò ÀÖÏ

4.2.4 ÁÑÀ ïîäïðîãðàììû òàáëè÷íîé ïåðåêîäèðîâêè íàïðÿæåíèå â äàâëåíèå

4.2.5 ÁÑÀ ïîäïðîãðàììû âûâîäà ÷èñëà íà èíäèêàöèþ

4.2.6 ÁÑÀ ïîäïðîãðàììû ïåðåâîäà ÷èñëà â BCD ôîðìàò

5. Ïðèíöèïèàëüíàÿ ñõåìà óñòðîéñòâà

Çàêëþ÷åíèå        

Ñïèñîê ëèòåðàòóðû

Ïðèëîæåíèå


Ââåäåíèå.

Ñ ðàçâèòèåì ìèêðîýëåêòðîííîé èíäóñòðèè, à â ÷àñòíîñòè ñ ðàçâèòèåì ìèêðîêîíòðîëëåðîâ, ïîÿâèëàñü âîçìîæíîñòü äåëàòü ìàëîãàáàðèòíûå è ñðàâíèòåëüíî äåø¸âûå ýëåêòðîííûå èçäåëèÿ.

Íà ñåãîäíÿøíèé äåíü, â êàæäîé àïòåêå è ñïåöèàëèçèðîâàííûõ ìàãàçèíàõ, ìîæíî óâèäåòü â ïðîäàæå ðàçëè÷íûå ìåäèöèíñêèå ïðèáîðû. Íàïðèìåð, öèôðîâîé òåðìîìåòð, öèôðîâîé èçìåðèòåëü äàâëåíèÿ êðîâè è ìíîãîå äðóãîå.

Ïîÿâëåíèå òàêèõ ïðèáîðîâ íà ïðèëàâêàõ ìàãàçèíîâ, îáóñëîâëåíî ïðîãðåññèâíûì ðàçâèòèåì öèôðîâîé òåõíèêè, â òîì ÷èñëå è ìèêðîêîíòðîëëåðíûõ ñèñòåì.

Ìèêðîêîíòðîëëåðû ïîçâîëÿþò ìåíüøå èñïîëüçîâàòü òèïîâûå ýëåìåíòû â ðàçðàáîòêàõ, ò.ê. ïðàêòè÷åñêè âñ¸ ìîæíî ñäåëàòü ïðîãðàììíûìè ñðåäñòâàìè, òåì ñàìûì ýëåêòðîííûå èçäåëèÿ ñäåëàííûå íà áàçå ìèêðîêîíòðîëëåðîâ ÿâëÿþòñÿ ìàëîãàáàðèòíûìè è ñòîÿò ñðàâíèòåëüíî íå äîðîãî.

 íàñòîÿùåå âðåìÿ, áîëüøàÿ ÷àñòü ìåäèöèíñêèõ ïðèáîðîâ ïîñòðîåííà íà öèôðîâîé ëîãèêå, ãëàâíûì ýëåìåíòîì êîòîðîé ÿâëÿåòñÿ ìèêðîêîíòðîëëåð, è èíäèêàöèÿ ïðîèñõîäèò íà öèôðîâûõ èíäèêàòîðàõ, áîëüøóþ ÷àñòü èç êîòîðûõ ñîñòàâëÿþò ÆÊÈ.

Ïîýòîìó, òåìà äëÿ ðàçðàáîòêè áûëà âûáðàííà: “Öèôðîâîé èçìåðèòåëü êðîâÿíîãî äàâëåíèÿ”. Ýòîò ïðèáîð ÿâëÿåòñÿ íàèáîëåå íóæíûì â êàæäîé ñåìüå. Âåäü åñëè òû ÷óâñòâóåø ñåáÿ íå âàæíî, òî â ëþáîé ìîìåíò ìîæíî ïîìåðèòü äàâëåíèå è èç ïîëó÷åííûõ ðåçóëüòàòîâ ñäåëàòü âûâîä, íàäî áåæàòü â áîëüíèöó èëè íåò.


1.Òåõíè÷åñêîå çàäàíèå

Óñòðîéñòâî – öèôðîâîé èçìåðèòåëü êðîâÿíîãî äàâëåíèÿ.

Îñíîâíûå òåõíè÷åñêèå õàðàêòåðèñòèêè ïðèáîðà:

1.  Îáùèé äèàïàçîí èçìåðåíèÿ:

à. Ñèñòîëè÷åñêîå/äèàñòîëè÷åñêîå äàâëåíèå: îò 0 äî 250 ìì.ðò.ñò.

á. Ïóëüñ: îò 0 äî 133 óä. â ìèí.

2.  Ìèíèìàëüíûé øàã èíäèêàöèè: 1.5 ìì.ðò.ñò.

3.  Òî÷íîñòü èçìåðåíèÿ:

à. Ñòàòè÷åñêîå äàâëåíèå: 3 ìì.ðò.ñò.

á. Ïóëüñ: 5% ïîêàçàíèé.

4. Èíäèêàòîð: ÆÊÈ-ìîäóëü.

Èíôîðìàöèÿ î äàâëåíèè è ïóëüñå îòîáðàæàåòñÿ íà 16-òè ðàçðÿäíîì, 2-õ ñòðî÷íîì ÆÊÈ-ìîäóëå.

Èçìåðåíèå ïðîèñõîäèò â ïîëóàâòîìàòè÷åñêîì ðåæèìå.


2. Âûáîð è îáîñíîâàíèå ýëåìåíòíîé áàçû

 äàííîì óñòðîéñòâå, èíôîðìàöèÿ î ñèñòîëè÷åñêîì, äèàñòîëè÷åñêîì äàâëåíèè è ïóëüñå äîëæíà âûâîäèòüñÿ îäíîâðåìåííî. Ñ ó÷¸òîì âñåãî ýòîãî, áûë âûáðàí ÆÊÈ-ìîäóëü DV-16210NRB/R, êîòîðûé èìååò äâå ñòðîêè, ïî 16 ðàçðÿäîâ â êàæäîé ñòðîêå.

Äàò÷èê äàâëåíèÿ â ðàññìàòðèâàåìîì óñòðîéñòâå, äîëæåí îòâå÷àòü ñëåäóþùèì òðåáîâàíèÿì:

1.  Äàò÷èê äîëæåí áûòü ñî ñòàíäàðòíûì âûõîäíûì ñèãíàëîì, òî åñòü ïðè ìèíèìàëüíîì çíà÷åíèè äàâëåíèÿ äîëæåí èìåòü âûõîäíîé ñèãíàë íå áîëåå 0,3V, à ïðè ìàêñèìàëüíîì äàâëåíèè íå áîëåå 4,8V, ýòî îáåñïå÷èâàåò íåïîñðåäñòâåííîå ñîåäèíåíèå äàò÷èêà ñ ìèêðîêîíòðîëëåðîì.

2.  Äàò÷èê äîëæåí èçìåðÿòü îòíîñèòåëüíîå äàâëåíèå(îòíîñèòåëüíî àòìîñôåðû).

3.  Ìàêñèìàëüíîå èçìåðÿåìîå äàâëåíèå äîëæíî ëåæàòü â ïðåäåëàõ îò 30 êÏà äî 50 êÏà, òàê êàê äèàïàçîí èçìåðåíèÿ ñèñòîëè÷åñêîãî/äèàñòîëè÷åñêîãî äàâëåíèÿ ñîñòàâëÿåò îò 0 äî 250 ìì.ðò.ñò.

Âçÿâ âî âíèìàíèå âñå ýòè 3-è ïóíêòà áûë âûáðàí äàò÷èê äàâëåíèÿ ôèðìû MOTOROLA MPX5050DP.

2.1 Âûáîð ìèêðîêîíòðîëëåðà

Âûáîð ìèêðîêîíòðîëëåðà îñóùåñòâëÿåòñÿ ñ ó÷¸òîì ñëåäóþùèõ ïàðàìåòðîâ:

1.  Ëèíèé ââîäà-âûâîäà äîëæíî áûòü íå ìåíåå 13, ò.ê. 11 ëèíèé íåîáõîäèìî äëÿ ðàáîòû ñ èíäèêàòîðîì, à äâå ëèíèè äëÿ ðàáîòû ñ ñèãíàëàìè ïîñòóïàþùèìè îò äàò÷èêà äàâëåíèÿ.

2.  Ìèêðîêîíòðîëëåð äîëæåí èìåòü âñòðîåííûé ÀÖÏ, äëÿ ðàáîòû ñ àíàëîãîâûìè ñèãíàëàìè ïîñòóïàþùèìè îò äàò÷èêà äàâëåíèÿ MPX5050DP íà âõîäû ÀÖÏ ìèêðîêîíòðîëëåðà.

Ïîýòîìó, ïðèíèìàÿ âî âíèìàíèå, ýòè äâà ãëàâíûõ ïàðàìåòðà, áûë âûáðàí ìàëîâûâîäíîé ìèêðîêîíòðîëëåð ôèðìû MOTOROLA MC68HC908JL3.


3.  Ñòðóêòóðíàÿ ñõåìà óñòðîéñòâà

3.1 Ñîñòàâ è íàçíà÷åíèå îòäåëüíûõ ýëåìåíòîâ

Ñòðóêòóðíàÿ ñõåìà óñòðîéñòâà ïðèâåäåíà íà ðèñ.3.1.1.

Îñíîâîé óñòðîéñòâà ÿâëÿåòñÿ ìèêðîêîíòðîëëåð. Îñíîâíàÿ ôóíêöèÿ ìèêðîêîíòðîëëåðà, ýòî ïðèåì äàííûõ îò äàò÷èêà è àêòèâíîãî ôèëüòðà(ÀÔ), îáðàáîòêà ýòèõ äàííûõ, ò.å. âû÷èñëåíèå ñèñòîëè÷åñêîãî, äèàñòîëè÷åñêîãî äàâëåíèÿ è óñðåäí¸ííîé ÷àñòîòû ïóëüñà. Ïîñëå òîãî, êàê âñå èçìåðåíèÿ áóäóò ïðîèçâåäåíû, ìèêðîêîíòðîëëåð âûâîäèò èíôîðìàöèþ íà èíäèêàòîð.

Äàò÷èê ïðåäíàçíà÷åí äëÿ ïåðåâîäà äàâëåíèÿ â ìàíæåòå, â ýëåêòðè÷åñêèé ñèãíàë, ò.å. íàïðÿæåíèå.

ÀÔ âûñîêîé ÷àñòîòû ïðåäíàçíà÷åí äëÿ âûäåëåíèÿ è óñèëåíèÿ ñèãíàëà, ïóëüñèðóþùåãî ñ ÷àñòîòîé 1Ãö, íàëîæåííîãî íà ìåäëåííî èçìåíÿþùèéñÿ ñèãíàë 0.04Ãö. Âûäåëåíèå ñèãíàëà íåîáõîäèìî, ïîòîìó ÷òî äàâëåíèå ðàñïîçíà¸òñÿ ïî ïðîèçâîäíîé ñèãíàëà, ïóëüñèðóþùåãî ñ ÷àñòîòîé 1Ãö, à çíà÷åíèå äàâëåíèÿ ñìîòðèòñÿ ïî ìåäëåííî èçìåíÿþùåìóñÿ ñèãíàëó (0,04Ãö). Ïîýòîìó ó ìèêðîêîíòðîëëåðà çàäåéñòâîâàíû 2-à âõîäà ÀÖÏ.

Ïðè ðàçðàáîòêå äàííîãî óñòðîéñòâà ñóùåñòâîâàëà ñëîæíîñòü â òîì, ÷òî äàò÷èê ïðè íåèíâàçèâíûõ ïðèìåíåíèÿõ(áåç ïðîíèêíîâåíèÿ âî âíóòðåííèå ïîëîñòè îðãàíèçìà) íå ìîæåò áûòü ðàñïîëîæåí íåïîñðåäñòâåííî âíóòðè ñèñòåìû, â êîòîðîé èçìåðÿåòñÿ äàâëåíèå. Ïîýòîìó ïðèøëîñü ðàçðàáîòàòü íåñòàíäàðòíóþ ñèñòåìó èçìåðåíèé, â êîòîðîé äàò÷èê ïîìåùàåòñÿ âíóòðè ìàíæåòû, íà êîòîðîå íàëîæåíû íåáîëüøèå ïî àìïëèòóäå è áîëåå áûñòðûå ïóëüñàöèè, ñîîòâåòñòâóþùåå èçìåíåíèþ äàâëåíèÿ â êðîâåíîñíîé ñèñòåìå.

Ñ âíåøíåé ñòîðîíîé ýòîãî ìåòîäà èçìåðåíèÿ äàâëåíèÿ êðîâè, íàçûâàåìîãî îñöèëëîìåòðè÷åñêèì, çíàêîìû ïðàêòè÷åñêè âñå. Ïðè ýòîì ðóêà ñæèìàåòñÿ êîëüöåâîé íàäóâíîé ìàíæåòîé, íàêà÷èâàåìîé âðó÷íóþ. Çàòåì âåíòèëü ìàíæåòû ñëåãêà ïðèîòêðûâàåòñÿ, è äàâëåíèå â ìàíæåòå ïîñòåïåííî ïàäàåò, è, êîãäà îíî ñòàíîâèòñÿ áëèçêèì ê àðòåðèàëüíîìó äàâëåíèþ, àìïëèòóäà ïóëüñàöèè äàâëåíèÿ âîçðàñòàåò. Ïóëüñàöèè äàâëåíèÿ îïðåäåëÿþòñÿ ðàáîòîé ñåðäöà.

Êîãäà äàâëåíèå â ìàíæåòå èçìåíÿåòñÿ îò ñèñòîëè÷åñêîãî äî äèàñòîëè÷åñêîãî, ïóëüñàöèè äàâëåíèÿ äîñòàòî÷íî âåëèêè, çà ãðàíèöåé ýòîãî äèàïàçîíà îíè ðåçêî ñíèæàþòñÿ. Îïðåäåëèòü ýòîò äèàïàçîí ìîæíî, ïðîñëóøèâàÿ ìàíæåòó ñ ïîìîùüþ ñòåòîñêîïà, íî, èìåÿ äàò÷èê äàâëåíèÿ, ëó÷øå ïðåâðàòèòü ïóëüñàöèè äàâëåíèÿ â ýëåêòðè÷åñêèé ñèãíàë è äàëåå àíàëèçèðîâàòü åãî ñ ïîìîùüþ ìèêðîïðîöåññîðíîãî óñòðîéñòâà.

Òàêîé ýëåêòðè÷åñêèé ñèãíàë íà ïðîòÿæåíèè âñåãî âðåìåíè èçìåðåíèÿ ïðåäñòàâëåí íà ðèñ.3.1.2.à. Ñíà÷àëà èä¸ò ýòàï ðó÷íîé ïîäêà÷êè ìàíæåòû(íà ðèñ.3.1.2.à. âèäíû ïîâûøåíèÿ äàâëåíèÿ ïðè êàæäîì íàæàòèè ãðóøè), çàòåì â ìîìåíò t1 ïðåêðàùàåòñÿ ïîäêà÷êà è îòêðûâàåòñÿ âåíòèëü. Äàâëåíèå, êîòîðîå â ìîìåíò t1 ïðåâûøàåò ñèñòîëè÷åñêîå, ïîñòåïåííî ïîíèæàåòñÿ.

 òî æå âðåìÿ, êàê ýòî âèäíî èç ðèñ.3.1.2.à. íà îïðåäåë¸ííîì ó÷àñòêå ïóëüñàöèè äàâëåíèÿ ðàñòóò, íî îòíîñèòåëüíàÿ âåëè÷èíà ýòèõ ïóëüñàöèé î÷åíü íåâåëèêà ïî ñðàâíåíèþ ñ óñðåäí¸ííîé âåëè÷èíîé äàâëåíèÿ. ×òîáû áûëî óäîáíî ðàáîòàòü ñ ñèãíàëîì ïóëüñàöèé, íåîáõîäèìî îòôèëüòðîâàòü íèçêî÷àñòîòíóþ óñðåäí¸ííóþ ñîñòàâëÿþùóþ è óñèëèòü ñèãíàë ïóëüñàöèé. Ýòî ìîæíî ñäåëàòü ñ ïîìîùüþ àêòèâíîãî ôèëüòðà íà áàçå îïåðàöèîííîãî óñèëèòåëÿ (íà ñòðóêòóðíîé ñõåìå ÀÔ). Òàêîé îòôèëüòðîâàííûé è óñèëåííûé ñèãíàë ïðåäñòàâëåí íà ðèñ.3.1.2.á â äèàïàçîíå âûäåëåííîì íà ðèñ.3.1.2.à ïðÿìîóãîëüíèêîì.

Äèàãðàììû ðèñ.3.1.2. õîðîøî èëëþñòðèðóþò îñíîâíóþ èäåþ èçìåðåíèÿ äàâëåíèÿ êðîâè, êîòîðàÿ ñâîäèòñÿ â ïîëó÷åíèè è àíàëèçå äàííûõ, ïðèõîäÿùèõ ñ äàò÷èêà è àêòèâíîãî ôèëüòðà.


Ñòðóêòóðíàÿ ñõåìà óñòðîéñòâà.

MCU

 

Èíäèêàòîð

 

Äàò÷èê

 


 11


Ðèñ.3.1.1.

Äèàãðàììû èçìåðåíèÿ êðîâÿíîãî äàâëåíèÿ

Ðèñ.3.1.2.

3.2 Àíàëèç ðåñóðñîâ ââîäà-âûâîäà

Ìèêðîêîíòðîëëåðû ñåìåéñòâà HC08 ôèðìû MOTOROLA èìåþò çàêðûòóþ àðõèòåêòóðó, êîòîðàÿ õàðàêòåðèçóåòñÿ îòñóòñòâèåì ëèíèé ìàãèñòðàëåé àäðåñà è äàííûõ íà âûâîäàõ êîðïóñà ìèêðîêîíòðîëëåðà. Ìèêðîêîíòðîëëåð ïðåäñòàâëÿåò ñîáîé çàêîí÷åííóþ ñèñòåìó îáðàáîòêè äàííûõ, íàðàùèâàíèå ïàìÿòè èëè ïåðèôåðèéíûõ óñòðîéñòâ ñ èñïîëüçîâàíèåì ïàðàëëåëüíûõ ìàãèñòðàëåé àäðåñà è äàííûõ íå ïðåäïîëàãàåòñÿ. Ïîýòîìó àíàëèç ðåñóðñîâ ââîäà-âûâîäà, äîëæåí ïðîèñõîäèòü â ñàìîì íà÷àëå ðàçðàáîòêè, ò.ê. â ïðîòèâíîì ñëó÷àå ìîæåò âîçíèêíóòü ñèòóàöèÿ íåõâàòêè ëèíèé ââîäà-âûâîäà.

Íà ïðèíöèïèàëüíîé ñõåìå èçîáðàæ¸ííîé íà ðèñ.5.1. ìîæíî ïîäñ÷èòàòü, ÷òî ó ìèêðîêîíòðîëëåðà äîëæíî áûòü íå ìåíåå 13 ëèíèé ââîäà-âûâîäà(11 ëèíèé äëÿ ðàáîòû ñ ÆÊÈ-ìîäóëåì è äâå ëèíèè äëÿ ðàáîòû ñ äàò÷èêîì äàâëåíèÿ).

 äàííîì ñëó÷àå áûë âûáðàí ìèêðîêîíòðîëëåð MC68HC908JL3, êîòîðûé èìååò 22 ëèíèè ââîäà-âûâîäà. Òî åñòü, ïî ñóòè äåëà ó íàñ îñòà¸òñÿ ñâîáîäíûìè, 9-òü ëèíèé ââîäà-âûâîäà, êîòîðûå ìîæíî èñïîëüçîâàòü äëÿ ðàçëè÷íûõ óñîâåðøåíñòâîâàíèé ïðèáîðà. Íàïðèìåð, ìîæíî äîïîëíèòåëüíî â ïðèáîðå ñäåëàòü ÷àñû, òàêæå ìîæíî ñäåëàòü, ÷òîáû ïðèáîð èçìåðÿë äàâëåíèå â àâòîìàòè÷åñêîì ðåæèìå, äëÿ ýòîãî íåîáõîäèì êîìïðåññîð, êîòîðûé áóäåò íàãíåòàòü äàâëåíèå â ìàíæåòó. Âñå ýòè äîðàáîòêè íåïîñðåäñòâåííî ïîâëåêóò çà ñîáîé, çàäåéñòâîâàíèå äîïîëíèòåëüíûõ ëèíèé ââîäà-âûâîäà.


4. Ñòðóêòóðà àëãîðèòìà ïðîãðàììû

4.1 Îáîáù¸ííàÿ ÁÑÀ

Îáîáù¸ííàÿ ÁÑÀ ïðîãðàììû, óïðàâëÿþùåé ñèñòåìîé, ïðèâåäåíà íà ðèñ.4.1.2. Ïîñëå âêëþ÷åíèÿ ïèòàíèÿ ïðîèñõîäèò èíèöèàëèçàöèÿ âñåé ñèñòåìû. Ïîñëå ýòîãî ìèêðîêîíòðîëëåð æä¸ò íàêà÷êè ìàíæåòû, îñóùåñòâëÿÿ öèêëè÷åñêóþ ïðîâåðêó îêîí÷àíèÿ íàêà÷êè. Êîãäà ñèãíàë äàò÷èêà óìåíüøàåòñÿ â òå÷åíèè áîëåå ÷åì 0,75 ñåêóíä, ýòî ñâèäåòåëüñòâóåò, ÷òî ïîëüçîâàòåëü áîëüøå íå íàêà÷èâàåò ìàíæåòó, è ìèêðîêîíòðîëëåð íà÷èíàåò àíàëèçèðîâàòü ñèãíàë êîëåáàíèÿ. Àíàëèç ñèãíàëà êîëåáàíèÿ ñâîäèòñÿ ê èäåíòèôèêàöèè àìïëèòóäû ïóëüñà è îñóùåñòâëÿåòñÿ â áëîêàõ 3 è 4.

Ïîðîãîâûé óðîâåíü äëÿ èçìåðåíèÿ ÷àñòîòû èìïóëüñîâ óñòàíîâëåí ðàâíûì 1,75V, ÷òîáû óñòðàíèòü øóìû èëè âñïëåñêè. Êàê òîëüêî àìïëèòóäà ïóëüñà èäåíòèôèöèðîâàíà, ìèêðîêîíòðîëëåð èãíîðèðóåò ñèãíàë â òå÷åíèè 450 ìS, ÷òîáû ïðåäîòâðàòèòü ëîæíóþ èäåíòèôèêàöèþ èç-çà íàëè÷èÿ ïðîìåæóòî÷íîãî ìàêñèìóìà êîëåáàíèÿ. Ïîñëå ÷åãî â áëîêå 5 ïðîèñõîäèò âû÷èñëåíèå ïðîèçâîäíîé àìïëèòóäû ïóëüñà. Èìåííî ïî ïðîèçâîäíîé àìïëèòóäû ïóëüñà îïðåäåëÿåòñÿ äàâëåíèå êðîâè, áëîê 6.

Èç ãðàôèêà ïîêàçàííîãî íà ðèñ.4.1.1., ìîæíî óâèäåòü, ÷òî îñíîâíîé ïðèíöèï èçìåðåíèÿ îñíîâàí íà ñðàâíåíèè ïðîèçâîäíîé ñ 2-ìÿ ïîðîãàìè, Ïîðîã1 è Ïîðîã2. Áîëåå ïîäðîáíî, ýòî áóäåò ðàññìîòðåíî â ïóíêòå 4.2.


Ãðàôèê ïðîèçâîäíîé àìïëèòóäû ïóëüñà.

Ïðÿìîóãîëüíàÿ âûíîñêà: äèàñòîëè÷åñêîå


   Ïîðîã2

Ïðÿìîóãîëüíàÿ âûíîñêà: ñèñòîëè÷åñêîå


   Ïîðîã1


Ðèñ.4.1.1.

          Ïîñëå òîãî êàê óñòðîéñòâî îïðåäåëèò äàâëåíèå è ïóëüñ, îíî ïðîâåðÿåò, åñòü îøèáêè â èçìåðåíèè èëè íåò. Åñëè îøèáêè åñòü, òî ìèêðîêîíòðîëëåð âûâîäèò ñîîáùåíèå îá îøèáêè, ïîñëå ÷åãî, åñëè ìàíæåòà ñïóùåíà, ò.å. äàâëåíèå âíóòðè ìàíæåòû ðàâíî àòìîñôåðíîìó äàâëåíèþ, òî óñòðîéñòâî íà÷èíàåò èçìåðåíèå ïî íîâîìó. Åñëè îøèáîê íåò, òî èíôîðìàöèÿ î äàâëåíèè è ïóëüñå âûâîäèòñÿ íà èíäèêàòîð, ïîñëå ÷åãî ñèñòåìà îïÿòü ñìîòðèò, åñëè ìàíæåòà ñïóùåíà, òî èçìåðåíèå äàâëåíèÿ ïðîèñõîäèò ïî íîâîìó, åñëè ìàíæåòà íå ñïóùåíà, òî ïðîãðàììà çàöèêëåâàåòñÿ è æä¸ò ñïóñêà ìàíæåòû.



2. Ïðîöåäóðà îæèäàíèÿ îêîí÷àíèÿ íàêà÷êè ìàíæåòû

 
          


                                                    Y                            N


                                                            Y                                              N                                                                    

                                                       


                                     Y                                     N            

                                 


                          N                                                           Y

                  


                              Y                                                 

Ðèñ.4.1.2. Îáîáù¸ííàÿ ÁÑÀ.


4.2 Ðàáî÷àÿ ÁÑÀ

4.2.1 ÁÑÀ îñíîâíîé ïðîãðàììû

Ðàáî÷àÿ ÁÑÀ ïðèäñòàâëåííà íà ðèñ.4.2.1.2.. íà÷àëå ïðîãðàììû ïðîèñõîäèò èíèöèàëèçàöèÿ, áëîê 1, â êîòîðîì ïðîèñõîäèò èíèöèàëèçàöèÿ ïîðòîâ ââîäà-âûâîäà, ÀÖÏ è òàéìåðà. Ïîñëå ÷åãî â áëîêå 2 îáíóëÿþòñÿ âñå ïåðåìåííûå, çàäåéñòâîâàííûå â äàííîé ïðîãðàììå. Êàê òîëüêî, ýòî âñ¸ âûïîëíèòñÿ, ïðîèñõîäèò çàïóñê ÀÖÏ(áëîê 4), ó êîòîðîãî àíàëîãîâûì âõîäîì ÿâëÿåòñÿ ëèíèÿ ÐÒÂ0.

Ïåðâûé ðåçóëüòàò ïðåîáðàçîâàíèÿ àíàëîãîâîãî ñèãíàëà, çàíîñèòñÿ â ÿ÷åéêó ïàìÿòè CONST, è îçíà÷àåò çíà÷åíèå êîäà ïðè íóëåâîì äàâëåíèè. Ïîñëå ýòîãî íà èíäèêàòîð âûâîäÿòñÿ ñèìâîëû êàê ïîêàçàíî íà ðèñ.4.2.1.1., è â ìëàäøåì ðàçðÿäå “ñèñ:” çàæèãàåòñÿ 0. Ïîñëå ÷åãî, èä¸ò ïðîöåäóðà îæèäàíèÿ îêîí÷àíèÿ íàêà÷êè ìàíæåòû.


                                       ñèñ õ õ 0

                          äèà õ õ õ            ïóë õ õ õ

ðèñ.4.2.1.1. Ðàñïîëîæåíèå ñèìâîëîâ íà èíäèêàòîðå.

Îíà çàêëþ÷àåòñÿ â ñëåäóþùåì.  ÿ÷åéêó ïàìÿòè del çàíîñèòñÿ ÷èñëî ñîîòâåòñòâóþùåå çàäåðæêå 0,75 ñåêóíäû( áë.12).  áëîêàõ 16 è 15 îðãàíèçîâàí öèêë, ïîñëå âûïîëíåíèÿ êîòîðîãî, ïðîèñõîäèò èíäèêàöèÿ òåêóùåãî äàâëåíèÿ (áë. 17 – 21). Ïîñëå ÷åãî äåëàåòñÿ äåêðåìåíò ÿ÷åéêè ïàìÿòè del. Åñëè del0 òî, ïðîãðàììà ïåðåõîäèò ê âûïîëíåíèþ áë.13. è âñå ïðîèñõîäèò çàíîâî. Åñëè del=0, òî â áë.25. ïðîèñõîäèò ñðàâíåíèå äàâëåíèÿ äî çàäåðæêè è ïîñëå çàäåðæêè. Åñëè äàâëåíèå ïîñëå çàäåðæêè áîëüøå äàâëåíèÿ äî çàäåðæêè, òî ïðîãðàììà ïåðåõîäèò ê âûïîëíåíèþ áë.12. è äàííàÿ ïðîöåäóðà ïîâòîðÿåòñÿ. Åñëè æå äàâëåíèå ïîñëå çàäåðæêè ìåíüøå äàâëåíèÿ äî çàäåðæêè, òî ýòî îçíà÷àåò, ÷òî ïîëüçîâàòåëü ïðåêðàòèë íàêà÷êó ìàíæåòû, è ïðîãðàììà ïåðåõîäèò íà ïðîöåäóðó îïðåäåëåíèÿ àìïëèòóäû.

 íà÷àëå ïðîöåäóðû, â áëîêå 30 ïðîèñõîäèò ñðàâíåíèå íàïðÿæåíèÿ ñíèìàåìîãî ñ àêòèâíîãî ôèëüòðà (âõîä ÐÒÂ1) ñ çàäàííûì ïîðîãîì íàïðÿæåíèÿ (1,75V). Åñëè ïîðîãîâîå íàïðÿæåíèå áîëüøå íàïðÿæåíèÿ ñíèìàåìîãî ñ ÀÔ, òî ïðîãðàììà çàöèêëåâàåòñÿ è îæèäàåò êîãäà íàïðÿæåíèå ñ ÀÔ áóäåò áîëüøå ïîðîãîâîãî. Ïðè÷¸ì, åñëè â òå÷åíèè 5 ñåêóíä ïðîãðàììà íàõîäèòñÿ â öèêëå, òî èçìåðåíèå ïðåêðàùàåòñÿ è âûâîäèòñÿ ñîîáùåíèå îá îøèáêè. Åñëè Upress1>Ïîð, òî ïðîèñõîäèò ñáðîñ ÿ÷åéêè ïàìÿòè OVSEC, è äàëåå ïðîèñõîäèò îïðåäåëåíèå çíà÷åíèÿ àìïëèòóäû (áë. 33 – 37).

Êàê òîëüêî, àìïëèòóäà áóäåò îïðåäåëåííà, ïðîèñõîäèò ñáðîñ è ïåðåçàïóñê òàéìåðà, à òàêæå îáíóëåíèå SEC10 è SEC (áë. 38). Ïîñëå ÷åãî çíà÷åíèå àìïëèòóäû çàíîñèòñÿ â ÿ÷åéêó ïàìÿòè ÀÌÐ2 (áë. 39). Äàëåå ÀÖÏ ïåðåêëþ÷àåòñÿ íà âõîä ÐÒÂ0 (áë. 40), è ðåçóëüòàò âòîðîãî ïðåîáðàçîâàíèÿ çàíîñèòñÿ â UDAV (ýòîò ðåçóëüòàò ïîêàçûâàåò äàâëåíèå â ìàíæåòå), ïîñëå ÷åãî ÀÖÏ îáðàòíî ïåðåêëþ÷àåòñÿ íà âõîä ÐÒÂ1. Êàê òîëüêî ÀÖÏ ïåðåêëþ÷èòñÿ íà âõîä ÐÒÂ1, ÿ÷åéêà ïàìÿòè PULSE, â êîòîðîé íàõîäèòñÿ êîë-âî ïóëüñàöèé, èíêðåìåíòèðóåòñÿ. À äàëåå èäåò ïðîöåäóðà âû÷èñëåíèÿ ïðîèçâîäíîé àìïëèòóäû.

Ïðîèçâîäíàÿ âû÷èñëÿåòñÿ ïî ôîðìóëå:

,

ãäå, AMP1 è AMP2 – àìïëèòóäû;

time – âðåìÿ ìåæäó àìïëèòóäàìè.

Ïðè ïåðâîì âõîäå â ïðîöåäóðó SB=0 (áë.50), âû÷èñëÿåòñÿ âðåìÿ èìïóëüñà è çàíîñèòñÿ â ÿ÷åéêó ïàìÿòè time1 (áë.52 – 55). Ïîñëå ÷åãî ïðîâåðÿåòñÿ (áë.56), åñëè ïåðâàÿ àìïëèòóäà íàõîäèòñÿ â ÀÌÐ2, à âòîðàÿ â ÀÌÐ1, òî îíè ìåíÿþòñÿ ìåñòàìè (áë.57 – 59) è ïðîãðàììà ïåðåõîäèò íà âûïîëíåíèå áë.29, ò.å. îïðåäåëåíèå àìïëèòóäû íà÷èíàåòñÿ ñíà÷àëà. Åñëè ïåðâàÿ àìïëèòóäà íàõîäèòñÿ â ÀÌÐ1, à âòîðàÿ â ÀÌÐ2, òî íè÷åãî íå ïðîèñõîäèò, è îïðåäåëåíèå àìïëèòóäû íà÷èíàåòñÿ çàíîâî.

Ïðè ïîñëåäóþùåì âõîäå SB=1, â íà÷àëå òàêæå îïðåäåëÿåòñÿ âðåìÿ èìïóëüñà, íî äàëåå ñìîòðèòñÿ:

1.  Åñëè ÐÂ=0, òî çíà÷åíèå âðåìåíè çàíîñèòñÿ â time2, ïîñëå ÷åãî èç time2 âû÷èòàåòñÿ time1, è Рóñòàíàâëèâàåòñÿ â “1” (áë.64 – 66).

2.  Åñëè ÐÂ=1, òî çíà÷åíèå âðåìåíè çàíîñèòñÿ â time1, ïîñëå ÷åãî èç time1 âû÷èòàåòñÿ time2, è Рóñòàíàâëèâàåòñÿ â “0” (áë.61 – 63).

È â ïåðâîì, è âî âòîðîì ñëó÷àå, ðåçóëüòàò ïðåîáðàçîâàíèÿ çàíîñèòñÿ â time3 (áë.67).

 áëîêå 68 ïðîèñõîäèò îïðåäåëåíèå ðàçíîñòè ìåæäó ÀÌÐ2 è ÀÌÐ1. Äàëåå â áëîêàõ 69 – 73 âû÷èñëÿåòñÿ ïðîèçâîäíàÿ. Ïîñëå ÷åãî ïðîãðàììà ïåðåõîäèò ê ïðîöåäóðå îïðåäåëåíèÿ äàâëåíèÿ.

Èç ãðàôèêà ïîêàçàííîãî íà ðèñ.4.2.1.1. âèäíî, ÷òî ïåðâàÿ ïðîèçâîäíàÿ, êîòîðàÿ áîëüøå ïîðîãà ÏÎÐÎÃ1 ÿâëÿåòñÿ îïðåäåëÿþùåé äëÿ ñèñòîëè÷åñêîãî äàâëåíèÿ, ò.å. ïî íåé îïðåäåëÿþò ñèñòîëè÷åñêîå äàâëåíèå. Ïîñëåäóþùåå ïðîèçâîäíûå, êîòîðûå áîëüøå ïîðîãà ÏÎÐÎÃ1, íî ìåíüøå ïîðîãà ÏÎÐÎÃ2 íå ÿâëÿþòñÿ îïðåäåëÿþùèìè è èãíîðèðóþòñÿ. Êîãäà ïðîèçâîäíàÿ áóäåò áîëüøå ïîðîãà ÏÎÐÎÃ2, òî îíà ñòàíåò îïðåäåëÿþùåé äëÿ äèàñòîëè÷åñêîãî äàâëåíèÿ. Ïîýòîìó â ïðîöåäóðå îïðåäåëåíèÿ äàâëåíèÿ, ñíà÷àëà îïðåäåëÿåòñÿ ñèñòîëè÷åñêîå äàâëåíèå (áë.75). Åñëè äàâëåíèå îïðåäåëèëîñü, òî çíà÷åíèå äàâëåíèÿ çàíîñèòñÿ â SIS, ïîñëå ÷åãî áèò QB óñòàíàâëèâàåòñÿ â “1” (áë.77,78), è èä¸ò îïðåäåëåíèå äèàñòîëè÷åñêîãî äàâëåíèÿ. Åñëè äàâëåíèå íå îïðåäåëèëîñü, òî áèò QB íå óñòàíàâëèâàåòñÿ, è äàëåå ïðîèñõîäèò îïðåäåëåíèå äèàñòîëè÷åñêîãî äàâëåíèÿ.

Êàê òîëüêî äèàñòîëè÷åñêîå äàâëåíèå áóäåò îïðåäåëåííî (áë.76), åãî çíà÷åíèå ïåðåíîñèòñÿ â DIA (áë.79). Ïîñëå ÷åãî îñóùåñòâëÿåòñÿ ïðîâåðêà (áë.80), åñëè SIS=0, òî âûâîäèòñÿ ñîîáùåíèå îá îøèáêè, ïîñëå ÷åãî óñòðîéñòâî îæèäàåò ñïóñêà ìàíæåòû (áë.81), ïåðåä ïîâòîðíûì èçìåðåíèåì. Åñëè SIS0, òî èä¸ò âû÷èñëåíèå ÷àñòîòû ïóëüñà (áë.82 – 84) è äàëåå ïðîèñõîäèò èíäèêàöèÿ äàâëåíèÿ è ïóëüñà (áë.85), ïîñëå ÷åãî óñòðîéñòâî îïÿòü îæèäàåò ñïóñê ìàíæåòû ïåðåä ïîâòîðíîé íàêà÷êîé.

Áèò QB ïîçâîëÿåò ñíà÷àëà îïðåäåëÿòü ñèñòîëè÷åñêîå äàâëåíèå, è òîëüêî ïîòîì îïðåäåëÿòü äèàñòîëè÷åñêîå äàâëåíèå, ïðè÷¸ì åñëè ñèñòîëè÷åñêîå äàâëåíèå îïðåäåëåííî, òî â ïîñëåäóþùåì îïðåäåëÿåòñÿ òîëüêî äèàñòîëè÷åñêîå äàâëåíèå.

1.INIT

 


 

7.UpressConst

 

8.Èíäèêàöèÿ ñèìâîëîâ

 


Ðèñ.4.2.1.2.



                                    


                


Áëîê-ñõåìà: ðåøåíèå: del=0                                                                                              


Ðèñ.4.2.1.2.(ïðîäîëæåíèå)


26.Acmp1

 

24.UpressA

 
                     


                                                       


                                                                                                              

Áëîê-ñõåìà: ðåøåíèå: 30.Upress1>Ïîð

32.Âûâîä ñîîáùåíèÿ îá îøèáêè

 


                                                                                         


                                               


Áëîê-ñõåìà: ðåøåíèå: 37.A>cmpad                             


                                                   

Ðèñ.4.2.1.2.(ïðîäîëæåíèå)



Áëîê-ñõåìà: ðåøåíèå: Amp2>Amp1                                                 


Áëîê-ñõåìà: ðåøåíèå: Sb=0                                                                                   


Áëîê-ñõåìà: ðåøåíèå: Pb=0

53.Îáíóëåíèå H:X

 
                                                                                      


63.Ñáðîñ Pb

 

66.Óñò Pb â 1

 
Áëîê-ñõåìà: ðåøåíèå: Cb=1                         


Ðèñ.4.2.1.2.(ïðîäîëæåíèå)



Áëîê-ñõåìà: ðåøåíèå: 74.Qb=1                                                  


Áëîê-ñõåìà: ðåøåíèå: 75.A>Ïð1                      

Áëîê-ñõåìà: ðåøåíèå: 76.A>Ïð2


                                 


Áëîê-ñõåìà: ðåøåíèå: 80.Sis=0                                                                     


Ðèñ.4.2.1.2.(ïðîäîëæåíèå)



Áëîê-ñõåìà: ðåøåíèå: Coco1=1                                                                                   


                            

Ðèñ.4.2.1.2.(ïðîäîëæåíèå)

4.2.2 ÁÑÀ îáðàáîò÷èêà ïðåðûâàíèÿ îò òàéìåðà

ÁÑÀ îáðàáîò÷èêà ïðåðûâàíèÿ îò òàéìåðà, ïðåäñòàâëåíà íà ðèñ.4.2.2.1. Äëÿ ïðàâèëüíîé ðàáîòû îáðàáîò÷èêà, íåîáõîäèìî ÷àñòîòó òàêòèðîâàíèÿ òàéìåðà ñäåëàòü ðàâíîé 125êÃö, ò.å. Fbus/8, à â ðåãèñòð ïåðèîäà çàãðóçèòü ÷èñëî 12499. Òîãäà ÷åðåç êàæäûå 0,1 S áóäåò âûçûâàòüñÿ îáðàáîò÷èê ïðåðûâàíèÿ îò òàéìåðà.

 íà÷àëå ïîäïðîãðàììû îáðàáîò÷èêà íåîáõîäèìî ñáðîñèòü ôëàã TOF(áë.1), èíà÷å â ïðîòèâíîì ñëó÷àå ñëåäóþùèé çàïðîñ íà ïðåðûâàíèå “ïîòåðÿåòñÿ”.

Ïîñëå òîãî, êàê ôëàã áóäåò ñáðîøåí, ïîäïðîãðàììà ïåðåõîäèò ê âûïîëíåíèþ áëîêà 2, â êîòîðîì îíà äåëàåò èíêðåìåíò ÿ÷åéêè ïàìÿòè Sec10(â íåé íàõîäÿòñÿ 10-å äîëè ñåêóíäû). Êàê òîëüêî Sec10 ñòàíåò ðàâíûì 9-è (áë.3), ïðîèñõîäèò î÷èñòêà, ò.å. îáíóëåíèå, Sec10 (áë.4) è äåëàåòñÿ èíêðèìåíò ÿ÷åéêè ïàìÿòè Sec (â êîòîðîé íàõîäÿòñÿ öåëûå ñåêóíäû).

 áëîêàõ 6,7 ïðîèñõîäèò îòñ÷¸ò âðåìåíè äî 2-õ ìèíóò, ïîñëå ÷åãî óñòàíàâëèâàåòñÿ áèò Dvb(áë.8), êîòîðûé êîíòðîëèðóåò âðåìÿ íàõîæäåíèÿ â ïðîãðàììû â öèêëå (áë.30,31,29) ñì. ðèñ.4.2.1.2.



Ðèñ.4.2.2.1.

4.2.3 ÁÑÀ îáðàáîò÷èêà ïðåðûâàíèé îò ÀÖÏ

ÁÑÀ îáðàáîò÷èêà ïðåðûâàíèé îò ÀÖÏ ïðåäñòàâëåííà íà ðèñ.4.2.3.1.

Áèò ab (áë.1) îïðåäåëÿåò àíàëîãîâûé âõîä ÀÖÏ, èëè ÐÒÂ0, èëè ÐÒÂ1. Ðàññìîòðèì ñëó÷àé êîãäà àíàëîãîâûì âõîäîì ÿâëÿåòñÿ ëèíèÿ ÐÒÂ0, ò.å. ab=0.

 áëîêå 2 îïðåäåëÿåòñÿ, áûë ëè ðàíåå ó ÀÖÏ àíàëîãîâûé âõîä ÐÒÂ0:

1.  Åñëè íå áûë (ab2=0), òî ïðîèñõîäèò ñáðîñ áèòà ab1, êîòîðûé âûïîëíÿåò àíàëîãè÷íóþ ôóíêöèþ, òîëüêî ïîêàçûâàåò, áûë ëè ðàíåå ó ÀÖÏ, àíàëîãîâûé âõîä ÐÒÂ1. Ïîñëå ÷åãî ïðîèñõîäèò óñòàíîâêà áèòà ab2 â 1 (áë.4), è çàïóñê ÀÖÏ ñ àíàëîãîâûì âõîäîì ÐÒÂ0 (áë.7). Äàëåå ïðîãðàììà âûõîäèò èç îáðàáîò÷èêà.

2.  Åñëè áûë (ab2=1), òî â áëîêå 5 óñòàíàâëèâàåòñÿ áèò ÑÎÑÎ1, ñèãíàëèçèðóþùèé î òîì, ÷òî ïðåîáðàçîâàíèå çàâåðøåíî, ïîñëå ÷åãî ðåçóëüòàò èç ðåãèñòðà äàííûõ ÀÖÏ ïåðåíîñèòñÿ â ÿ÷åéêó ïàìÿòè Upress, è ïðîèñõîäèò çàïóñê ÀÖÏ ñ àíàëîãîâûì âõîäîì ÐÒÂ0 (áë.7). Ïîñëå ÷åãî ïðîãðàììà âûõîäèò èç îáðàáîò÷èêà.

 ñëó÷àå êîãäà àíàëîãîâûì âõîäîì ÿâëÿåòñÿ ëèíèÿ ÐÒÂ1 (ab=1), âñ¸ ïðîèñõîäèò àíàëîãè÷íî.

Áèò ab2 è ab1 íåîáõîäèìû äëÿ êîððåêòíîé ðàáîòû ïîäïðîãðàììû. Òî åñòü, åñëè àíàëîãîâûì âõîäîì ÿâëÿåòñÿ ëèíèÿ ÐÒÂ0, òî ïðè ñìåíå àíàëîãîâîãî âõîäà íà ÐÒÂ1, ïåðâûé ðåçóëüòàò ïðåîáðàçîâàíèÿ îêàæåòñÿ ëîæíûì, îí íå áóäåò ñîîòâåòñòâîâàòü çíà÷åíèþ ñèãíàëà íà âõîäå ÐÒÂ1. Ïîýòîìó ÷òîáû ýòîãî íå ñëó÷èëîñü, ââîäÿòñÿ áèòû ab2 è ab1.

3.Ñáðîñ Ab1

 

5.Óñò. ÑÎÑÎ1 â 1

 

9.Ñáðîñ Ab2

 

11.Óñò.ÑÎÑÎ â 1

 

4.Óñò. Ab2 â 1

 

6.ADRUpress

 

10.Óñò. Ab1 â 1

 

12.ADRUpress1

 

Ïîäïèñü: 7.Çàïóñê ÀÖÏ (ÐÒÂ0)

RTI

 


Ðèñ.4.2.3.1.

4.2.4 ÁÑÀ ïîäïðîãðàììû òàáëè÷íîé ïåðåêîäèðîâêè íàïðÿæåíèå â äàâëåíèå.

ÁÑÀ ïîäïðîãðàììû òàáëè÷íîé ïåðåêîäèðîâêè íàïðÿæåíèÿ â äàâëåíèå ïðåäñòàâëåííà íà ðèñ. 4.2.4.1.

 íà÷àëå ïîäïðîãðàììû ïðîèñõîäèò ñîõðàíåíèå ðåãèñòðîâ CPU â ñòåêå (áë.1). Äàëåå ïðîèñõîäèò âû÷èñëåíèå èñòèííîãî äàâëåíèÿ(áë.2), ïîñëå ÷åãî ðåçóëüòàò ïðîäåëàííîé îïåðàöèè çàíîñèòñÿ â Udav (áë.3).  áëîêå 4 ïðîèñõîäèò çàãðóçêà ÷èñëà â ðåãèñòð Õ, çàòåì ñëåäóåò êîìàíäà òàáëè÷íîé ïåðåêîäèðîâêè ( áë.5), ãäå TCP – íà÷àëî òàáëèöû ïåðåêîäèðîâêè. Ïîñëå ÷åãî, â áëîêå 6, ïåðåêîäèðîâàííîå ÷èñëî çàíîñèòñÿ â Udav, â áëîêå 7 âîññòàíàâëèâàþòñÿ èç ñòåêà ðåãèñòðû CPU, è ïðîãðàììà âûõîäèò èç îáðàáîò÷èêà.

1.Çàãðóçèòü â ñòåê ðåãèñòðû CPU

 

2.Udav  - CONST

 

3.Ðåç.Udav

 

4.UdavX

 

5.LDA TCP,X

 

6.ADav

 

RTS

 


Ðèñ.4.2.4.1.


4.2.5 ÁÑÀ ïîäïðîãðàììû âûâîäà ÷èñëà íà èíäèêàöèþ

ÁÑÀ âûâîäà ÷èñëà íà èíäèêàöèþ ïðåäñòàâëåíà íà ðèñ.4.2.5.1.

 ÿ÷åéêó ïàìÿòè ci çàíîñèòñÿ ÷èñëî (áë.2) ðàâíîå êîë-âó öèôð âûâîäèìûõ íà èíäèêàòîð.

 áëîêå 5 ïðîèñõîäèò çàãðóçêà ÷èñëà äëÿ òàáëè÷íîé ïåðåêîäèðîâêè, â ðåãèñòð Õ. Ïîñëå ÷åãî â áë.6 ñëåäóåò êîìàíäà òàáëè÷íîé ïåðåêîäèðîâêè ÷èñëà äëÿ èíäèêàöèè, ãäå TCI – ýòî íà÷àëî êîäîâîé òàáëèöû. Ïîñëå ýòîé êîìàíäû, ïðîèñõîäèò ïåðåäâèæåíèå ïî ÿ÷åéêàì BCDxxx.

 áëîêàõ 8,9 ïðîèñõîäèò çàïèñü ïåðåêîäèðîâàííîãî ÷èñëà â îäíó èç ÿ÷ååê ïàìÿòè INDxxx, ïîñëå ÷åãî â áëîêå 10 èä¸ò ïåðåäâèæåíèå ïî ÿ÷åéêàì INDxxx.

 áëîêå 11 ïðîèñõîäèò íàñòðîéêà èíäèêàòîðà íà ïðè¸ì àäðåñà, ïîñëå ÷åãî â áëîêå 12 àäðåñ ïåðåäà¸òñÿ â èíäèêàòîð, êîòîðûé ñòðîáèðóåòñÿ èìïóëüñîì îáðàçîâàííûì áëîêàìè 13-15. Ïîñëå ýòîãî ñëåäóåò çàäåðæêà 30 ìêÑ, â òå÷åíèè êîòîðîé èíäèêàòîð âûïîëíÿåò, ñâîè âíóòðåííèå îïåðàöèè.

Êàê òîëüêî çàäåðæêà îêîí÷èëàñü, â áë.17,18 èíäèêàòîð íàñòðàèâàåòñÿ íà ïðè¸ì äàííûõ, è äàëåå ïðîèñõîäèò ïåðåäà÷à äàííûõ (áë.19), êîòîðûå ñòðîáèðóþòñÿ èìïóëüñîì îáðàçîâàííûì áëîêàìè 20-22. Ïîñëå ÷åãî â áëîêå 23 ïðîèñõîäèò çàäåðæêà, ïîñëå êîòîðîé äåêðåìåíòèðóåòñÿ ÿ÷åéêà ïàìÿòè ci, â áëîêàõ 25-27 ïðîèñõîäèò ïîäãîòîâêà äëÿ âûâîäà ñëåäóþùåãî ÷èñëà íà èíäèêàöèþ, è â áë.28 ïðîâåðÿåòñÿ, åñëè ci 0, òî ïîäïðîãðàììà ïåðåõîäèò ê âûïîëíåíèþ áë.6 è âñ¸ íà÷èíàåòñÿ çàíîâî. Åñëè ci=0, òî ïðîãðàììà âûõîäèò èç îáðàáîò÷èêà.



Ðèñ.4.2.5.1.



Ðèñ.4.2.5.1.(ïðîäîëæåíèå)

4.2.6 ÁÑÀ ïîäïðîãðàììû ïåðåâîäà ÷èñëà â BCD ôîðìàò

ÁÑÀ ïîäïðîãðàììû ïåðåâîäà ÷èñëà â BCD ôîðìàò ïðåäñòàâëåíà íà ðèñ.4.2.6.1.

 íà÷àëå ïîäïðîãðàììû, ðåãèñòðû CPU ñîõðàíÿþòñÿ â ñòåêå.  áëîêå 1 ïðîèñõîäèò ïðîâåðêà:

1.  Åñëè ÷èñëî áîëüøå 99, òî â áëîêå 3 ïðîèñõîäèò äåëåíèå ÷èñëà íà 100, â ðåçóëüòàòå ýòîé îïåðàöèè, öåëîå ÷àñòíîå ïîìåùàåòñÿ â àêêóìóëÿòîð, à îñòàòîê äåëåíèÿ â ðåãèñòð H. Öåëîå ÷àñòíîå – ýòî ñîòíè ÷èñëà, ïîýòîìó îíè çàíîñÿòñÿ â ÿ÷åéêó ïàìÿòè BCD100 (áë.4), ïîñëå ÷åãî îñòàòîê çàãðóæàåòñÿ â àêêóìóëÿòîð (áë.5), è äåëèòñÿ íà 10 (áë.6).  ðåçóëüòàòå ýòîé îïåðàöèè, â àêêóìóëÿòîðå ïîëó÷àþòñÿ äåñÿòêè ÷èñëà, êîòîðûå çàíîñÿòñÿ â BCD10 (áë.7), à îñòàòîê ÷èñëà ïîêàçûâàåò åäèíèöû è çàíîñèòñÿ â BCD1 (áë.8).

2.  Åñëè ÷èñëî ìåíüøå 99, òî îíî ïðîâåðÿåòñÿ â áëîêå 2, åñëè îíî ìåíüøå 9, òî â ÿ÷åéêó ïàìÿòè BCD100,BCD10 çàïèñûâàåòñÿ êîä ïðîáåëà (áë. 11,12), ïîñëå ÷åãî äàííîå ÷èñëî çàïèñûâàåòñÿ â BCD1 (áë.13). Åñëè îíî áîëüøå 9, òî ÷èñëî çàïèñûâàåòñÿ â àêêóìóëÿòîð (áë.9), â ÿ÷åéêó ïàìÿòè BCD100 çàïèñûâàåòñÿ êîä ïðîáåëà, ïîñëå ÷åãî ïðîèñõîäèò äåëåíèå ÷èñëà íà 10 (áë.6) è äàëåå âñ¸ ïðîèñõîäèò êàê â ïóíêòå 1, òîëüêî íà÷èíàÿ ñ áëîêà 6.

3. 


Ðèñ.4.2.6.1.


5. Ïðèíöèïèàëüíàÿ ñõåìà óñòðîéñòâà

Ïðèíöèïèàëüíàÿ ñõåìà óñòðîéñòâà èçîáðàæåíà íà ðèñ.5.1.


Çàêëþ÷åíèå

Îáðàòèòå âíèìàíèå íà ïðèíöèïèàëüíóþ ñõåìó ïðèáîðà, â íåé êàê âèäíî ìèíèìóì ýëåìåíòîâ. Ýòî îáúÿñíÿåòñÿ ïðèìåíåíèåì â ñõåìå, ìèêðîêîíòðîëëåðà. Ïðè÷åì âñ¸ èçìåðåíèå îñóùåñòâëÿåòñÿ â ïîëóàâòîìàòè÷åñêîì ðåæèìå è ïðîèñõîäèò â ìèêðîêîíòðîëëåðå. Òåì ñàìûì ïîëüçîâàòåëü ïðèêëàäûâàåò ìèíèìóì óñèëèé äëÿ èçìåðåíèÿ ñâîåãî äàâëåíèÿ.

Òàêèì îáðàçîì ïðèìåíåíèå ìèêðîïðîöåññîðíûõ ñèñòåì â óñòðîéñòâàõ ðàçëè÷íîãî òèïà, ïîçâîëÿåò ñîêðàòèòü êîë-âî ýëåìåíòîâ â ñõåìå, ñäåëàòü óñòðîéñòâî áîëåå êà÷åñòâåííûì, à òàêæå ïîçâîëÿåò îñóùåñòâèòü íàèáîëåå “äðóæåëþáíûé” èíòåðôåéñ ñ ïîëüçîâàòåëåì.

Ïðîãðàììà äëÿ äàííîãî óñòðîéñòâà áûëà íàïèñàíà íà àññåìáëåðå CASM08, îòòðàíñëèðîâàííà è îòëàæåíà íà ICS08JL, ëèñòèíã ïðîãðàììû ïðèâåä¸í â ïðèëîæåíèè.


Ñïèñîê ëèòåðàòóðû

1.  Ïàíôèëîâ Ä.È. Äàò÷èêè ôèðìû MOTOROLA. Ìîñêâà. ÄÎÄÝÊÀ. 2000. 96 ñ.

2.  ÁÝÊ. Æèäêîêðèñòàëè÷åñêèå èíäèêàòîðû ôèðìû DATA INTERNATIONAL. Ìîñêâà. 1999. 64 ñ.

3.  Technical Data. MC68HC908JL3.

4.  Technical Data. MPX5050DP.


Ïðèëîæåíèå

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 1

0000                   1  PTA     equ     $0

 0000                   2  PTB     equ     $1

 0000                   3  PTD     equ     $3

 0000                   4  DDRA    equ     $4

 0000                   5  DDRB    equ     $5

 0000                   6  DDRD    equ     $7

 0000                   7  PDCR    equ     $A

 0000                   8  PTAPUE  equ     $D

 0000                   9  KBSCR   equ     $1A

 0000                  10  KBIER   equ     $1B

 0000                  11  CONFIG2 equ     $1E

 0000                  12  CONFIG1 equ     $1F

 0000                  13  TSC     equ     $20

 0000                  14  TCNTH   equ     $21

 0000                  15  TCNTL   equ     $22

 0000                  16  TMODH   equ     $23

 0000                  17  TMODL   equ     $24

 0000                  18  ADSCR   equ     $3C

 0000                  19  ADR     equ     $3D

 0000                  20  ADICLK  equ     $3E

                       21 

                       22 

                       23 

 0080                  24          org     $80     ;ÎÇÓ

                       25 

 0080                  26  ind     rmb     3

 0083      01          27  adres   db      1

 0084      01          28  BCD100  db      1

 0085      01          29  BCD10   db      1

 0086      01          30  BCD1    db      1

 0087      01          31  indx    db      1

 0088      01          32  ci      db      1

 0089      01          33  bitf    db      1

 008A      01          34  upress1 db      1

 008B      01          35  upress  db      1

 008C      01          36  udav    db      1

 008D      01          37  const   db      1

 008E      01          38  dav     db      1

 008F      01          39  y       db      1

 0090      01          40  pulse   db      1

 0091      01          41  bitf1   db      1

 0092      01          42  cmp1    db      1

 0093      01          43  del     db      1

 0094      01          44  por     db      1

 0095      01          45  ovsec   db      1

 0096      01          46  cmpad   db      1

 0097      01          47  amp2    db      1

 0098      01          48  amp1    db      1

 0099      01          49  sec     db      1

 009A      01          50  sec10   db      1

 009B      01          51  time1   db      1

 009C      01          52  time2   db      1

 009D      01          53  time3   db      1

 009E      01          54  pr1     db      1

 009F      01          55  sis     db      1

 00A0      01          56  pr2     db      1

 00A1      01          57  dia     db      1

 00A2      01          58  pul     db      1

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 2

 00A3      01          59  bcdx    db      1

 00A4      01          60  pmem1   db      1

                       61 

 EC00                  62          org     $ec00   ;ïðîãðàììà

                       63 

                       64  start:

                       65  ;--------------------------- Èíèöèàëèçàöèÿ -----

                       66 

 EC00 [01] 4F          67          clra

 EC01 [01] 5F          68          clrx

                       69 

 EC02 [04] 6EFF07      70          mov     #$ff,DDRD ;Íàñòðàèâàåì ëèíèè

                                                      ïîðòà PTD íà âûâîä

 EC05 [04] 6E1C05      71          mov     #$1c,DDRB ;Íàñòðàèâàåì ëèíèè

                                                      ÐÒÂ2,ÐÒÂ3,ÐÒÂ4 íà âûâîä

                       72 

                       73  ;Èíèöèàëèçàöèÿ èíäèêàòîðà

                       74 

 EC08 [04] 1501        75          bclr    2,PTB

 EC0A [04] 1701        76          bclr    3,PTB

 EC0C [04] 6E0603      77          mov     #$6,PTD  ;Óñòàíîâêà ðåæèìà ââîäà

                                                                         

 EC0F [04] 1801        78          bset    4,PTB    ;Ôîðìèðîâàíèå

                                                     ñòðîáèðóþùåãî èìïóëüñà

 EC11 [01] 9D          79          nop

 EC12 [01] 9D          80          nop

 EC13 [01] 9D          81          nop

 EC14 [01] 9D          82          nop

 EC15 [01] 9D          83          nop

 EC16 [04] 1901        84          bclr    4,PTB

 EC18 [05] CDEF08      85          jsr     deleysret

 EC1B [04] 6E3803      86          mov     #$38,PTD ;Óñòàíîâêà âûïîëíÿåìûõ

ôóíêöèé

 EC1E [04] 1801        87          bset    4,PTB    ;Ôîðìèðîâàíèå

                                                     ñòðîáèðóþùåãî èìïóëüñà

 EC20 [01] 9D          88          nop

 EC21 [01] 9D          89          nop

 EC22 [01] 9D          90          nop

 EC23 [01] 9D          91          nop

 EC24 [01] 9D          92          nop

 EC25 [04] 1901        93          bclr    4,PTB

 EC27 [05] CDEF08      94          jsr     deleysret ;Çàäåðæêà 30 ìêÑ

 EC2A [04] 6E0803      95          mov     #$8,PTD

 EC2D [04] 1801        96          bset    4,PTB     ;Ôîðìèðîâàíèå

                                                      ñòðîáèðóþùåãî èìïóëüñà

 EC2F [01] 9D          97          nop

 EC30 [01] 9D          98          nop

 EC31 [01] 9D          99          nop

 EC32 [01] 9D         100          nop

 EC33 [01] 9D         101          nop

 EC34 [04] 1901       102          bclr    4,PTB

 EC36 [05] CDEF08     103          jsr     deleysret ;Çàäåðæêà 30 ìêÑ

                      104 

                      105  ;---------------------------------------------

                      106 

                      107  main:

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 3

 EC39 [02] A628       108          lda     #!40

 EC3B [02] AE80       109          ldx     #$80

                      110  sbm:

 EC3D [02] 7F         111          clr     ,X      ; Îáíóëåíèå ÿ÷ååê ïàìÿòè

 EC3E [01] 5C         112          incx

 EC3F [01] 4A         113          deca

 EC40 [03] 26FB       114          bne     sbm

 EC42 [04] 6E5994     115          mov     #!89,por

 EC45 [04] 6E089E     116          mov     #!8,pr1 ;Ïîðîã äëÿ ñèñòîëè÷å

                                                                          ñêîãî

 EC48 [04] 6E0DA0     117          mov     #!13,pr2;Ïîðîã äëÿ äèàñòîëè÷åñêîãî

                      118 

 EC4B [02] 9A         119          cli             ;Ðàçðåøàåì ïðåðûâàíèÿ

                      120 

 EC4C [04] 6E403C     121          mov     #$40,ADSCR ;Çàïóñê ÀÖÏ âõîä ÐÒÂ0

 EC4F [05] 0789FD     122          brclr   3,bitf,$

 EC52 [04] 1789       123          bclr    3,bitf

 EC54 [05] 4E8B8D     124          mov     upress,const

                      125 

                      126  ;--------------------------- ÈÍÄÈÊÀÖÈß ñèñ,äèà,ïóë

                      127 

 EC57 [04] 6E0B84     128          mov     #!11,bcd100  ;$34 - êîä áóêâû "C"

 EC5A [04] 6E0C85     129          mov     #!12,bcd10

 EC5D [04] 6E0B86     130          mov     #!11,bcd1

 EC60 [04] 6E0083     131          mov     #$0,adres

 EC63 [05] CDEEC1     132          jsr     IND_RET      ;Âûâîä íà èíäèêàöèþ

 EC66 [04] 6E0D84     133          mov     #!13,bcd100  ;Âûâîä "ÄÈÀ"

 EC69 [04] 6E0C85     134          mov     #!12,bcd10

 EC6C [04] 6E0E86     135          mov     #!14,bcd1

 EC6F [04] 6E4083     136          mov     #$40,adres

 EC72 [05] CDEEC1     137          jsr     IND_RET

 EC75 [04] 6E0F84     138          mov     #!15,bcd100  ;Âûâîä "ÏÓË"

 EC78 [04] 6E1085     139          mov     #!16,bcd10

 EC7B [04] 6E1186     140          mov     #!17,bcd1

 EC7E [04] 6E4983     141          mov     #$49,adres

 EC81 [05] CDEEC1     142          jsr     IND_RET

                      143 

                      144  ;----------------------------------------------

                      145 

                      146 

                      147  ;---------- ÈÍÄÈÊÀÖÈß 0 â ðàçäåëå ñèñ ------------------------------;

                      148 

 EC84 [04] 6E0A84     149          mov     #$a,bcd100      ;Ñèìâîë ïðîáåëà

 EC87 [04] 6E0A85     150          mov     #$a,bcd10

 EC8A [04] 6E0386     151          mov     #$03,bcd1       ;Ñèìâîë "0"

 EC8D [04] 6E4683     152          mov     #$46,adres      ;Çàïèñü àäðåñà

 EC90 [05] CDEEC1     153          jsr     IND_RET

 EC93 [04] 1501       154          bclr    2,PTB

 EC95 [04] 1701       155          bclr    3,PTB

 EC97 [04] 6E0C03     156          mov     #$c,PTD         ;Âêëþ÷èòü äèñïëåé

                      157 


òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 4

                      158 

                      159  ;-------------------------------------------------

                      160 

 EC9A [05] 4E8B92     161          mov     upress,cmp1

                      162 

                      163  ;- Ïðîöåäóðà îæèäàíèÿ îêîí÷àíèÿ íàêà÷êè ìàíæåòû --

                      164 

                      165  ;- Çàäåðæêà 0.7 ñåêóíäû ñ èíäèêàöèåé òåêóùåãî äàâëåíèÿ --------

                      166 

                      167  loop:

 EC9D [04] 6E0093     168          mov     #$0,del

                      169  loop2:

 ECA0 [01] 4F         170          clra

 ECA1 [04] C7FFFF     171          sta     $ffff       ;Ñáðîñ WDOG

                      172  loop1:

 ECA4 [01] 4A         173          deca

 ECA5 [03] 26FD       174          bne     loop1       ;Åñëè àêêóìóëÿòîð=0 òî

 ïåðåõîä íà loop1

 ECA7 [05] 4E8B8C     175          mov     upress,udav ;êîä íàïðÿæåíèÿ ñ äàò÷èêà çàíîñèì â udav

 ECAA [03] 450000     176          ldhx    #$0

 ECAD [05] CDEE74     177          jsr     VOLTS_PRESSURE_RET ;Âûçîâ ïîäïðîãðàììû ïåðåêîäèðîâêè íàïðÿæåíèå â äàâëåíèå

 ECB0 [05] 4E8E8F     178          mov     dav,y

 ECB3 [05] CDEE85     179          jsr     BCD_RET

 ECB6 [04] 6E0483     180          mov     #$04,adres ;çàíåñòè àäðåñ íà÷àëà èíäèêàöèè

 ECB9 [05] CDEEC1     181          jsr     IND_RET

 ECBC [04] 3A93       182          dec     del

 ECBE [03] 26E0       183          bne     loop2    ;Åñëè del=0 òî ïåðåõîä íà loop2

 ECC0 [05] 069104     184          brset   3,bitf1,lop ;Åñëè 3 áèò=0 òî çàäåðæêà ïðîèñõîäèò ñíîâà

 ECC3 [04] 1691       185          bset    3,bitf1     ;Óñòàíîâèòü 3 áèò â 1

 ECC5 [03] 20D6       186          bra     loop        ;Ïåðåõîä íà loop

                      187  lop:

 ECC7 [04] 1789       188          bclr    3,bitf      ;Ñáðîñèòü 3 áèò â 1

                      189 

                      190  ;-------------------------------------------------

 ECC9 [04] C7FFFF     191          sta     $ffff

 ECCC [03] B68B       192          lda     upress     ;Çàãðóæàåì upress â àêêóìóëÿòîð äëÿ ñðàâíåíèÿ

 ECCE [03] B192       193          cmp     cmp1       ;ñ cmp1

 ECD0 [03] 2502       194          blo     ampmet     ;Åñëè À>cmp1, òî

íàêà÷êà ìàíæåòû âñ¸ åù¸ èäåò

 ECD2 [03] 20C9       195          bra     loop       ;ïîýòîìó ïåðåõîäèì íà loop

                      196 

                      197  ;------- Îïðåäåëåíèå àìïëèòóäû -------------------

                      198 

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 5

                      199  ampmet:

 ECD4 [04] C7FFFF     200          sta     $ffff

 ECD7 [04] 1089       201          bset    0,bitf     ;Óñòàíàâëèâàåì àíàëîãîâûé âõîä ÐÒÂ1

 ECD9 [04] 6E3023     202          mov     #$30,TMODH ;Èíèöèàëèçàöèÿ

òàéìåðà, ïåðèîä ñ÷¸òà äî 12499

 ECDC [04] 6ED324     203          mov     #$d3,TMODL ; ÷àñòîòà òàêòèðîâàíèÿ 125000 Ãö

 ECDF [04] 6E4320     204          mov     #$43,TSC   ;Çàïóñê òàéìåðà

                      205  dvbm:

 ECE2 [04] C7FFFF     206          sta     $ffff

 ECE5 [05] 0A8902     207          brset   5,bitf,rm  ;Åñëè öèêë ïðîäîëæàåòñÿ áîëüøå 5 ñåêóíä

 ECE8 [03] 2003       208          bra     m55        ;òî âûâîäèì ñîîáùåíèå îá îøèáêè

                      209  rm:

 ECEA [03] CCEDFC     210          jmp     rorm

                      211  m55:

 ECED [03] B68A       212          lda     upress1

 ECEF [03] B194       213          cmp     por        ;Ñðàíèâàåì upress1 c ïîðîãîì por

 ECF1 [03] 25EF       214          blo     dvbm       ;Åñëè upress1<por òî ïåðåõîäèì íà dvbm

 ECF3 [03] 3F95       215          clr     ovsec      ;Ñáðîñ OVsec

 ECF5 [05] 4E8A96     216          mov     upress1,cmpad   ;-----------------------------

                      217  loopamp:

 ECF8 [04] C7FFFF     218          sta     $ffff           ;-----------------

 ECFB [04] 1989       219          bclr    4,bitf          ;-----------------

 ECFD [05] 0989FD     220          brclr   4,bitf,$        ;Èäåíòèôèêàöèÿ

àìïëèòóäû

 ED00 [03] B68A       221          lda     upress1         ;-----------------

 ED02 [03] B196       222          cmp     cmpad           ;-----------------

 ED04 [03] 22F2       223          bhi     loopamp        ;Åñëè upress1>cmpad

òî ïåðåõîäèì íà loopamp

                      224 

                      225  ;---------- Ñáðîñ è ïåðåçàïóñê òàéìåðà -----------

                      226 

 ED06 [04] 1A20       227          bset    5,TSC

 ED08 [04] 1820       228          bset    4,TSC

 ED0A [04] 6E4320     229          mov     #$43,TSC

                      230 

                      231  ;-------------------------------------------------

                      232 

 ED0D [05] 4E9697     233          mov     cmpad,amp2      ; amp2 íàõîäèòñÿ    çíà÷åíèå àìïëèòóäû

 ED10 [04] 1189       234          bclr    0,bitf          ;Óñòàíàâëèâàåì   àíàëîãîâûé âõîä ÐÒÂ0

 ED12 [04] 1789       235          bclr    3,bitf          ;Îáíóëÿåì áèò ÑÎÑÎ1

 ED14 [05] 0789FD     236          brclr   3,bitf,$        ;Åñëè ÑÎÑÎ1=0 òî

çàöèêëåâàåìñÿ

 ED17 [05] 4E8B8C     237          mov     upress,udav     ;Êîä íàïðÿæåíèÿ ñ

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 6

                                                                 äàò÷èêà â udav

 ED1A [04] 1089       238          bset    0,bitf          ;Óñòàíàâëèâàåì

                                                           àíàëîãîâûé âõîä ÐÒÂ1

 ED1C [04] 3C90       239          inc     pulse           ;Â pulse êîë-âî

àìïëèòóä

 ED1E [03] B697       240          lda     amp2

 ED20 [03] B198       241          cmp     amp1

 ED22 [03] 220B       242          bhi     proim           ;Åñëè amp2>amp1 òî

ïåðåõîä íà proim

 ED24 [05] 4E98A4     243          mov     amp1,pmem1      ;-----------------

 ED27 [05] 4E9798     244          mov     amp2,amp1       ;Ìåíÿåì ìåñòàìè

                                                           amp2 ñ amp1

 ED2A [05] 4EA497     245          mov     pmem1,amp2      ;-----------------

 ED2D [04] 1E89       246          bset    7,bitf          ;Óñòàíàâëèâàåì â 1

                                                            áèò cb

                      247 

                      248  ;--- Ïðîöåäóðà âû÷èñëåíèÿ ïðîèçâîäíîé àìïëèòóäû --

                      249  proim:

 ED2F [04] C7FFFF     250          sta     $ffff

 ED32 [05] 00913E     251          brset   0,bitf1,mtime   ;Åñëè âõîä â

ïðîöåäóðó 2-îé ðàç òî ïåðåõîä íà mtime

 ED35 [04] 1091       252          bset    0,bitf1      ;Óñòàíàâëèâàåì sb â 1

 ED37 [03] BE99       253          ldx     sec

 ED39 [02] A60A       254          lda     #!10

 ED3B [05] 42         255          mul                  ;Óìíîæàåì sec íà 10

 ED3C [01] 8C         256          clrh

 ED3D [01] 5F         257          clrx

 ED3E [03] BB9A       258          add     sec10        ;Ðåçóëüòàò óìíîæåíèÿ

ñêëàäûâàåì ñ sec10,

                      259                               ;ïîëó÷àåì âðåìÿ èìïóëüñà

 ED40 [03] B79B       260          sta     time1        ;Âðåìÿ èìïóëüñà

                                                         çàíîñèì â time1

                      261  cbm:

 ED42 [05] 0F8908     262          brclr   7,bitf,perem ;Åñëè amp2 è amp1

                                                         ìåíÿëèñü ìåñòàìè òî

 ED45 [04] 1F89       263          bclr    7,bitf       ;ìåíÿåì èõ îáðàòíî

 ED47 [05] 4E97A4     264          mov     amp2,pmem1   ;-------------------

 ED4A [05] 4E9897     265          mov     amp1,amp2    ;-------------------                                                         

                      266  perem:

 ED4D [05] 4E9798     267          mov     amp2,amp1    ;amp2 çàíîñèì â amp1

                      268 

                      269  ;- Çàäåðæêà ñ èíäèêàöèåé òåêóùåãî äàâëåíèÿ 0.3 ñåêóíäû ---------------------;

                      270 

                      271 

 ED50 [04] 6E0093     272          mov     #$0,del

                      273  loop20:

 ED53 [01] 4F         274          clra

 ED54 [04] C7FFFF     275          sta     $ffff           ;Ñáðîñ WDOG

                      276  loop11:

 ED57 [01] 4A         277          deca

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 7

ED58 [03] 26FD       278          bne     loop11

 ED5A [05] 4E8B8C     279          mov     upress,udav

 ED5D [03] 450000     280          ldhx    #$0

 ED60 [05] CDEE74     281          jsr     VOLTS_PRESSURE_RET;Âûçîâ  ïîäïðîãðàììû ïåðåêîäèðîâêè íàïðÿæåíèå â äàâëåíèå

 ED63 [05] 4E8E8F     282          mov     dav,y

 ED66 [05] CDEE85     283          jsr     BCD_RET

 ED69 [04] 6E0483     284          mov     #$04,adres  ;çàíåñòè àäðåñ íà÷àëà èíäèêàöèè

 ED6C [05] CDEEC1     285          jsr     IND_RET

 ED6F [04] 3A93       286          dec     del

 ED71 [03] 26E0       287          bne     loop20

                      288 

                      289 

                      290 

291  ;---------------------------------------------

292 

                      293  mtime:

 ED73 [04] C7FFFF     294          sta     $ffff

 ED76 [03] BE99       295          ldx     sec

 ED78 [02] A60A       296          lda     #!10

 ED7A [05] 42         297          mul                   ;sec óìíîæàåì íà 10

 ED7B [03] BB9A       298          add     sec10         ;sec10+ðåçóëüòàò

                                                          óìíîæåíèÿ

 ED7D [05] 039108     299          brclr   1,bitf1,time2m  ;Åñëè pb=0 òî

                                                          ïåðåõîäèì íà time2m

 ED80 [03] B79B       300          sta     time1           ;Âðåìÿ èìïóëüñà â

                                                            time1

 ED82 [03] B09C       301          sub     time2           ;Âû÷èòàåì èç

                                                          time1,time2

 ED84 [04] 1391       302          bclr    1,bitf1         ;Îáíóëÿåì pb

 ED86 [03] 2006       303          bra     raznom

                      304  time2m:

 ED88 [03] B79C       305          sta     time2           ;Âðåìÿ èìïóëüñà â

                                                            time2

 ED8A [03] B09B       306          sub     time1           ;Âû÷èòàåì èç

                                                          time2,time1

 ED8C [04] 1291       307          bset    1,bitf1         ;Óñòàíàâëèâàåì pb

                      308  raznom:

 ED8E [03] B79D       309          sta     time3          ;Ðàçíîñòü âðåìåíè â

                                                                    Time3

 ED90 [03] B697       310          lda     amp2            ;-------------------

                                                                         ------

 ED92 [03] B098       311          sub     amp1           ;Âû÷èñëÿåì ðàçíîñòü  àìïëèòóä ðåç. â àêêóìóëÿòîðå

 ED94 [02] AE0A       312          ldx     #!10            ;Ðàçíîñòü àìïëèòóä

                                                         óìíîæàåì íà 10

 ED96 [05] 42         313          mul                     ;-------------------

                                                                  -------------

 ED97 [03] BFA4       314          stx     pmem1

 ED99 [04] 55A4       315          ldhx    pmem1

 ED9B [03] BE9D       316          ldx     time3

 ED9D [07] 52         317          div         ;Ðàçíîñòü àìïëèòóä óìíîæåííàÿ íà 10 äåëèì íà time3

                      318                      ;â ðåçóëüòàòå ïîëó÷àåì ïðîèçâîäíóþ àìïëèòóä

                      319 

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 8

                      320  ;--------------------- Ïðîöåäóðà îïðåäåëåíèÿ

                                   äàâëåíèÿ ----------------------------------;

                      321 

 ED9E [05] 049109     322          brset   2,bitf1,pr2m    ;Åñëè qb=1 òî

ïåðåõîäèì íà pr2m

 EDA1 [03] B19E       323          cmp     pr1             ;pr1 - ïîðîã äëÿ

                                                      ñèñòîëè÷åñêîãî äàâëåíèÿ

 EDA3 [03] 2505       324          blo     pr2m            ;Åñëè ïðîèçâîäíàÿ

                                                ìåíüøå pr1 òî ïåðåõîä íà pr2m

 EDA5 [05] 4E8C9F     325          mov     udav,sis        ;Çàíîñèì çíà÷åíèå

                                                             äàâëåíèÿ â sis

 EDA8 [04] 1489       326          bset    2,bitf         ;Óñòàíàâëèâàåì qb â

                                                            1

                      327  pr2m:

 EDAA [04] C7FFFF     328          sta     $ffff

 EDAD [03] B1A0       329          cmp     pr2             ;pr2 - ïîðîã äëÿ

                                                     äèàñòîëè÷åñêîãî äàâëåíèÿ

 EDAF [03] 2591       330          blo     cbm             ;Åñëè ïðîèçâîäíàÿ

                                                 ìåíüøå pr2 òî ïåðåõîä íà cbm

 EDB1 [05] 4E8CA1     331          mov     udav,dia        ;Çíà÷åíèå äàâëåíèÿ

                                                            çàíîñèì â dia

 EDB4 [02] A600       332          lda     #!0

 EDB6 [03] B19F       333          cmp     sis

 EDB8 [03] 2342       334          bls     rorm            ;Åñëè sis=<0 òî

                                                            ïåðåõîäèì íà rorm

 EDBA [02] A63C       335          lda     #!60        ;Âû÷èñëÿåì óñðåäí¸ííîå çíà÷åíèå ïóëüñà

 EDBC [03] BE99       336          ldx     sec             ;-----------------

 EDBE [07] 52         337          div                     ;-----------------

 EDBF [03] BE90       338          ldx     pulse           ;-----------------

 EDC1 [05] 42         339          mul                     ;-----------------

 EDC2 [03] B7A2       340          sta     pul             ;-----------------

                      341 

                      342  ;--------------------- Èíäèêàöèÿ äàâëåíèÿ è ïóëüñà

                                           -----------------------------------;

                      343 

 EDC4 [04] C7FFFF     344          sta     $ffff

 EDC7 [05] 4E9F8C     345          mov     sis,udav     ;Âûâîä ñèñòîëè÷åñêîãî äàâëåíèÿ

 EDCA [05] CDEE74     346          jsr     VOLTS_PRESSURE_RET ;Âûçîâ

ïîäïðîãðàììû ïåðåêîäèðîâêè íàïðÿæåíèå â äàâëåíèå

 EDCD [05] 4E8E8F     347          mov     dav,y

 EDD0 [05] CDEE85     348          jsr     BCD_RET

 EDD3 [04] 6E0483     349          mov     #$04,adres   ;çàíåñòè àäðåñ íà÷àëà èíäèêàöèè

 EDD6 [05] CDEEC1     350          jsr     IND_RET

                      351 

 EDD9 [05] 4EA18C     352          mov     dia,udav   ;Âûâîä äèàñòîëè÷åñêîãî äàâëåíèÿ

 EDDC [05] CDEE74     353          jsr     VOLTS_PRESSURE_RET ;Âûçîâ 

ïîäïðîãðàììû ïåðåêîäèðîâêè íàïðÿæåíèå â äàâëåíèå

 EDDF [05] 4E8E8F     354          mov     dav,y

 EDE2 [05] CDEE85     355          jsr     BCD_RET

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 9

 EDE5 [04] 6E4483     356          mov     #$44,adres    ;çàíåñòè àäðåñ íà÷àëà èíäèêàöèè

 EDE8 [05] CDEEC1     357          jsr     IND_RET

                      358 

 EDEB [04] C7FFFF     359          sta     $ffff

 EDEE [05] 4EA28F     360          mov     pul,y         ;Âûâîä ïóëüñà

 EDF1 [05] CDEE85     361          jsr     BCD_RET

 EDF4 [04] 6E4D83     362          mov     #$4d,adres    ;çàíåñòè àäðåñ íà÷àëà èíäèêàöèè

 EDF7 [05] CDEEC1     363          jsr     IND_RET

 EDFA [03] 2022       364          bra     exitdav

                      365  rorm:

 EDFC [04] 1501       366          bclr    2,PTB

 EDFE [04] 1701       367          bclr    3,PTB

 EE00 [04] 6E0103     368          mov     #$1,PTD     ;Î÷èñòêà                                                             äèñïëåÿ

 EE03 [04] 6E1284     369          mov     #!18,bcd100              ; "O"

 EE06 [04] 6E1385     370          mov     #!19,bcd10               ; "Ø"

 EE09 [04] 6E0C86     371          mov     #!12,bcd1                ; "È"

 EE0C [04] 6E0583     372          mov     #$5,adres

 EE0F [05] CDEEC1     373          jsr     IND_RET

 EE12 [04] 6E1484     374          mov     #!20,bcd100              ; "Á"

 EE15 [04] 6E1585     375          mov     #!21,bcd10               ; "Ê"

 EE18 [04] 6E0E86     376          mov     #!14,bcd1                ; "À"

 EE1B [05] CDEEC1     377          jsr     IND_RET

                      378  exitdav:

                      379 

                      380  ;------ Ïðîâåðêà ñïóùåíà ìàíæåòà èëè íåò ---------

 EE1E [04] C7FFFF     381          sta     $ffff

 EE21 [04] 1189       382          bclr    0,bitf

 EE23 [04] 1789       383          bclr    3,bitf

 EE25 [05] 0789FD     384          brclr   3,bitf,$  ;Åñëè COCO1=0 ïðîèñõîäèò çàöèêëåâàíèå

 EE28 [03] B68B       385          lda     upress

 EE2A [02] A105       386          cmp     #!5

 EE2C [03] 22F0       387          bhi     exitdav

 EE2E [03] CCEC39     388          jmp     main

                      389 

                      390  ;------------------------------------------------;

                      391 

                      392 

                      393 

                      394 

                      395 

                      396  ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                      397 

                      398 

                      399  ADC_INT:   ; îáðàáîò÷èê ïðåðûâàíèÿ îò ÀÖÏ

 EE31 [02] 8B         400                  pshh

 EE32 [05] 018913     401                  brclr   0,bitf,adm1 ;åñëè àâ=0

òî ïåðåõîä íà adm1

 EE35 [05] 038907     402                  brclr   1,bitf,adm2 ;ïåðåõîä åñëè àâ1=0

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 10

EE38 [04] 1889       403                  bset    4,bitf

 EE3A [05] 4E3D8A     404                  mov     ADR,upress1

 EE3D [03] 2004       405                  bra     zap

                      406  adm2:

 EE3F [04] 1589       407                  bclr    2,bitf          ;ñáðîñ àâ2

 EE41 [04] 1289       408                  bset    1,bitf          ;óñò. àâ1

                      409  zap:

 EE43 [04] 6E413C     410                  mov     #$41,ADSCR     ;êîìàíäà

çàïóñêà ÀÖÏ âõîä PTB1

                      411 

 EE46 [03] 2011       412                  bra     exit

                      413  adm1:

 EE48 [05] 058907     414                  brclr   2,bitf,adm3   ;ïåðåõîä  åñëè àâ2=0

 EE4B [04] 1689       415                  bset    3,bitf

 EE4D [05] 4E3D8B     416                  mov     ADR,upress

 EE50 [03] 2004       417                  bra     zap1

                      418  adm3:

 EE52 [04] 1389       419                  bclr    1,bitf         ; ñáðîñ àâ1

 EE54 [04] 1489       420                  bset    2,bitf         ; óñò. àâ2

                      421  zap1:

 EE56 [04] 6E403C     422                  mov     #$40,ADSCR    ;êîìàíäà

çàïóñêà ÀÖÏ âõîä PTB0

                      423  exit:

 EE59 [02] 8A         424                  pulh

 EE5A [07] 80         425                  rti

                      426 

                      427 

                      428 

                      429  ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                      430 

                      431  timer_int:       ;Îáðàáîò÷è ïðåðûâàíèÿ îò òàéìåðà

 EE5B [04] 1F20       432                  bclr    7,TSC      ;Ñáðîñ TOF

 EE5D [04] 3C9A       433                  inc     sec10

 EE5F [03] B69A       434                  lda     sec10

 EE61 [02] A109       435                  cmp     #$9

 EE63 [03] 250E       436                  blo     exittime   ;Åñëè sec10>9 òî ïåðõîäà íåò

 EE65 [03] 3F9A       437                  clr     sec10

 EE67 [04] 3C99       438                  inc     sec

 EE69 [04] 3C95       439                  inc     ovsec

 EE6B [03] B695       440                  lda     ovsec

 EE6D [02] A105       441                  cmp     #!5

 EE6F [03] 2502       442                  blo     exittime

 EE71 [04] 1A89       443                  bset    5,bitf

                      444  exittime:

 EE73 [07] 80         445                  rti

                      446 

                      447 

                      448  ;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

                      449 

                      450 

                      451  VOLTS_PRESSURE_RET:    ;ïîäïðîãðàììà òàáëè÷íîé ïåðåêîäèðîâêè íàïð. â äàâëåíèå

                      452                         ;÷èñëî äëÿ ïåðåêîäèð


òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 11

                      453                             ;íà÷àëî òàáëèöû -TCP

 EE74 [02] 87         454                  psha

 EE75 [02] 8B         455                  pshh

 EE76 [02] 89         456                  pshx

                      457 

 EE77 [03] B68C       458                  lda     udav

 EE79 [03] B08D       459                  sub     const   ;const- íàïðÿæåíèå

                                                         ïðè íóëåâîì äàâëåíèè

 EE7B [01] 97         460                  tax

 EE7C [04] D6EF14     461                  lda     TCP,x

 EE7F [03] B78E       462                  sta     dav     ;ïåðåêîäèðîâàííîå

                                                           ÷èñëî â dav

                      463 

 EE81 [02] 88         464                  pulx

 EE82 [02] 8A         465                  pulh

 EE83 [02] 86         466                  pula

 EE84 [04] 81         467                  rts

                      468 

                      469 

                      470 

                      471 

                      472  ;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

                      473 

                      474 

                      475 

                      476 

                      477  BCD_RET: ;ïîäïðîãðàììà ïåðåâîäà ÷èñëà â BCD ôîðìàò

                      478               ;÷èñëî äëÿ ïåðåâîäà íàõîäèòñÿ â "y"

                      479                                  ;BCD100 - ñîòíè

                      480                                  ;BCD10 - äåñÿòêè

                      481                                  ;BCD1 - åäèíèöû

                      482 

 EE85 [02] 87         483                  psha

 EE86 [02] 8B         484                  pshh

 EE87 [02] 89         485                  pshx

                      486 

 EE88 [03] B68F       487                  lda     y          ;Äåëèìîå â

                                                               àêêóìóëÿòîð

 EE8A [02] A163       488                  cmp     #!99

 EE8C [03] 2206       489                  bhi     bcd100m    ;åñëè y>99 òî ïåðåõîä íà bcd100m

 EE8E [02] A109       490                  cmp     #!9

 EE90 [03] 2210       491                  bhi     bcd10m     ;åñëè y>9 òî ïåðåõîä íà bcd10m

 EE92 [03] 2020       492                  bra     bcd1m

                      493  bcd100m:

 EE94 [02] AE64       494                  ldx     #!100      ;100-äåëèòåëü

 EE96 [07] 52         495                  div

 EE97 [03] B784       496                  sta     BCD100     ;Ðåçóëüòàò â BCD100

 EE99 [04] 35A4       497                  sthx    pmem1

 EE9B [03] 450000     498                  ldhx    #!0

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 12

EE9E [03] B6A4       499                  lda     pmem1     ;Îñòàòîê â

                                                             àêêóìóëÿòîð

 EEA0 [03] 2003       500                  bra     mb1

                      501  bcd10m:

 EEA2 [04] 6E0A84     502                  mov     #$a,BCD100 ;Ïðîáåë â BCD100

                      503  mb1:

 EEA5 [02] AE0A       504                  ldx     #!10        ;10-äåëèòåëü

 EEA7 [07] 52         505                  div                 ;Äåëèì îñòàòîê íà 10

 EEA8 [03] B785       506                  sta     BCD10       ;Ðåçóëüòàò â BCD10

 EEAA [04] 35A4       507                  sthx    pmem1

 EEAC [03] 450000     508                  ldhx    #!0

 EEAF [05] 4EA486     509                  mov     pmem1                                   BCD1

 EEB2 [03] 200C       510                  bra     exitb

                      511  bcd1m:

 EEB4 [04] 6E0A84     512                  mov     #$a,BCD100      ;Ïðîáåë â      BCD100

 EEB7 [04] 6E0A85     513                  mov     #$a,BCD10       ;Ïðî         BCD10

 EEBA [05] 4E8F86     514                  mov     y,BCD1

                      515 

                      516 

 EEBD [02] 88         517                  pulx

 EEBE [02] 8A         518                  pulh

 EEBF [02] 86         519                  pula

 EEC0 [04] 81         520  exitb:          rts

                      521 

                      522 

                      523 

                      524 

                      525 

                      526  ;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

                      527 

                      528 

                      529 

                      530  IND_RET:   ;Ïîäïðîãðàììà äëÿ âûâîäà ÷èñëà íà èíäèêàöèþ

                      531             ;äëÿ ïîäïðîãðàììû íåîáõîäèìî:

                      532             ;- ÷èñëî èëè ñèìâîë äëÿ èíäèêàöèè

                      533                                          ;(BCD100,BCD

                                                                       10,BCD1)

                      534              ;- àäðåñ ÿ÷åéêè â èíäèêàòîðå

 EEC1 [02] 87         535                  psha

 EEC2 [02] 8B         536                  pshh

 EEC3 [02] 89         537                  pshx

                      538 

 EEC4 [04] 6E0388     539                  mov     #$3,ci

 EEC7 [04] 6E8087     540                  mov     #$80,indx   ;çàìåñòî ind ïîñòàâèòü àäðåñ!!!!!!!!!!!!!!!!!

 EECA [04] 6E84A3     541                  mov     #$84,bcdx   ;àäðåñ bcd100 â bcdx

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 13

EECD [03] BE84       542                  ldx     BCD100

                      543  stind:

 EECF [04] D6EFAE     544                  lda     TCI,x  ;TCI-íà÷àëîòàáëèöû ïåðåêîäèðîâêè

 EED2 [04] 3CA3       545                  inc     BCDX

 EED4 [03] BE87       546                  ldx     indx

 EED6 [02] F7         547                  sta     ,x    ;Ðåçóëüòàò ïåðåêîäèðîâêè â ÿ÷åéêó ïàìÿòè ñ                       ðåãèñòðå Õ

 EED7 [04] 3C87       548                  inc     indx   ;ïåðåäâåãàåìñÿ ïî ÿ÷åéêàì IND

 EED9 [04] 1501       549                  bclr    2,PTB            ;óñò. â 0

                                                                           PTB2

 EEDB [04] 1701       550                  bclr    3,PTB

 EEDD [05] 4E8303     551                  mov     adres,PTD        ;Àäðåñ

çíàêîìåñòà â ïîðò PTD

 EEE0 [04] 1801       552                  bset    4,PTB

 EEE2 [01] 9D         553                  nop

 EEE3 [01] 9D         554                  nop

 EEE4 [01] 9D         555                  nop       ;Ôîðìèðîâàíèå ñòðîáèðóþùåãî èìïóëüñà

 EEE5 [01] 9D         556                  nop

 EEE6 [01] 9D         557                  nop

 EEE7 [04] 1901       558                  bclr    4,PTB

 EEE9 [04] AD1D       559                  bsr     deleysret ;çàäåðæêà 30mkc

 EEEB [04] 1401       560                  bset    2,PTB

 EEED [04] 1701       561                  bclr    3,PTB

 EEEF [04] 7E03       562                  mov     x+,PTD    ;Âûâîä ÷èñëà íà èíäèêàöèþ

 EEF1 [04] 1801       563                  bset    4,PTB

 EEF3 [01] 9D         564                  nop

 EEF4 [01] 9D         565                  nop      ;Ôîðìèðîâàíèå ñòðîáèðóþùåãî èìïóëüñà

 EEF5 [01] 9D         566                  nop

 EEF6 [01] 9D         567                  nop

 EEF7 [01] 9D         568                  nop

 EEF8 [04] 1901       569                  bclr    4,PTB

 EEFA [04] AD0C       570                  bsr     deleysret ;çàäåðæêà 30mkc

 EEFC [04] 3C83       571                  inc     adres     ;Ïîäãîòîâêà

                                                     ê ñëåäóþùåìó öèêëó

 EEFE [03] BEA3       572                  ldx     BCDX             ;----

 EF00 [02] FE         573                  ldx     ,x               ;--------

 EF01 [05] 3B88CB     574                  dbnz    ci,stind   ;Åñëè âñå ÷èñëà âûâåäåíû òî âûõîäèì èç ïîäðîãðàììû

                      575 

 EF04 [02] 88         576                  pulx

 EF05 [02] 8A         577                  pulh

 EF06 [02] 86         578                  pula

 EF07 [04] 81         579                  rts

                      580 

                      581  ;\\\\\\ Ïîäïðîãðàììà çàäåðæêè íà 30 ìêÑ\\\\\\\\\\\

                      582 

                      583  deleysret:

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 14

                      584 

                      585 

                      586 

 EF08 [02] 87         587                  psha

 EF09 [02] 8B         588                  pshh

 EF0A [02] 89         589                  pshx

                      590 

 EF0B [02] A61E       591                  lda     #!30

                      592  loopdel:

 EF0D [01] 4A         593                  deca

 EF0E [03] 26FD       594                  bne     loopdel

                      595 

 EF10 [02] 88         596                  pulx

 EF11 [02] 8A         597                  pulh

 EF12 [02] 86         598                  pula

 EF13 [04] 81         599                  rts

                      600 

                      601  ;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

                      602 

                      603  ;/////Òàáëèöà ïåðåêîäèðîâêè äëÿ äàâëåí ////////

                      604 

                      605  TCP:

                      606 

 EF14      00         607                  db      !0

 EF15      01         608                  db      !1

 EF16      03         609                  db      !3

 EF17      05         610                  db      !5

 EF18      06         611                  db      !6

 EF19      08         612                  db      !8

 EF1A      0A         613                  db      !10

 EF1B      0B         614                  db      !11

 EF1C      0D         615                  db      !13

 EF1D      0F         616                  db      !15

 EF1E      10         617                  db      !16

 EF1F      12         618                  db      !18

 EF20      14         619                  db      !20

 EF21      15         620                  db      !21

 EF22      17         621                  db      !23

 EF23      19         622                  db      !25

 EF24      1A         623                  db      !26

 EF25      1C         624                  db      !28

 EF26      1E         625                  db      !30

 EF27      1F         626                  db      !31

 EF28      21         627                  db      !33

 EF29      23         628                  db      !35

 EF2A      24         629                  db      !36

 EF2B      26         630                  db      !38

 EF2C      28         631                  db      !40

 EF2D      29         632                  db      !41

 EF2E      2B         633                  db      !43

 EF2F      2D         634                  db      !45

 EF30      2E         635                  db      !46

 EF31      30         636                  db      !48

 EF32      32         637                  db      !50

 EF33      33         638                  db      !51

 EF34      35         639                  db      !53

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 15

EF35      37         640                  db      !55

 EF36      38         641                  db      !56

 EF37      3A         642                  db      !58

 EF38      3C         643                  db      !60

 EF39      3D         644                  db      !61

 EF3A      3F         645                  db      !63

 EF3B      41         646                  db      !65

 EF3C      42         647                  db      !66

 EF3D      44         648                  db      !68

 EF3E      46         649                  db      !70

 EF3F      47         650                  db      !71

 EF40      49         651                  db      !73

 EF41      4B         652                  db      !75

 EF42      4C         653                  db      !76

 EF43      4E         654                  db      !78

 EF44      50         655                  db      !80

 EF45      51         656                  db      !81

 EF46      53         657                  db      !83

 EF47      55         658                  db      !85

 EF48      56         659                  db      !86

 EF49      58         660                  db      !88

 EF4A      5A         661                  db      !90

 EF4B      5B         662                  db      !91

 EF4C      5D         663                  db      !93

 EF4D      5F         664                  db      !95

 EF4E      60         665                  db      !96

 EF4F      62         666                  db      !98

 EF50      64         667                  db      !100

 EF51      65         668                  db      !101

 EF52      67         669                  db      !103

 EF53      69         670                  db      !105

 EF54      6A         671                  db      !106

 EF55      6C         672                  db      !108

 EF56      6E         673                  db      !110

 EF57      6F         674                  db      !111

 EF58      71         675                  db      !113

 EF59      73         676                  db      !115

 EF5A      74         677                  db      !116

 EF5B      76         678                  db      !118

 EF5C      78         679                  db      !120

 EF5D      79         680                  db      !121

 EF5E      7B         681                  db      !123

 EF5F      7D         682                  db      !125

 EF60      7E         683                  db      !126

 EF61      80         684                  db      !128

 EF62      82         685                  db      !130

 EF63      83         686                  db      !131

 EF64      85         687                  db      !133

 EF65      87         688                  db      !135

 EF66      88         689                  db      !136

 EF67      8A         690                  db      !138

 EF68      8C         691                  db      !140

 EF69      8D         692                  db      !141

 EF6A      8F         693                  db      !143

 EF6B      91         694                  db      !145

 EF6C      92         695                  db      !146

 EF6D      94         696                  db      !148

 EF6E      96         697                  db      !150

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 16

 EF6F      97         698                  db      !151

 EF70      99         699                  db      !153

 EF71      9B         700                  db      !155

 EF72      9C         701                  db      !156

 EF73      9E         702                  db      !158

 EF74      A0         703                  db      !160

 EF75      A1         704                  db      !161

 EF76      A3         705                  db      !163

 EF77      A5         706                  db      !165

 EF78      A6         707                  db      !166

 EF79      A8         708                  db      !168

 EF7A      AA         709                  db      !170

 EF7B      AB         710                  db      !171

 EF7C      AD         711                  db      !173

 EF7D      AF         712                  db      !175

 EF7E      B0         713                  db      !176

 EF7F      B2         714                  db      !178

 EF80      B4         715                  db      !180

 EF81      B5         716                  db      !181

 EF82      B7         717                  db      !183

 EF83      B9         718                  db      !185

 EF84      BA         719                  db      !186

 EF85      BC         720                  db      !188

 EF86      BE         721                  db      !190

 EF87      BF         722                  db      !191

 EF88      C1         723                  db      !193

 EF89      C3         724                  db      !195

 EF8A      C4         725                  db      !196

 EF8B      C6         726                  db      !198

 EF8C      C8         727                  db      !200

 EF8D      C9         728                  db      !201

 EF8E      CB         729                  db      !203

 EF8F      CD         730                  db      !205

 EF90      CE         731                  db      !206

 EF91      D0         732                  db      !208

 EF92      D2         733                  db      !210

 EF93      D3         734                  db      !211

 EF94      D5         735                  db      !213

 EF95      D7         736                  db      !215

 EF96      D8         737                  db      !216

 EF97      DA         738                  db      !218

 EF98      DC         739                  db      !220

 EF99      DD         740                  db      !221

 EF9A      DF         741                  db      !223

 EF9B      E1         742                  db      !225

 EF9C      E2         743                  db      !226

 EF9D      E4         744                  db      !228

 EF9E      E6         745                  db      !230

 EF9F      E7         746                  db      !231

 EFA0      E9         747                  db      !233

 EFA1      EB         748                  db      !235

 EFA2      EC         749                  db      !236

 EFA3      EE         750                  db      !238

 EFA4      F0         751                  db      !240

 EFA5      F1         752                  db      !241

 EFA6      F3         753                  db      !243

 EFA7      F5         754                  db      !245

 EFA8      F6         755                  db      !246

òîíîìåòð.asm Assembled with CASM08Z 25.02.03 9:58:45 PAGE 17

EFA9      F8         756                  db      !248

 EFAA      FA         757                  db      !250

 EFAB      FB         758                  db      !251

 EFAC      FD         759                  db      !253

 EFAD      FF         760                  db      !255

                      761 

                      762 

                      763  ;//////////////////////////////////////////////

                      764 

                      765  ;////////// Òàáëèöà ïåðåêîäèðîâêè äëÿ èíäèêàöèè //

                      766 

                      767  TCI:

 EFAE      03         768                 db       $03       ;0

 EFAF      13         769                 db       $13       ;1

 EFB0      23         770                 db       $23       ;2

 EFB1      33         771                 db       $33       ;3

 EFB2      43         772                 db       $43       ;4

 EFB3      53         773                 db       $53       ;5

 EFB4      63         774                 db       $63       ;6

 EFB5      73         775                 db       $73       ;7

 EFB6      83         776                 db       $83       ;8

 EFB7      93         777                 db       $93       ;9

 EFB8      02         778                 db       $02       ;Ïðîáåë

 EFB9      34         779                 db       $34       ;Ñ

 EFBA      5A         780                 db       $5a       ;È

 EFBB      0E         781                 db       $0e       ;Ä

 EFBC      14         782                 db       $14       ;À

 EFBD      8A         783                 db       $8a       ;Ï

 EFBE      9A         784                 db       $9a       ;Ó

 EFBF      7A         785                 db       $7a       ;Ë

 EFC0      F4         786                 db       $f4       ;Î

 EFC1      CA         787                 db       $ca       ;Ø

 EFC2      0A         788                 db       $0a       ;Á

 EFC3      B4         789                 db       $b4       ;Ê

                      790 

                      791  ;///////////////////////////////////////////////////

                                        ///////////////////////////////////////

                      792 

                      793 

 FFDE                 794                  org     $ffde

 FFDE      EE31       795                  dw      ADC_INT  ;Âåêòîðïðåðûâàíèÿ

                                                             äëÿ ÀÖÏ

 FFF2                 796                  org     $fff2

 FFF2      EE5B       797                  dw      timer_int;Âåêòîðïðåðûâàíèÿ

                                                            äëÿ òàéìåðà

 FFFE                 798                  org     $fffe

 FFFE      EC00       799                  dw      start   ;Âåêòîð ñáðîñà

                      800  

Symbol Table

ADC_INT          EE31

ADICLK           003E

ADM1             EE48

ADM2             EE3F

ADM3             EE52

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 18

ADR              003D

ADRES            0083

ADSCR            003C

AMP1             0098

AMP2             0097

AMPMET           ECD4

BCD1             0086

BCD10            0085

BCD100           0084

BCD100M          EE94

BCD10M           EEA2

BCD1M            EEB4

BCDX             00A3

BCD_RET          EE85

BITF             0089

BITF1            0091

CBM              ED42

CI               0088

CMP1             0092

CMPAD            0096

CONFIG1          001F

CONFIG2          001E

CONST            008D

DAV              008E

DDRA             0004

DDRB             0005

DDRD             0007

DEL              0093

DELEYSRET        EF08

DIA              00A1

DVBM             ECE2

EXIT             EE59

EXITB            EEC0

EXITDAV          EE1E

EXITTIME         EE73

IND              0080

INDX             0087

IND_RET          EEC1

KBIER            001B

KBSCR            001A

LOOP             EC9D

LOOP1            ECA4

LOOP11           ED57

LOOP2            ECA0

LOOP20           ED53

LOOPAMP          ECF8

LOOPDEL          EF0D

LOP              ECC7

M55              ECED

MAIN             EC39

MB1              EEA5

MTIME            ED73

OVSEC            0095

PDCR             000A

PEREM            ED4D

PMEM1            00A4

POR              0094

PR1              009E

òîíîìåòð.asm           Assembled with CASM08Z  25.02.03  9:58:45  PAGE 19

PR2              00A0

PR2M             EDAA

PROIM            ED2F

PTA              0000

PTAPUE           000D

PTB              0001

PTD              0003

PUL              00A2

PULSE            0090

RAZNOM           ED8E

RM               ECEA

RORM             EDFC

SBM              EC3D

SEC              0099

SEC10            009A

SIS              009F

START            EC00

STIND            EECF

TCI              EFAE

TCNTH            0021

TCNTL            0022

TCP              EF14

TIME1            009B

TIME2            009C

TIME2M           ED88

TIME3            009D

TIMER_INT        EE5B

TMODH            0023

TMODL            0024

TSC              0020

UDAV             008C

UPRESS           008B

UPRESS1          008A

VOLTS_PRESSURE_R EE74

Y                008F

ZAP              EE43

ZAP1             EE56


 
© 2011 Îíëàéí êîëëåêöèÿ ðåôåðàòîâ, êóðñîâûõ è äèïëîìíûõ ðàáîò.