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
-
... ... @@ -505,24 +505,24 @@ 505 505 ;.................................. 506 506 {{/code}} 507 507 508 -== **017:Получитьразмерпсевдодиска,большой**==508 +== 017: Get ramdisk size, large == 509 509 510 - Естьдвекомандыполученияразмерапсевдодиска,т.е.смонтированногонавыбранныйпсевдоприводAZnфайл-образа.511 -\\ ЕслииспользуемаяОС(илипрограмма,работающаясдискамибезОС)умеетработатьсбольшими(больше32М)дисками,следуетпользоватьсякомандойскодом017.Последовательностьдействий:сброситьконтроллер(п. 3.1),выбратьнакопитель(п. 3.2)ипереслатьвCSRкод017,азатем,безкаких-либоожиданий,считатьизDRсначаламладшее,иследомзанимстаршеесловоразмеравыбранногонакопителя(файл-образа).512 -\\ ЕслииспользуемаяОСнеумеетработатьсдискамибОльшими,чем32М(RT-11),следуетпользоватьсякомандой007 -получитьразмерпсевдодискасограничениемдо32М.Действияпохожие:сбрасываемконтроллер,выбираемдиск,посылаемвCSRкод[[007>>doc:||anchor="H007:41F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A430"]]исчитываемизDRоднословоразмерапсевдодиска.Еслиразмерфайл-образа,смонтированногонавыбранныйпсевдопривод,больше65534блоков,вместоэтого"большого"размера,контроллервозвращает число65534.Напоминаем,чточисло65535кое-гдеиспользуетсявспециальныхцеляхинеможетбытьразмеромдиска.513 -\\ Такженапоминаем,чтоеслинаэтотнакопительнесмонтированфайл-образ,последовательностьдействийнепройдет(команда001выборустройства)иисполнениепрограммыдоэтогоместапростонедойдет.Поэтомуошибокуэтихкоманднепредусмотрено.514 -\\ Примерпрограммысбольшимидисками510 +There are two commands to get the size of a pseudo-disk, i.e. the AZn file-image mounted on the selected pseudo-drive. 511 +\\If the OS being used (or a program working with disks without an OS) can work with large (more than 32M) disks, you should use the command with the code 017. The sequence of actions: reset the controller (p. 3.1), select the drive (p. 3.2) and send the code 017 to the CSR, and then, without any waiting, read from DR first the lower word, and then the higher word of the size of the selected drive (image file). 512 +\\If the OS you are using cannot work with disks larger than 32M (RT-11), you should use the 007 command - get the pseudo-disk size with a limit of up to 32M. The steps are similar: reset the controller, select the disk, send the 007 code to the CSR and read one word of the pseudo-disk size from DR. If the size of the image file mounted on the selected pseudo-drive is larger than 65534 blocks, the controller returns the number 65534 instead of this "large" size. We remind you that the number 65535 is used in some places for special purposes and cannot be the disk size. 513 +\\We also remind you that if the image file is not mounted on this drive, the sequence of actions will not work (command 001 select device) and the program execution will simply not reach this point. Therefore, these commands do not provide for errors. 514 +\\Example of a program with large disks 515 515 516 516 {{code language="assembler"}} 517 517 ;...................................... 518 518 519 -GetBig=017; Получить"большой"размердиска519 +GetBig=017; Get the "big" disk size 520 520 521 -; Отфрагмента3.2 (выбордиска)унасвR3остался522 -; адресDR (177222)521 +; From fragment 3.2 (disk selection) we have in R3 522 +; DR address (177222) 523 523 524 - MOV #GetBig,-(R3); пошлемкоманду525 - TST (R3)+; вернемадресвR3назад,наDR524 + MOV #GetBig,-(R3); send the command 525 + TST (R3)+; return the address in R3 back to DR 526 526 MOV @R3,BigSiz 527 527 MOV @R3,BigSiz+2 528 528 ;...................................... ... ... @@ -529,27 +529,26 @@ 529 529 {{/code}} 530 530 531 531 532 -== **020:Получитьрасширенныйкоддиагностики**==532 +== 020: Get extended diagnostic code == 533 533 534 - Кодкоманды020,послесбросаконтроллераследуетвыдатьэтукомандувCSRизатемпрочитатьдвасловарасширеннойдиагностикиизDR.Командамгновенная,ожиданиенетребуется.534 +Command code 020, after resetting the controller, you should issue this command in the CSR and then read two words of extended diagnostics from DR. The command is instant, no waiting is required. 535 535 536 536 537 -== **027:Получитьверсиюfirmware AZ STM32**==537 +== 027: Get firmware version AZ STM32 == 538 538 539 -Код команды 027, возвращает 2 слова 540 -\\первое слово - 06404 = старший байт 13. это версия прошивки, младший байт 4. это версия железа - те AZБК в данном случае 541 -второе слово - 037 = это максимальный монтируемый диск - 31. 539 +Command code 027, returns 2 words 540 +\\first word - 06404 = high byte 13. this is the firmware version, low byte 4. this is the hardware version - i.e. AZБК in this case second word - 037 = this is the maximum mountable disk - 31. 542 542 543 543 544 544 {{code language="assembler"}} 545 545 ;------------------------------------------------------------- 546 -; получениеверсии прошивкиSTM32 -результатвR1ошибка545 +; getting STM32 firmware version - result in R1 R1=0 error 547 547 GTSTMV: MOV #AZ$CSR,R1 548 -1$: CLR (R1) ; Пошлемкоманду"Сброс"549 - TSTB (R1) ; Проверимготовностьконтроллера550 - BPL 1$ ; Еслинеготов,сбрасываемеще547 +1$: CLR (R1) ; Send "Reset" command 548 + TSTB (R1) ;Check controller readinessконтроллера 549 + BPL 1$ ; If not ready, reset again 551 551 mov #27,(R1) 552 - TST (R1)+ ; Проверяемнаошибку551 + TST (R1)+ ; Check for error 553 553 BMI 2$ 554 554 mov (R1),R1 555 555 return ... ... @@ -559,45 +559,45 @@ 559 559 {{/code}} 560 560 561 561 562 -== **030:Нетоперации**==561 +== 030: No operation == 563 563 564 - Основноеназначениеэтойкоманды-устанавливатьбитразрешенияпрерыванийотконтроллера.Командапередаетбитразрешенияпрерывания,которыйнаходитсяснейводномслове,ноневходитвеесостав(напоминаем,командарасполагаетсявбитахD0 - D5,абитразрешенияпрерываний-D6),всоответствующийтриггерконтроллераибольшеникакневлияетнапроцессывконтроллере.Управлениеэтимтриггеромработаетдажевсостоянии"Думаю,прошунемешать",иэтоглавнаяособенностькоманды"нетоперации".565 -\\ Командаимееткод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. 566 566 567 567 568 -= **Блоккомандработысэнергонезависимойпамятью**=567 += Command block for working with non-volatile memory = 569 569 570 - Интерфейспредоставляетлюбому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. 571 571 572 - Всекомандыэтогоблокаиспользуютбуферэнергонезависимойпамятидлясвоейработы.571 +All commands in this block use a non-volatile memory buffer for their operation. 573 573 574 -== **021:Cчитатьблокэнергонезависимойпамятивбуфер**==573 +== 021: Read non-volatile memory block into buffer == 575 575 576 576 (% class="wikigeneratedid" %) 577 - Кодкоманды021,даннаякомандавызываетчтениеблокаэнергонезависимойпамятивбуферэнергонезависимойпамяти.576 +Command code 021, this command causes a block of non-volatile memory to be read into the non-volatile memory buffer. 578 578 579 579 580 -== **022:Отдатьнашинусчитанныйблокэнергонезависимойпамятиизбуфера**==579 +== 022: Transfer the read block of non-volatile memory from the buffer to the bus == 581 581 582 582 (% class="wikigeneratedid" %) 583 - Кодкоманды022,даннаякомандаобеспечиваетпередачубуфераэнергонезависимойпамятиврегистрDRдлясчитывания.582 +Command code 022, this command ensures that the non-volatile memory buffer is transferred to the DR register for reading. 584 584 585 585 (% class="wikigeneratedid" %) 586 - Примерпрограммы585 +Example program 587 587 588 588 {{code language="assembler"}} 589 -AZ$CSR регистркомандисостояния(CSR)590 -AZ$DR регистрданных(DR)588 +AZ$CSR = 177220; command and status register (CSR) 589 +AZ$DR = 177222; data register (DR) 591 591 592 592 593 -; trap 50 - cбросAZ592 +; trap 50 - reset AZ 594 594 ; результат в R1 =0 ok 595 595 AZreset: MOV #AZ$CSR,R1 596 -1$: CLR (R1); Пошлемкоманду"Сброс"597 - TSTB (R1); Проверимготовностьконтроллера598 - BPL 1$; Еслинеготов,сбрасываемеще599 - разипроверяемснова600 - 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, 601 601 BMI 0ERR$ 602 602 CLR R1 603 603 return ... ... @@ -606,30 +606,30 @@ 606 606 return 607 607 608 608 609 -; trap 54 - чтениеэнергонезависимойпамятиблока1 EEPROMвбуферсадресаADREEPROMMEM610 -; результатR3 -адрес,еслиR3=0ошибка611 -; статусчтениявR1 0 - ok612 -; 1 - размернесоответствуетсохраненному613 -; 2 - o шибкаверсии614 -; 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 615 615 ReadEEPROM: push R2 616 - call AZreset; сбросим615 + call AZreset; reset 617 617 tst R1 618 618 bne 0ERR$ 619 619 ; теперь читаем 620 620 MOV #AZ$CSR,R1 621 - mov #21,(R1); считатьблок1энергонезависимойпамятивбуфер622 -0$: TSTB (R1); проверяемрезультатвыполнения623 - BPL 0$; ждем624 - mov #22,(R1); отдатьнашинусчитанныйблокэнергонезависимойпамятиизбуфера625 -1$: TSTB (R1); проверяемрезультатвыполнения626 - BPL 1$; ждем627 - 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 628 628 mov #ADREEPROMMEM,R3 629 - mov #256.,R2; читаем256.слов;первоеслово-результатчтения630 -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 631 631 sob R2,2$ 632 - mov #ADREEPROMMEM,R3; успешно631 + mov #ADREEPROMMEM,R3; successful 633 633 mov (R3),R1 634 634 br 0END$ 635 635 0ERR$: CLR R3 ... ... @@ -637,41 +637,39 @@ 637 637 return 638 638 {{/code}} 639 639 640 -очевидно, после считывания памяти необходимо проверить код результата в первом слове - см расшифровку кодов ошибок 641 -\\Примеры возвращаемых данных по командам 642 -\\последовательная подача команды 021 и затем 022 позволит считать 256. слов 643 -из энергонезависимой памяти 644 -**Внимание! **первое слово это будет статус успешности чтения 645 - 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 646 646 647 647 * 0 - ok 648 -* 1 - размернесоответствуетсохраненному649 -* 2 - o шибкаверсии650 -* 3 - oшибкаконтрольной суммы645 +* 1 - size does not match saved 646 +* 2 - version error 647 +* 3 - checksum error 651 651 652 -== **023:Принятьсшинывбуферданныедляпоследующейзаписивбуфер**==649 +== 023: Receive data from the bus into the buffer for subsequent writing into the buffer == 653 653 654 - Кодкоманды023,даннаякомандапозволяетнаполнитьбуферэнергонезависимойпамяти651 +Command code 023, this command allows you to fill the non-volatile memory buffer 655 655 656 -== **024:Записатьизбуферавблокэнергонезависимойпамяти**==653 +== 024: Write from buffer to non-volatile memory block == 657 657 658 - Кодкоманды024,даннаякомандавызываетзаписьблокаэнергонезависимойпамятиизбуфераэнергонезависимойпамяти.655 +Command code 024, this command causes a non-volatile memory block to be written from the non-volatile memory buffer. 659 659 660 - Примерпрограммы657 +Example program 661 661 662 662 {{code language="assembler"}} 663 -AZ$CSR регистркомандисостояния(CSR)664 -AZ$DR регистрданных(DR)660 +AZ$CSR = 177220; Command and Status Register (CSR) 661 +AZ$DR = 177222; Data Register (DR) 665 665 666 666 667 -; trap 50 - cбросAZ664 +; trap 50 - reset AZ 668 668 ; результат в R1 =0 ok 669 669 AZreset: MOV #AZ$CSR,R1 670 -1$: CLR (R1); Пошлемкоманду"Сброс"671 - TSTB (R1); Проверимготовностьконтроллера672 - BPL 1$; Еслинеготов,сбрасываемеще673 - разипроверяемснова674 - 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, 675 675 BMI 0ERR$ 676 676 CLR R1 677 677 return ... ... @@ -679,27 +679,27 @@ 679 679 COM R1 680 680 return 681 681 682 -; trap 55 - записьэнергонезависимойпамятиизбуферасадресаADREEPROMMEM в блок 1 EEPROM679 +; trap 55 - write non-volatile memory from the buffer at address ADREEPROMMEM в блок 1 EEPROM 683 683 WriteEEPROM: push R1 684 684 push R2 685 685 push R3 686 - call AZreset; сбросим683 + call AZreset; reset 687 687 tst R1 688 688 bne 0ERR$ 689 689 690 690 MOV #AZ$CSR,R1 691 - mov #23,(R1); командуемчтобудемписатьданныевбуфер692 -0$: TSTB (R1); проверяемрезультатвыполнения693 - BPL 0$; ждем694 - 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 695 695 mov #ADREEPROMMEM+2,R3 696 - mov #255.,R2; пишем255.слов;первоесловопропускаем-результатчтения697 -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 698 698 sob R2,1$ 699 - tst -(R1); декрементируем700 - mov #24,(R1); записатьизбуферавблок1энергонезависимойпамяти701 -2$: TSTB (R1); проверяемрезультатвыполнения702 - 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 703 703 br 0END$ 704 704 0ERR$: CLR R3 705 705 0END$: pop R3 ... ... @@ -708,23 +708,21 @@ 708 708 return 709 709 {{/code}} 710 710 711 -** Обращаювнимание**,призаписи,буферидетсразусданными,тенетпервогословасостатусом.708 +**Please note** that when recording, the buffer immediately comes with the data, i.e. there is no first word with the statu 712 712 713 713 714 714 715 -= БлоккоманддляработысRTCиNTP =712 += Block of commands for working with RTC and NTP = 716 716 717 - Вконтроллере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. 718 718 719 719 720 -== Форматбуфераtimestamp (доступен по чтению) ==717 +== Buffer format timestamp (readable) == 721 721 722 -API контроллерасразуготовитвремявнескольких форматах,дабыегобылоудобноприменитьнасторонеPDP-11719 +The controller API immediately prepares time in several formats, so that it can be conveniently used on the PDP-11 side 723 723 724 724 {{info}} 725 -формат буфера даты-времени 726 -offset в восьмеричной системе - те слова 727 -формат буфера даты-времени 722 +datetime buffer format octal offset - those words datetime buffer format 728 728 \\[0]=rtc_rt11date(); 729 729 [2]=rt11 time 50Hz big word; 730 730 [4]=rt11 time 50Hz little word; ... ... @@ -742,47 +742,47 @@ 742 742 {{/info}} 743 743 744 744 745 -== Формат буфераSimpleIN (призаписи) ==740 +== SimpleIN buffer format (when writing) == 746 746 747 - форматмаксимальноупрощен,дляработысостороныPDP-11742 +the format is simplified as much as possible, for work with PDP-11 748 748 749 749 {{info}} 750 -offset ввосьмеричнойсистеме-теслова745 +offset in octal - those words 751 751 752 -[0]=year год,младшиедвецифры-те22ане2022(!)753 -[2]=month; месяц754 -[4]=day; день755 -[6]=wday; деньнедели=0неустановлен, 1-понедельник2 -вторникитд756 -[10]=hour; час757 -[12]=min; минута758 -[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 759 759 {{/info}} 760 760 761 761 762 -== **031:ПолучитьвремяизRTCвбуферtimestamp**==757 +== 031: Get time from RTC to timestamp buffer == 763 763 764 - Кодкоманды031,даннаякомандаиспользуетRTCчасыкакисточникзаполнениябуфераtimestamp759 +Command code 031, this command uses RTC clock as a source of filling the timestamp buffer 765 765 766 - Примерпрограммы:761 +Example program: 767 767 768 768 {{code language="assembler"}} 769 -; trap 61 - чтениеданныхчасовизавтономныхчасовRTC770 -; R3 - адресбуферакуданадосчитать771 -; результатв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 772 772 GetDateFromRTC: push R0 773 773 push R1 774 774 push R2 775 - call AZreset; сбросим770 + call AZreset; reset 776 776 tst R1 777 777 bne G60ERR 778 778 MOV #AZ$CSR,R1 779 779 mov #31,(R1) 780 - br G60; идемтудаткдальшекододинаковый775 + br G60; let's go there because further code is the same 781 781 {{/code}} 782 782 783 -== **032:Получитьвремяизбуфераtimestamp**==778 +== 032: Get time from timestamp buffer == 784 784 785 - Кодкоманды032,даннаякомандаотдаетнашинусодержимоебуфераtimestamp780 +Command code 032, this command sends the contents of the timestamp buffer to the bus 786 786 787 787 {{code language="assembler"}} 788 788 ; работа с часами