Changes for page API контроллеров AZ®
Last modified by Max on 2025/03/02 15:18
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -542,13 +542,13 @@ 542 542 543 543 {{code language="assembler"}} 544 544 ;------------------------------------------------------------- 545 -; получениеверсии прошивкиSTM32 -результатвR1ошибка545 +; getting STM32 firmware version - result in R1 R1=0 error 546 546 GTSTMV: MOV #AZ$CSR,R1 547 -1$: CLR (R1) ; Пошлемкоманду"Сброс"548 - TSTB (R1) ; Проверимготовностьконтроллера549 - BPL 1$ ; Еслинеготов,сбрасываемеще547 +1$: CLR (R1) ; Send "Reset" command 548 + TSTB (R1) ;Check controller readinessконтроллера 549 + BPL 1$ ; If not ready, reset again 550 550 mov #27,(R1) 551 - TST (R1)+ ; Проверяемнаошибку551 + TST (R1)+ ; Check for error 552 552 BMI 2$ 553 553 mov (R1),R1 554 554 return ... ... @@ -558,45 +558,45 @@ 558 558 {{/code}} 559 559 560 560 561 -== **030:Нетоперации**==561 +== 030: No operation == 562 562 563 - Основноеназначениеэтойкоманды-устанавливатьбитразрешенияпрерыванийотконтроллера.Командапередаетбитразрешенияпрерывания,которыйнаходитсяснейводномслове,ноневходитвеесостав(напоминаем,командарасполагаетсявбитахD0 - D5,абитразрешенияпрерываний-D6),всоответствующийтриггерконтроллераибольшеникакневлияетнапроцессывконтроллере.Управлениеэтимтриггеромработаетдажевсостоянии"Думаю,прошунемешать",иэтоглавнаяособенностькоманды"нетоперации".564 -\\ Командаимееткод0030.Посылка в CSRкода0130разрешитпрерыванияотконтроллера,посылкакода0030запретитих.Примернеприводитсявследствиетривиальностиего.563 +The main purpose of this command is to set the interrupt enable bit from the controller. The command transfers the interrupt enable bit, which is in the same word with it, but is not part of it (remember, the command is located in bits D0 - D5, and the interrupt enable bit is D6), to the corresponding trigger of the controller and does not affect the processes in the controller in any other way. Control of this trigger works even in the "Thinking, please do not interfere" state, and this is the main feature of the "no operation" command. 564 +\\The command has the code 0030. Sending the code 0130 to the CSR will enable interrupts from the controller, sending the code 0030 will disable them. An example is not given due to its triviality. 565 565 566 566 567 -= **Блоккомандработысэнергонезависимойпамятью**=567 += Command block for working with non-volatile memory = 568 568 569 - ИнтерфейспредоставляетлюбомуAZ-контроллерудоступк255словамэнергонезависимойпамяти,всекомандыустанавливаютбитготовностипозавершению.Этопозволяетсохранятьпользовательскиенастройкивэнергонезависимойпамяти,кпримеруэтоиспользуетсявAZБК-тамсохраняютсянастройкидляболеекомфортнойработыконтроллера.569 +The interface provides any AZ controller with access to 255 words of non-volatile memory, all commands set the ready bit upon completion. This allows you to save user settings in non-volatile memory, for example, this is used in AZBK ??- there are saved settings for more comfortable operation of the controller. 570 570 571 - Всекомандыэтогоблокаиспользуютбуферэнергонезависимойпамятидлясвоейработы.571 +All commands in this block use a non-volatile memory buffer for their operation. 572 572 573 -== **021:Cчитатьблокэнергонезависимойпамятивбуфер**==573 +== 021: Read non-volatile memory block into buffer == 574 574 575 575 (% class="wikigeneratedid" %) 576 - Кодкоманды021,даннаякомандавызываетчтениеблокаэнергонезависимойпамятивбуферэнергонезависимойпамяти.576 +Command code 021, this command causes a block of non-volatile memory to be read into the non-volatile memory buffer. 577 577 578 578 579 -== **022:Отдатьнашинусчитанныйблокэнергонезависимойпамятиизбуфера**==579 +== 022: Transfer the read block of non-volatile memory from the buffer to the bus == 580 580 581 581 (% class="wikigeneratedid" %) 582 - Кодкоманды022,даннаякомандаобеспечиваетпередачубуфераэнергонезависимойпамятиврегистрDRдлясчитывания.582 +Command code 022, this command ensures that the non-volatile memory buffer is transferred to the DR register for reading. 583 583 584 584 (% class="wikigeneratedid" %) 585 - Примерпрограммы585 +Example program 586 586 587 587 {{code language="assembler"}} 588 -AZ$CSR регистркомандисостояния(CSR)589 -AZ$DR регистрданных(DR)588 +AZ$CSR = 177220; command and status register (CSR) 589 +AZ$DR = 177222; data register (DR) 590 590 591 591 592 -; trap 50 - cбросAZ592 +; trap 50 - reset AZ 593 593 ; результат в R1 =0 ok 594 594 AZreset: MOV #AZ$CSR,R1 595 -1$: CLR (R1); Пошлемкоманду"Сброс"596 - TSTB (R1); Проверимготовностьконтроллера597 - BPL 1$; Еслинеготов,сбрасываемеще598 - разипроверяемснова599 - TST (R1); Проверимнаошибку,595 +1$: CLR (R1); Send the "Reset" command 596 + TSTB (R1); Check the controller readiness 597 + BPL 1$; If not ready, reset again 598 +; once and check again 599 + TST (R1); Check for an error, 600 600 BMI 0ERR$ 601 601 CLR R1 602 602 return ... ... @@ -605,30 +605,30 @@ 605 605 return 606 606 607 607 608 -; trap 54 - чтениеэнергонезависимойпамятиблока1 EEPROMвбуферсадресаADREEPROMMEM609 -; результатR3 -адрес,еслиR3=0ошибка610 -; статусчтениявR1 0 - ok611 -; 1 - размернесоответствуетсохраненному612 -; 2 - o шибкаверсии613 -; 3 - oшибкаконтрольной суммы608 +; trap 54 - reading non-volatile memory of block 1 EEPROM to the buffer from the address ADREEPROMMEM 609 +; result R3 - address, if R3=0 error 610 +; read status in R1 0 - ok 611 +; 1 - size does not match saved 612 +; 2 - version error 613 +; 3 - checksum error 614 614 ReadEEPROM: push R2 615 - call AZreset; сбросим615 + call AZreset; reset 616 616 tst R1 617 617 bne 0ERR$ 618 618 ; теперь читаем 619 619 MOV #AZ$CSR,R1 620 - mov #21,(R1); считатьблок1энергонезависимойпамятивбуфер621 -0$: TSTB (R1); проверяемрезультатвыполнения622 - BPL 0$; ждем623 - mov #22,(R1); отдатьнашинусчитанныйблокэнергонезависимойпамятиизбуфера624 -1$: TSTB (R1); проверяемрезультатвыполнения625 - BPL 1$; ждем626 - TST (R1)+; инкрементируем620 + mov #21,(R1); read block 1 of non-volatile memory into buffer 621 +0$: TSTB (R1); check execution result 622 + BPL 0$; wait 623 + mov #22,(R1); send read block of non-volatile memory from buffer to bus 624 +1$: TSTB (R1); check execution result 625 + BPL 1$; wait 626 + TST (R1)+; increment 627 627 mov #ADREEPROMMEM,R3 628 - mov #256.,R2; читаем256.слов;первоеслово-результатчтения629 -2$: mov (R1),(R3)+; читаемблоксловвпамять628 + mov #256.,R2; read 256. words; first word is reading result 629 +2$: mov (R1),(R3)+; read block of words into memory 630 630 sob R2,2$ 631 - mov #ADREEPROMMEM,R3; успешно631 + mov #ADREEPROMMEM,R3; successful 632 632 mov (R3),R1 633 633 br 0END$ 634 634 0ERR$: CLR R3 ... ... @@ -636,41 +636,39 @@ 636 636 return 637 637 {{/code}} 638 638 639 -очевидно, после считывания памяти необходимо проверить код результата в первом слове - см расшифровку кодов ошибок 640 -\\Примеры возвращаемых данных по командам 641 -\\последовательная подача команды 021 и затем 022 позволит считать 256. слов 642 -из энергонезависимой памяти 643 -**Внимание! **первое слово это будет статус успешности чтения 644 - 639 +obviously, after reading the memory, it is necessary to check the result code in the first word - see the decoding of error codes 640 +\\Examples of returned data for commands 641 +\\sequentially issuing the command 021 and then 022 will allow reading 256 words from non-volatile memory 642 +Attention! The first word will be the reading success status 645 645 646 646 * 0 - ok 647 -* 1 - размернесоответствуетсохраненному648 -* 2 - o шибкаверсии649 -* 3 - oшибкаконтрольной суммы645 +* 1 - size does not match saved 646 +* 2 - version error 647 +* 3 - checksum error 650 650 651 -== **023:Принятьсшинывбуферданныедляпоследующейзаписивбуфер**==649 +== 023: Receive data from the bus into the buffer for subsequent writing into the buffer == 652 652 653 - Кодкоманды023,даннаякомандапозволяетнаполнитьбуферэнергонезависимойпамяти651 +Command code 023, this command allows you to fill the non-volatile memory buffer 654 654 655 -== **024:Записатьизбуферавблокэнергонезависимойпамяти**==653 +== 024: Write from buffer to non-volatile memory block == 656 656 657 - Кодкоманды024,даннаякомандавызываетзаписьблокаэнергонезависимойпамятиизбуфераэнергонезависимойпамяти.655 +Command code 024, this command causes a non-volatile memory block to be written from the non-volatile memory buffer. 658 658 659 - Примерпрограммы657 +Example program 660 660 661 661 {{code language="assembler"}} 662 -AZ$CSR регистркомандисостояния(CSR)663 -AZ$DR регистрданных(DR)660 +AZ$CSR = 177220; Command and Status Register (CSR) 661 +AZ$DR = 177222; Data Register (DR) 664 664 665 665 666 -; trap 50 - cбросAZ664 +; trap 50 - reset AZ 667 667 ; результат в R1 =0 ok 668 668 AZreset: MOV #AZ$CSR,R1 669 -1$: CLR (R1); Пошлемкоманду"Сброс"670 - TSTB (R1); Проверимготовностьконтроллера671 - BPL 1$; Еслинеготов,сбрасываемеще672 - разипроверяемснова673 - TST (R1); Проверимнаошибку,667 +1$: CLR (R1); Send the "Reset" command 668 + TSTB (R1); Check the controller readiness 669 + BPL 1$; If not ready, reset again 670 +; once and check again 671 + TST (R1); Check for an error, 674 674 BMI 0ERR$ 675 675 CLR R1 676 676 return ... ... @@ -678,27 +678,27 @@ 678 678 COM R1 679 679 return 680 680 681 -; trap 55 - записьэнергонезависимойпамятиизбуферасадресаADREEPROMMEM в блок 1 EEPROM679 +; trap 55 - write non-volatile memory from the buffer at address ADREEPROMMEM в блок 1 EEPROM 682 682 WriteEEPROM: push R1 683 683 push R2 684 684 push R3 685 - call AZreset; сбросим683 + call AZreset; reset 686 686 tst R1 687 687 bne 0ERR$ 688 688 689 689 MOV #AZ$CSR,R1 690 - mov #23,(R1); командуемчтобудемписатьданныевбуфер691 -0$: TSTB (R1); проверяемрезультатвыполнения692 - BPL 0$; ждем693 - TST (R1)+; инкрементируем688 + mov #23,(R1);command that we will write data to the buffer 689 +0$: TSTB (R1); check the result of executio 690 + BPL 0$; wait 691 + TST (R1)+; increment 694 694 mov #ADREEPROMMEM+2,R3 695 - mov #255.,R2; пишем255.слов;первоесловопропускаем-результатчтения696 -1$: mov (R3)+,(R1); отдаемвконтроллер693 + mov #255.,R2; write 255. words; skip the first word - the result of reading 694 +1$: mov (R3)+,(R1); send to the controller 697 697 sob R2,1$ 698 - tst -(R1); декрементируем699 - mov #24,(R1); записатьизбуферавблок1энергонезависимойпамяти700 -2$: TSTB (R1); проверяемрезультатвыполнения701 - BPL 2$; ждем696 + tst -(R1); decrement 697 + mov #24,(R1); write from the buffer to block 1 of non-volatile memory 698 +2$: TSTB (R1); check the result of execution 699 + BPL 2$; we are waiting 702 702 br 0END$ 703 703 0ERR$: CLR R3 704 704 0END$: pop R3 ... ... @@ -707,23 +707,21 @@ 707 707 return 708 708 {{/code}} 709 709 710 -** Обращаювнимание**,призаписи,буферидетсразусданными,тенетпервогословасостатусом.708 +**Please note** that when recording, the buffer immediately comes with the data, i.e. there is no first word with the statu 711 711 712 712 713 713 714 -= БлоккоманддляработысRTCиNTP =712 += Block of commands for working with RTC and NTP = 715 715 716 - ВконтроллереAZ®есть2источникаполучениядаты-времени,первыйэтоRTCвстроенныйвSTM32,второйэточасывстекеTCP/IP.ЧасыRTCработаютавтономноприналичииустановленнойбатарейки2032.ЧасывстекеTCP/IPустанавливаютсянаоснованииданныхсNTP-сервера.714 +The AZ® controller has 2 sources of date-time, the first is the RTC built into the STM32, the second is the clock in the TCP/IP stack. The RTC clock works autonomously with a 2032 battery installed. The clock in the TCP/IP stack is set based on data from the NTP server. 717 717 718 718 719 -== Форматбуфераtimestamp (доступен по чтению) ==717 +== Buffer format timestamp (readable) == 720 720 721 -API контроллерасразуготовитвремявнескольких форматах,дабыегобылоудобноприменитьнасторонеPDP-11719 +The controller API immediately prepares time in several formats, so that it can be conveniently used on the PDP-11 side 722 722 723 723 {{info}} 724 -формат буфера даты-времени 725 -offset в восьмеричной системе - те слова 726 -формат буфера даты-времени 722 +datetime buffer format octal offset - those words datetime buffer format 727 727 \\[0]=rtc_rt11date(); 728 728 [2]=rt11 time 50Hz big word; 729 729 [4]=rt11 time 50Hz little word; ... ... @@ -741,47 +741,47 @@ 741 741 {{/info}} 742 742 743 743 744 -== Формат буфераSimpleIN (призаписи) ==740 +== SimpleIN buffer format (when writing) == 745 745 746 - форматмаксимальноупрощен,дляработысостороныPDP-11742 +the format is simplified as much as possible, for work with PDP-11 747 747 748 748 {{info}} 749 -offset ввосьмеричнойсистеме-теслова745 +offset in octal - those words 750 750 751 -[0]=year год,младшиедвецифры-те22ане2022(!)752 -[2]=month; месяц753 -[4]=day; день754 -[6]=wday; деньнедели=0неустановлен, 1-понедельник2 -вторникитд755 -[10]=hour; час756 -[12]=min; минута757 -[14]=sec; секунда747 +[0]=year, the lower two digits are 22 and not 2022(!) 748 +[2]=month; month 749 +[4]=day; day 750 +[6]=wday; day of the week =0 not set, 1 - Monday 2 - Tuesday etc. 751 +[10]=hour; hour 752 +[12]=min; minute 753 +[14]=sec; second 758 758 {{/info}} 759 759 760 760 761 -== **031:ПолучитьвремяизRTCвбуферtimestamp**==757 +== 031: Get time from RTC to timestamp buffer == 762 762 763 - Кодкоманды031,даннаякомандаиспользуетRTCчасыкакисточникзаполнениябуфераtimestamp759 +Command code 031, this command uses RTC clock as a source of filling the timestamp buffer 764 764 765 - Примерпрограммы:761 +Example program: 766 766 767 767 {{code language="assembler"}} 768 -; trap 61 - чтениеданныхчасовизавтономныхчасовRTC769 -; R3 - адресбуферакуданадосчитать770 -; результатвR3адрес,еслиуспешно. R3=0если ошибка764 +; trap 61 - reading clock data from autonomous RTC clock 765 +; R3 - buffer address where to read 766 +; result in R3 address if successful. R3=0 if error 771 771 GetDateFromRTC: push R0 772 772 push R1 773 773 push R2 774 - call AZreset; сбросим770 + call AZreset; reset 775 775 tst R1 776 776 bne G60ERR 777 777 MOV #AZ$CSR,R1 778 778 mov #31,(R1) 779 - br G60; идемтудаткдальшекододинаковый775 + br G60; let's go there because further code is the same 780 780 {{/code}} 781 781 782 -== **032:Получитьвремяизбуфераtimestamp**==778 +== 032: Get time from timestamp buffer == 783 783 784 - Кодкоманды032,даннаякомандаотдаетнашинусодержимоебуфераtimestamp780 +Command code 032, this command sends the contents of the timestamp buffer to the bus 785 785 786 786 {{code language="assembler"}} 787 787 ; работа с часами