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
-
... ... @@ -637,39 +637,38 @@ 637 637 {{/code}} 638 638 639 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 -\\Примеры возвращаемых данных по командам 641 -\\последовательная подача команды 021 и затем 022 позволит считать 256. слов 642 -из энергонезависимой памяти 643 -**Внимание! **первое слово это будет статус успешности чтения 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 644 644 645 645 * 0 - ok 646 -* 1 - размернесоответствуетсохраненному647 -* 2 - o шибкаверсии648 -* 3 - oшибкаконтрольной суммы645 +* 1 - size does not match saved 646 +* 2 - version error 647 +* 3 - checksum error 649 649 650 -== **023:Принятьсшинывбуферданныедляпоследующейзаписивбуфер**==649 +== 023: Receive data from the bus into the buffer for subsequent writing into the buffer == 651 651 652 - Кодкоманды023,даннаякомандапозволяетнаполнитьбуферэнергонезависимойпамяти651 +Command code 023, this command allows you to fill the non-volatile memory buffer 653 653 654 -== **024:Записатьизбуферавблокэнергонезависимойпамяти**==653 +== 024: Write from buffer to non-volatile memory block == 655 655 656 - Кодкоманды024,даннаякомандавызываетзаписьблокаэнергонезависимойпамятиизбуфераэнергонезависимойпамяти.655 +Command code 024, this command causes a non-volatile memory block to be written from the non-volatile memory buffer. 657 657 658 - Примерпрограммы657 +Example program 659 659 660 660 {{code language="assembler"}} 661 -AZ$CSR регистркомандисостояния(CSR)662 -AZ$DR регистрданных(DR)660 +AZ$CSR = 177220; Command and Status Register (CSR) 661 +AZ$DR = 177222; Data Register (DR) 663 663 664 664 665 -; trap 50 - cбросAZ664 +; trap 50 - reset AZ 666 666 ; результат в R1 =0 ok 667 667 AZreset: MOV #AZ$CSR,R1 668 -1$: CLR (R1); Пошлемкоманду"Сброс"669 - TSTB (R1); Проверимготовностьконтроллера670 - BPL 1$; Еслинеготов,сбрасываемеще671 - разипроверяемснова672 - 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, 673 673 BMI 0ERR$ 674 674 CLR R1 675 675 return ... ... @@ -677,27 +677,27 @@ 677 677 COM R1 678 678 return 679 679 680 -; trap 55 - записьэнергонезависимойпамятиизбуферасадресаADREEPROMMEM в блок 1 EEPROM679 +; trap 55 - write non-volatile memory from the buffer at address ADREEPROMMEM в блок 1 EEPROM 681 681 WriteEEPROM: push R1 682 682 push R2 683 683 push R3 684 - call AZreset; сбросим683 + call AZreset; reset 685 685 tst R1 686 686 bne 0ERR$ 687 687 688 688 MOV #AZ$CSR,R1 689 - mov #23,(R1); командуемчтобудемписатьданныевбуфер690 -0$: TSTB (R1); проверяемрезультатвыполнения691 - BPL 0$; ждем692 - 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 693 693 mov #ADREEPROMMEM+2,R3 694 - mov #255.,R2; пишем255.слов;первоесловопропускаем-результатчтения695 -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 696 696 sob R2,1$ 697 - tst -(R1); декрементируем698 - mov #24,(R1); записатьизбуферавблок1энергонезависимойпамяти699 -2$: TSTB (R1); проверяемрезультатвыполнения700 - 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 701 701 br 0END$ 702 702 0ERR$: CLR R3 703 703 0END$: pop R3 ... ... @@ -706,23 +706,21 @@ 706 706 return 707 707 {{/code}} 708 708 709 -** Обращаювнимание**,призаписи,буферидетсразусданными,тенетпервогословасостатусом.708 +**Please note** that when recording, the buffer immediately comes with the data, i.e. there is no first word with the statu 710 710 711 711 712 712 713 -= БлоккоманддляработысRTCиNTP =712 += Block of commands for working with RTC and NTP = 714 714 715 - Вконтроллере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. 716 716 717 717 718 -== Форматбуфераtimestamp (доступен по чтению) ==717 +== Buffer format timestamp (readable) == 719 719 720 -API контроллерасразуготовитвремявнескольких форматах,дабыегобылоудобноприменитьнасторонеPDP-11719 +The controller API immediately prepares time in several formats, so that it can be conveniently used on the PDP-11 side 721 721 722 722 {{info}} 723 -формат буфера даты-времени 724 -offset в восьмеричной системе - те слова 725 -формат буфера даты-времени 722 +datetime buffer format octal offset - those words datetime buffer format 726 726 \\[0]=rtc_rt11date(); 727 727 [2]=rt11 time 50Hz big word; 728 728 [4]=rt11 time 50Hz little word; ... ... @@ -740,47 +740,47 @@ 740 740 {{/info}} 741 741 742 742 743 -== Формат буфераSimpleIN (призаписи) ==740 +== SimpleIN buffer format (when writing) == 744 744 745 - форматмаксимальноупрощен,дляработысостороныPDP-11742 +the format is simplified as much as possible, for work with PDP-11 746 746 747 747 {{info}} 748 -offset ввосьмеричнойсистеме-теслова745 +offset in octal - those words 749 749 750 -[0]=year год,младшиедвецифры-те22ане2022(!)751 -[2]=month; месяц752 -[4]=day; день753 -[6]=wday; деньнедели=0неустановлен, 1-понедельник2 -вторникитд754 -[10]=hour; час755 -[12]=min; минута756 -[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 757 757 {{/info}} 758 758 759 759 760 -== **031:ПолучитьвремяизRTCвбуферtimestamp**==757 +== 031: Get time from RTC to timestamp buffer == 761 761 762 - Кодкоманды031,даннаякомандаиспользуетRTCчасыкакисточникзаполнениябуфераtimestamp759 +Command code 031, this command uses RTC clock as a source of filling the timestamp buffer 763 763 764 - Примерпрограммы:761 +Example program: 765 765 766 766 {{code language="assembler"}} 767 -; trap 61 - чтениеданныхчасовизавтономныхчасовRTC768 -; R3 - адресбуферакуданадосчитать769 -; результатв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 770 770 GetDateFromRTC: push R0 771 771 push R1 772 772 push R2 773 - call AZreset; сбросим770 + call AZreset; reset 774 774 tst R1 775 775 bne G60ERR 776 776 MOV #AZ$CSR,R1 777 777 mov #31,(R1) 778 - br G60; идемтудаткдальшекододинаковый775 + br G60; let's go there because further code is the same 779 779 {{/code}} 780 780 781 -== **032:Получитьвремяизбуфераtimestamp**==778 +== 032: Get time from timestamp buffer == 782 782 783 - Кодкоманды032,даннаякомандаотдаетнашинусодержимоебуфераtimestamp780 +Command code 032, this command sends the contents of the timestamp buffer to the bus 784 784 785 785 {{code language="assembler"}} 786 786 ; работа с часами