NXP Semiconductors PT2001 Programming Manual And Instruction Set

NXP Semiconductors PT2001 Programming Manual And Instruction Set

Table of Contents

Advertisement

Quick Links

1

Introduction

2

Microcore programming description

2.1 CRAM addressing mode

2.2 Arithmetic logic unit

PT2001SWUG
PT2001 programming guide and instruction set
Rev. 3.0 — 29 April 2019
This programming guide relates to the PT2001 Programmable Solenoid Controller. Refer
to the individual device data sheet for feature information. The PT2001 programming
guide describes the microcore programming model, instruction set, data types used,
and basic memory organization. Also included in the guide is an example of microcode
used in the FRDMPT2001EVM using most of the instructions described herein. The
programming of the microcores has to be done using the PT2001 IDE, which is available
at https://www.nxp.com.
All the jump instructions have two possible outcomes: if a specific condition (if any) is
true, then the code flow continues at a destination specified by a parameter, otherwise
it continues to the next code line. In the same way, when a wait entry is configured, a
parameter specifies the destination.
The instruction set of PT2001 allows only two addressing modes to express the
destination parameter for the CRAM:
• Relative address (relative): The relative address parameter is represented by 5 bits.
The physical address of the destination is obtained by adding the relative address to
the physical address of the instruction that uses the parameter (that is the value of
the uprogram counter when the instruction is executed). The relative address must be
considered as two's complement represented and must be extended on 10 bit before
the addition. By using relative addresses it is possible to range from "current_address –
16" to "current_address + 15".
• Indirect address (far): It is possible to jump to the CRAM address contained into
one of two jump_registers (jr1 or jr2). These registers can be loaded with a dedicated
instruction and simply referred to in the wait or jump instructions. Refer to
in
Section 3.2 "Instruction
The microcore contains a simple Arithmetic Logic Unit (ALU). The ALU has an 8-word
internal register file connected to the internal bus. The ALU can perform the following
operations:
• Addition and subtraction. These operations are completed in a single ck clock cycle.
• Multiplication. This operation is completed in up to 32 ck clock cycles. The result is
available as a 32-bit number, and is always in the registers GPR6 (MSBs) and GPR7
(LSBs).
set".
User guide
ldjr1
and
ldjr2

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PT2001 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for NXP Semiconductors PT2001

  • Page 1: Introduction

    Also included in the guide is an example of microcode used in the FRDMPT2001EVM using most of the instructions described herein. The programming of the microcores has to be done using the PT2001 IDE, which is available at https://www.nxp.com.
  • Page 2 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set • Shift operations. The operand is shifted one position (left or right) each ck clock cycle, so it requires from 1 to 16 ck clock cycles to execute. The shift operations always consume the operand.
  • Page 3: Arithmetic Condition Register

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set and store). It is possible to transfer constant values to the ALU immediate register using the ldirl and ldirh instructions. When a multicycle instruction is required, it is recommended to wait until the operation is finished (ex: cwer Dest opd row1) before going to the next instruction.
  • Page 4: Start Management

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set considered to be unsigned, so they are saturated between FFFFh (65535) and 0000h (0). – MASK_MAX bit is set if the result of the last mask operation is FFFFh. – MASK_MIN bit is set if the result of the last mask operation is 0000h.
  • Page 5: Microprogram Counter Block

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set falling edge). The gen_start_ucx signal does not go high, until the start_latch_ucx register has been reset. START1 START2 000000 000001 000000 000010 start_latch_uc gen_start_ucx reset_start_latch time aaa-028739 Figure 2. Smart start latch The gen_start_ucx signals generated by this anti-glitch circuit are then also provided as an input to the corresponding microcores.
  • Page 6: Auxiliary Register

    2.5 Wait instructions The PT2001 is an event/response machine. An event occurs and then code executes, the wait instructions are the key to this behavior. The core waits at a 'wait' instruction for an event to occur.
  • Page 7: Subroutine Instructions

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 3. Wait instructions cwef Create wait table entry far cwer Create wait table entry relative wait Wait until condition satisfied 2.6 Subroutine instructions This section covers the instructions that support calling and returning from subroutines.
  • Page 8: Dataram Access Instructions

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jfbkf Jump far on feedback condition jfbkr Jump relative on feedback condition jmpf Unconditional jump far jmpr Unconditional jump relative jocf Jump far on condition jocr Jump relative on condition joidf...
  • Page 9: Arithmetic Instructions

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 7. DRAM access instructions Copy source register data to destination register ldca Load counter from ALU register and set outputs ldcd Load counter from Data RAM and set outputs ldirh Load 8-MSB ir register...
  • Page 10: Shift Instructions

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set 2.10 Shift instructions This section covers the shift instructions. Shifts include 'shift left' and 'shift right', 'shift by register' and 'shift immediate', 'normal shift' and 'signed shift' in which the most significant bit does not change, and 32-bit shifts in which the 'mh' and 'ml' registers are treated as a single 32-bit register in which the 'mh' register's lsb connects with the 'ml's registers msb.
  • Page 11: Intercore Communication Instructions

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set 2.12 Intercore communication instructions The intercore communication register 'rxtx' provides a mechanism to share data between cores. It is possible to exchange 16-bit data between different microcores, even belonging to different channels, using the ch_rxtx address in the internal memory map.
  • Page 12: Shortcuts

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 13. ch_rxtx internal register in read mode for source sssc to ospc Name Received_data_from_selected_microcore Lock Reset 0000 0000 0000 0000 Table 14. ch_rxtx internal register in read mode for source sumh, suml...
  • Page 13: Output Drivers

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set microcores". These DACs can be set by using the stdm instruction to setup the access mode. The DAC registers can be loaded with the cp and load instructions. Loading DAC register values to other registers or DRAM is also possible by means of the cp and store instructions.
  • Page 14: Interrupts

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set 2.16 Interrupts An interrupt routine is executed when an interrupt request is received by the microcore. The microcore must not have already been executing another interrupt routine. The interrupt routine cannot be interrupted by any other interrupt, but only be terminated via...
  • Page 15: Software Interrupt

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set 2.16.3 Software interrupt Software interrupt routine address: this address (defined in the Sw_interrupt_routine_addr (10Eh and 12Eh) section) is selected as the new uPC value if a software interrupt request is received by the microcore. This condition has a higher priority than any instruction.
  • Page 16: Instruction Set And Subsets

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set door. The spi_access_controller receives all the register read/write requests, from the SPI interface and from all the enabled microcores. Top priority is given to the requests coming from the SPI interface.
  • Page 17: Alugprirreg Subset

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Register label Operand binary value 3.1.2 AluGprIrReg subset Table 26. AluGpsIrReg subset description Register label Operand binary value 3.1.3 UcReg subset Table 27. UcReg subset description Register label Operand binary value 00000 00001...
  • Page 18: Jpreg Subset

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Register label Operand binary value eoc4 10011 flag 10100 10101 10110 spi_data 10111 dac_sssc 11000 dac_ossc 11001 dac_ssoc 11010 dac_osoc 11011 dac4h4n 11100 spi_add 11101 11110 rxtx 11111 ar is the ALU arithmetic register arith_reg...
  • Page 19: Mnemonic Index

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set simplified instruction mnemonic description symbolic description of operation addi ALU Register Addition with addi lmmediate Value to ALU Register Operation: (Source) + lmmediate = > (Destination): Carry = > C syntax of the...
  • Page 20: Condition

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Instruction name Instruction description cwef Create wait table entry far cwer Create wait table entry relative dfcsct Define current shortcut dfsct Define predriver output shortcuts endiag Enable automatic diagnosis endiaga Enable all automatic diagnosis...
  • Page 21 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Instruction name Instruction description Invert ALU register bits OR mask on ALU register with immediate register to ALU register rdspi SPI read request reqi Software interrupt request Return from subroutine rstreg Reset registers (control, status, automatic diagnostics...)
  • Page 22 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Instruction name Instruction description stirq Set IRQB pin Set single predriver output stoc Set offset compensation store Store register data in Data RAM stos Set predriver output shortcuts stslew Set predriver output slew rate mode...
  • Page 23 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Sums the value contained in the op1 register with the value contained in op2 register and places the result in the res register. Operation: (Source1) + (Source2) → (Destination); Carry → C Assembler syntax: add op1 op2 res;...
  • Page 24 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set addi Description: Sums the value contained in the op1 register with the immediate value Imm and places the result in the res register. Operation: (Source) + Immediate value → (Destination); Carry → C Assembler syntax: addi op1 Imm res;...
  • Page 25 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Applies the AND-mask contained in the Ir register to the value contained in the op1 register. The result is placed in the op1 register. The initial data stored in the op1 register is lost.
  • Page 26 Description: Enables/disables individually the high-side and low-side PT2001 load bias structures. This operation is successful only if the microcore has the right to drive the output related to the selected bias structure. The drive right is granted by setting the related bits in the Out_acc_ucX_chY (184h, 185h, 186h, 187h) configuration registers.
  • Page 27 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set chth Description: Changes the thresholds for the selected V and V feedback comparator. These are the same values as in registers Vds_threshold_hs_partx (16Bh, 16Ch), Vsrc_threshold_hs_partx (16Dh, 16Eh) and Vds_threshold_ls_partx (16Fh, 170h).
  • Page 28 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description Eighth level: 3.5 V Ninth level: 0.10 V lv10 Tenth level: 0.20 V lv11 Eleventh level: 0.30 V lv12 Twelfth level: 0.40 V lv13 Thirteenth level: 0.60 V lv14 Fourteenth level: 0.70 V...
  • Page 29 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Copies the value from the source register op1 into the destination register op2. Assembler syntax: cp op1 op2; Operands: • op1 – One of the registers listed in the operand Section 3.1.3 "UcReg subset"...
  • Page 30 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set cwef Description: Initializes or changes a row in the wait table used by the wait instruction The wait table is a five-row/two-column table: • The first column contains the wait conditions.
  • Page 31 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description Flag 7 high Flag 8 high Flag 9 high Flag 10 high Flag 11 high f12 / cur4 Flag 12 high / current feedback high Flag 13 high...
  • Page 32 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description _cur4h Current feedback 4h low _cur4n Current feedback 4n low ocur Own current feedback high _ocur Own current feedback low Entry operand row1 Wait table row 1...
  • Page 33 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set cwer Description: Initializes or changes a row in the wait table used by the wait instruction The wait table is a six-row/two-column table: • The first column contains the wait conditions •...
  • Page 34 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description Flag 3 high Flag 4 high Flag 5 high Flag 6 high Flag 7 high Flag 8 high Flag9 high Flag 10 high Flag 11 high Flag 12 high / current feedback high...
  • Page 35 PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description _cur1 Current feedback 1 low _cur2 Current feedback 2 low _cur3 Current feedback 3 low _cur4l Current feedback 56l low _cur4h Current feedback 56h low _cur4n Current feedback 4n low...
  • Page 36: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set dfcsct Description: Defines the shortcut for the current feedback. This shortcut defines the connection between the physical current feedback input of the microcore and the current measurement block. At reset, the default shortcut setting is the...
  • Page 37: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set dfsct Description: Defines three shortcuts applied to three predriver outputs among the set of all the low- side and high-side predrivers. The shortcuts table defines the connection between the physical outputs of the microcore and the external outputs pin (G_HSx and G_LSx) driving the MOSFETs.
  • Page 38: Hs1 High-Side Predriver

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set endiag Description: Enables or disables the automatic diagnosis for a single output and the related interrupt procedure for error handling. This operation is successful only if the microcore has the right to drive the related outputs.
  • Page 39: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set endiaga Description: Enables or disables the automatic diagnosis for all the predrivers output the microcore is configured to drive. If automatic diagnosis condition is satisfied, the related interrupt procedure for error handling is triggered.
  • Page 40: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set endiags Description: Enables or disables the automatic for the outputs selected via shortcuts. Four events can be monitored in parallel: • The drain-source voltage on shortcut1 output (Diag_sh1_vds) • The source voltage on shortcut1 output (Diag_sh1_src) •...
  • Page 41: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set iconf Description: Configures the microcore to be enabled by the interrupt return request. The automatic interrupt return request is issued from, according to the iret_en bit state of the Driver_config register (1C5h): •...
  • Page 42: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set iret Description: Ends the interrupt routine and clears the microcore interrupt register (uc0_irq_status (10Fh and 12Fh) and uc1_irq_status (110h and 130h)). Assembler syntax: iret Type Rst; Operands: • Type – Operand defines how the program counter (uPC) is handled returning from the...
  • Page 43: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jarf Description: Configures the jump to absolute location on arithmetic condition. If the condition defined by the BitSel operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 44: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jarr Description: Configures jump to relative location on arithmetic condition. If the condition defined by the BitSel operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 45: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019 45 / 153...
  • Page 46: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jcrf Description: Assembler syntax: jcrf op1 CrSel Pol; Configures the jump to absolute location on control register condition. If the condition defined by the CrSel operand is satisfied according to the polarity Pol, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 47: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 47. jcrf instruction format CrSel PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019...
  • Page 48: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jcrr Description: Configures the jump to relative location on control register condition. If the condition defined by the CrSel operand is satisfied according to the polarity Pol, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 49: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 48. jcrr instruction format CrSel Dest PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019...
  • Page 50: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jfbkf Description: Configures the jump to absolute location on feedback condition. If the condition defined by the SelFbk operand is satisfied according to the polarity Pol, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 51: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jfbkr Description: Configures the jump to relative location on feedback condition. If the condition defined by the SelFbk operand is satisfied according to the polarity Pol, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 52: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 50. jfbkr instruction format SelFbk Dest jmpf Description: Configures the unconditional jump. The destination address defined in one of the jump registers defined by the operand op1. The destination address is any of the absolute Code RAM location.
  • Page 53: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jmpr Description: Configures the unconditional jump to relative location. The jump is relative to the instruction Code RAM location. The destination address is the actual instruction Code RAM location added to the Dest operand value. This 5-bit value is a two's complemented number.
  • Page 54: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jocf Description: Configures the jump to absolute location on condition. If the condition defined by the Cond operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 55: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description Flag 5 high Flag 6 high Flag 7 high Flag 8 high Flag 9 high Flag 10 high Flag 11 high f12 / cur4 Flag 12 high / Current feedback 4 high...
  • Page 56: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description _cur3 Current feedback 3 low _cur4l Current feedback 5/6l low _cur4h Current feedback 5/6h low _cur4n Current feedback 5/6n low ocur Own current feedback high _ocur Own current feedback low Table 53. jocf instruction format...
  • Page 57: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jocr Description: Configures the jump to relative location on condition. If the condition defined by the Cond operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 58: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description Flag 8 high Flag9 high Flag10 high Flag11 high Flag12 high Flag13 high Flag14 high Flag15 high Terminal count 1 Terminal count 2 Terminal count 3 Terminal count 4...
  • Page 59: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description _cur4n Current feedback 5/6n low ocur Own current feedback high _ocur Own current feedback low Table 54. jocr instruction format Cond Dest PT2001SWUG All information provided in this document is subject to legal disclaimers.
  • Page 60: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set joidf Description: Configures the jump to absolute location on microcore identifier condition. If the condition defined by the UcSel operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 61: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set joidr Description: Configures the jump to a relative location on condition. If the condition defined by the UcSel operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 62: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set joslf Description: Configures the jump to absolute location on condition. If the condition defined by the StSel operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 63: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description start145 start 1,4,5 latched start245 start 2,4,5 latched start1245 start 1,2,4,5 latched start345 start 3,4,5 latched start1345 start 1,3,4,5 latched start2345 start 2,3,4,5 latched start12345 start 1,2,3,4,5 latched...
  • Page 64: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description start23456 start 2,3,4,5,6 latched start123456 start 1,2,3,4,5,6 latched Table 57. joslf instruction format StSel PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved.
  • Page 65: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set joslr Description: Configures the jump to relative location on condition. If the condition defined by the StSel operand is satisfied, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 66: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description start45 start 4,5 latched start145 start 1,4,5 latched start245 start 2,4,5 latched start1245 start 1,2,4,5 latched start345 start 3,4,5 latched start1345 start 1,3,4,5 latched start2345 start 2,3,4,5 latched...
  • Page 67: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description start13456 start 1,3,4,5,6 latched start23456 start 2,3,4,5,6 latched start123456 start 1,2,3,4,5,6 latched Table 58. joslr instruction format StSel Dest PT2001SWUG All information provided in this document is subject to legal disclaimers.
  • Page 68: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jsrf Description: Configures the jump to absolute location on status register condition. If the condition defined by the SrSel operand is satisfied according to the polarity Pol, the program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 69: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 59. jsrf instruction format SrSel PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019...
  • Page 70: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jsrr Description: Configures the jump to the relative location of the status register condition. If the condition defined by the SrSel operand is satisfied according to the polarity Pol, the program counter (uPC) is handled such as the next executed instruction is relative destination address.
  • Page 71: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 60. jsrr instruction format SSel Dest PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019...
  • Page 72: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jtsf Description: Configures the jump on subroutine to absolute location The program counter (uPC) is handled such as the next executed instruction is located into the destination address contained in one of the jump registers.
  • Page 73: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set jtsr Description: Configures the jump to subroutine to relative location on condition. When jump to subroutine is called, the current program counter value (uPC) is stored into the auxiliary register (aux) to handle end-of-subroutine return.
  • Page 74: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set ldca Description: Loads one of the four end-of-count registers (eoc1, eoc2, eoc3, eoc4) defined by the operand with a value stored in a ALU register op1 and sets the outputs defined by the shortcut Sh1 and Sh2.
  • Page 75: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set ldcd Description: Loads one of the four end-of-count registers (eoc1, eoc2, eoc3, eoc4) with a value stored in the 6-bit Data RAM address Dram and sets the outputs defined by the shortcut Sh1 and Sh2.
  • Page 76: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 64. ldcd instruction format Dram PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019...
  • Page 77: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set ldirh Description: Add two ALU registers and place the result in one of the ALU registers Loads the Value8 data in the 8-MSB of the immediate register (ir). Assembler syntax: ldirh Value8 RstL;...
  • Page 78: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set ldirl Description: Add two ALU registers and place the result in one of the ALU registers Loads the Value8 data in the 8-LSB of the immediate register (ir). Assembler syntax: ldirl Value8 RstH;...
  • Page 79: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set ldjr1 Description: Loads the Value10 data in the 16-bit jump register 1 (jr1). The operand Value10 can be replaced by a label. The compiler automatically substitutes the label (if used) with the defined value.
  • Page 80: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set ldjr2 Description: Loads the Value10 data in the 16-bit jump register 2 (jr2). The operand Value10 can be replaced by a label. The compiler automatically substitutes the label (if used) with the defined value.
  • Page 81: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set load Description: Loads the data from the Data RAM at the address defined by the Dram operand to the op1 register. The operand Dram can be identified with a univocal label. The compiler automatically substitutes the 'define' label (if used) with the suitable Data RAM address.
  • Page 82: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Multiplies the value contained in the op1 register with the value contained in op2 register and places the result in the reg32 register. The reg32 register is the concatenation of the...
  • Page 83: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set muli Description: Multiplies the value contained in the op1 register with the immediate value Imm and places the result in the reg32 register. The reg32 register is the concatenation of the...
  • Page 84: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Inverts each bit of the op1 register and places the result in the op1 register. Operation: (Source) \ → (Source) Assembler syntax: not op1; Operands: • op1 – One of the registers listed in the operand Section 3.1.1 "AluReg subset"...
  • Page 85: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Applies the OR-mask stored in the Immediate Register (ir) to the op1 register and places the result in the op1 register. Operation: (Source) (+) Immediate register → (Source) Assembler syntax: or op1;...
  • Page 86: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set rdspi Description: Requests an SPI backdoor read. The address must previously be defined in the SPI address register spi_add. The rdspi instruction requires 2 ck cycle to complete operation. The SPI address register must not be changed on the following instruction, otherwise the operation fails and the read data is dummy.
  • Page 87: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set reqi Description: Requests a software interrupt At the reqi instruction execution, the Code RAM address currently executed is stored in the interrupt return register corresponding to the 10 LSB of the uc0_irq_status register (10Fh, 12Fh) and for uc1_irq_status (110h, 130h).
  • Page 88: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Ends a subroutine. To continue the code execution, the program counter (uPC) is loaded with the content of the auxiliary register (aux) automatically updated when the subroutine was called with the instructions jtsf and jtsr.
  • Page 89: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set rstreg Description: Resets single or multiple registers defined by the TgtBit operand. The instruction reset bits issued from SPI registers including: control register ctrl_reg_uc0 (101h, 121h) and ctrl_reg_uc1 (102, 122) status register status_reg_uc0 (105h, 125h) and status_reg_uc1 (106h, 126h) automatic...
  • Page 90: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set rstsl Description: Resets the Start_latch_ucx register. This instruction is active only if the Smart Latch mode is enabled. The smart mode register can be activated by setting the bits smart_start_uc0 and smart_start_uc1 of the Start_config_reg_Part2 registers (104h, 124h).
  • Page 91: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set sh32l Description: Shifts the reg32 register left. The shift is single or multiple according to the op1 register value (factor). The reg32 register is the concatenation of the multiplication result registers...
  • Page 92: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set sh32li Description: Shifts the reg32 register left. The shift is single or multiple according to the immediate value (factor). The reg32 register is the concatenation of the multiplication result registers mh and ml:...
  • Page 93: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set sh32r Description: Shifts the reg32 register right. The right shift is single or multiple according to the op1 register value (factor). The reg32 register is the concatenation of the multiplication result...
  • Page 94: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set sh32ri Description: Shifts the reg32 register right. The right shift is single or multiple according to the immediate value. The reg32 register is the concatenation of the multiplication result registers mh and ml:...
  • Page 95: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Shifts the op1 register left. The shift is single or multiple according to the op2 register value (factor). To be completed, the shift operation requires a number of ck clock cycles corresponding to the op2 register value.
  • Page 96: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shl8 Description: Shifts the op1 register 8 positions left. To be completed, the shift operation requires one ck clock cycles. Operation: (Source1) << 8 → (Source) Assembler syntax: shl8 op1; Operands: •...
  • Page 97: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shli Description: Shift the op1 register left. The shift is single or multiple according to the immediate value Imm. To be completed, the shift operation requires a number of ck clock cycles corresponding to the immediate value Imm.
  • Page 98: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shls Description: Shift the op1 register left. The shift is single or multiple according to the op2 register value (factor). The op1 register is handled as a two's complement number. The MBS (sign bit) is unchanged during the shift operation.
  • Page 99: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shlsi Description: Shifts the op1 register left. The shift is single or multiple according to the immediate value Imm. The op1 register is handled as a two's complement number. The MBS (sign bit) is unchanged during the shift operation.
  • Page 100: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Shift the op1 register right. The shift is single or multiple according to the op2 register value (factor). To be completed, the shift operation requires a number of ck clock cycles corresponding to the op2 register value.
  • Page 101: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shr8 Description: Shift the op1 register 8 positions right. To be completed, the shift operation requires one ck clock cycle. Operation: (Source1) >> 8 → (Source) Assembler syntax: shr8 op1; Operands: •...
  • Page 102: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shri Description: Shifts the op1 register right. The shift is single or multiple according to the immediate value Imm. To be completed, the shift operation requires a number of ck clock cycles corresponding to the immediate value Imm.
  • Page 103: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shrs Description: Shift the op1 register right. The shift is single or multiple according to the op2 register value (factor). The op1 register is handled as a two's complement number. The MBS (sign bit) is unchanged during the shift operation.
  • Page 104: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set shrsi Description: Shifts the op1 register right. The shift is single or multiple according to the immediate value Imm. The op1 register is handled as a two's complement number. The MBS (sign bit) is unchanged during the shift operation.
  • Page 105: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set slab Description: Selects the register containing the address (add_base) used in the data RAM Indexed Addressing Mode (XM). The reset value of SelBase is reg. Assembler syntax: slab SelBase; Operands: • SelBase – Operand defines the register to be used to determine the data RAM address...
  • Page 106: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set slfbk Description: Selects the feedback reference for both V of the high-side predrivers 2 and 4. In addition, this instruction enables the automatic diagnosis. This operation is successful only if the microcore has the right to drive the related outputs.
  • Page 107: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set slfbks Description: Selects the feedback for V HS1 to HS5 based on shortcut. In addition, this instruction enables the automatic diagnosis. This operation is successful only if the microcore has the right to drive the related outputs.
  • Page 108: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set slsa Description: Selects the register containing the address used on SPI read and write instructions (rdspi and wrspi) The reset values of SelSpi is reg. Assembler syntax: slsa SelSpi; Operands: • SelSpi – Operand defines the register containing the SPI address...
  • Page 109: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stab Description: Loads the address value in the address base register add_base. The address base register is a 6-bit register containing the address base used in the Data RAM Indexed Addressing Mode (XM).
  • Page 110: Description Of

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stadc Description: Enables or disables the ADC conversion mode on the specified current measurement block. The other channel is selected by SPI register bit (Dac_rxtx_cr_config (112h, 132h, 152h)) The operation is successful only if the microcore has the right to access the related current measurement block.
  • Page 111: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019 111 / 153...
  • Page 112: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stal Description: Sets the arithmetic logic mode. This mode is the set according to the bits A1 and A0 of the ALU condition register (arith_reg). This instruction configures the behavior of addition and subtraction instructions only.
  • Page 113: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019 113 / 153...
  • Page 114: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stcrb Description: Sets the logic level value individually with the Logic operand of each selected bit CrbSel of the control register. Assembler syntax: stcrb Logic CrbSel; Operands: • Logic – Operand defines the logic level value...
  • Page 115: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stcrt Description: Each microcore shares the ch_rxtx register with the other microcores can read the shared register of another microcore. This instruction selects the microcore's shared register accessed by the microcore executing the stcrt instruction.
  • Page 116: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stdcctl Description: Selects if the DCDC must be controlled by the microcore (sync) or perform the automatic current regulation (async) between threshold 4l and 4h. The ModeDC reset value is sync.
  • Page 117: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stdm Description: The DAC registers address (dac_sssc, dac_ossc, dac_ssoc, dac_osoc) in the internal data memory map are split in two slices (dac value, offset register): This instruction selects which slice(s) is accessed.
  • Page 118: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stdrm Description: Sets the Data RAM read mode. The possible read modes according to the ModeDRM operand are: dram_word_mode: all 16 bits are accessed dram_lowbyte _mode: only the 8 LSBs of the source Data RAM are accessed. The result is available in the 8 lower bits of the destination register.
  • Page 119: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set steoa Description: Enables or disables the end-of-actuation mode for all the high-side predrivers the microcore has enabled to drive by means of the Switch operand. The V threshold monitoring of the related predrivers can be disabled by setting the operand Mask.
  • Page 120: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Sets the logic level value with the Boolean Logic of the selected flag. The flag is selected according the FlgSel operand. Assembler syntax: stf Logic FlgSel; Operands: • Logic – Operand defines the logic level value...
  • Page 121: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stfw Description: Defines the freewheeling output modes. Freewheeling control is automatic or manual according to the FwMode operand. For each HS there are two possible freewheeling outputs. The output is selected in the fw_link (refer to Fw_link (169h)) register.
  • Page 122: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stgn Description: Sets the gain of an operational amplifier with the Gain operand used to measure the current flowing through the actuator sense resistor. The operational amplifier is selected according to the OpAmp operand.
  • Page 123: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stirq Description: Set the IRQB output pin The Logic reset value is high. Assembler syntax: stirq Logic; Operands: • Logic – Operand defines the logic level of the IRQB pin Operand label...
  • Page 124: Hs4 High-Side Predriver

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Sets the state with the Out operand for the selected output according to the OutSel operand. The operation is successful only if the microcore has the right to drive the related outputs.
  • Page 125: Description Of

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stoc Description: Enables or disables the offset compensation with the operand Ctrl on the current measurement block specified according to the DacTarget operand. The operation is successful only if the microcore has the right to access the related current measurement block.
  • Page 126: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set store Description: Copies the content of the op1 source register in a Data RAM line defined by the 6-bit Data RAM address Dram. The operand Dram can be identified with a univocal label. The compiler automatically substitutes the 'define' label (if used) with the suitable Data RAM address.
  • Page 127: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stos Description: Sets the state of three outputs Out1, Out2 and Out3 previously defined as shortcuts with the dfsct instruction. The operation is successful only if the microcore has the right to drive the related outputs.
  • Page 128: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stslew Description: Defines the outputs slew rate mode with the Boolean SlMode. The operation is successful only if the microcore has the right to drive the related outputs. The drive right is granted by setting the related bits in the Out_acc_ucX_chY (184h, 185h, 186h, 187h) configuration registers.
  • Page 129: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stmfm (PT2001MAE only) Description: The stmfm instruction provides a way to switch the S_HSx and D_LSx multiplexer to the predriver, which is currently set as a shortcut for the microcore calling the instruction.
  • Page 130: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 118. Switch Operand label Operand description Operand binary value oax enabled oax disabled Instruction format: Switch s_hs d_ls PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved.
  • Page 131: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set stsrb Description: Sets individually the logic level value with the Logic operand of each selected bit SrbSel of the status register (status_reg_uc0 (105h, 125h) and status_reg_uc1 (106h, 126h)). Assembler syntax: stsrb Logic SrbSel;...
  • Page 132: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Subtracts the value contained in the op2 register from the value contained in op1 register and places the result in the res register. Operation: (Source1) – (Source2) → (Destination) Assembler syntax: sub op1 op2 res;...
  • Page 133: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set subi Description: Subtracts the value contained in the Imm register from the value contained in the op1 register and places the result in the res register. Operation: (Source1) – Immediate value → (Destination) Assembler syntax: subi op1 Imm res;...
  • Page 134: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set swap Description: Swaps the high byte and the low byte of the register op1. Operation: (Source)[0:7] < → (Source)[8:15] Assembler syntax: swap op1; Operands: • op1 – One of the registers listed in the operand Section 3.1.1 "AluReg subset"...
  • Page 135: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Description: Enables or disables all software interrupts and from start edges for a microcore. HW interrupts from automatic diagnosis, driver disable or loss of clock are not disabled. The Switch reset value is on (all SW interrupts enabled).
  • Page 136: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set toc2 Description: Converts the integer value contained in the AluReg register into a two's complement format. If the conversion bit in the arithmetic condition register is zero, the 'toc2' instruction makes the most significant bit in the operand register zero.
  • Page 137: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set toint Description: Convert the two's complement value contained in op1 register to integer format. The toint instruction retains the original value in the operand register op1 when its MSB bit is zero. If the MSB is 1, then it returns the two's complement of the operand register (op1[14:0]).
  • Page 138: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set wait Description: Stops the program counter (uPC) incrementing and waits until at least one of the enabled wait conditions is satisfied. When one of the conditions is satisfied, the program counter is moved to the corresponding destination.
  • Page 139: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Operand label Operand description Operand binary value row245 Wait table row 2,4,5 enabled 011010 row1245 Wait table row 1,2,4,5 enabled 011011 row345 Wait table row 3,4,5 enabled 011100 row1345 Wait table row 1,3,4,5 enabled...
  • Page 140: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Table 126. wait instruction format WaitMask (row 6 disabled) WaitMask (row 6 enabled) PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved.
  • Page 141: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set wrspi Description: Requests an SPI backdoor write. The address must previously be defined in the SPI address register spi_add. The data must previously be defined in the SPI data register spi_data.
  • Page 142: Specific Assembler Language

    Table 128. xor instruction format Specific assembler language The PT2001 requires microcode to enable most of its functions. The main benefit is the large flexibility in configuring the device. This microcode is defined by the software engineer in a source file, coding the PT2001 specific instructions in assembler language.
  • Page 143: Inserting A Comment Field

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set One instruction per source file line or per include line is allowed. Below is an example: stf low b0; 4.2 Inserting a comment field The source code file supports the addition of comments. The comment fields are identified with: •...
  • Page 144: Using A Line Label

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set The include declaration must be placed: • At the beginning of the line • Or after the end comment character '*' The include syntax is as follows: #include 'Filename.def'; Use of nested include is not permitted.
  • Page 145: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set The conditional assembly considers a branch only if its parameter is defined (whatever its value may be). Using an ELSE branch is optional. All the instructions placed before the #IF label and after the #ENDIF label are excluded from the conditional code block and are assembled.
  • Page 146: Example Source Code

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Example source code This code can be used with the FRDMPT2001EVM. 5.1 Channel 1 - Ucore0 - controls injectors 1 and 2 5.2 Channel 1 - Ucore1 - controls injectors 3 and 4 PT2001SWUG All information provided in this document is subject to legal disclaimers.
  • Page 147: User Guide Rev. 3.0 — 29 April

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019 147 / 153...
  • Page 148: Channel 2 - Ucore0 - Dcdc Control

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set 5.3 Channel 2 - Ucore0 - DCDC control PT2001SWUG All information provided in this document is subject to legal disclaimers. © NXP B.V. 2019. All rights reserved. User guide Rev. 3.0 — 29 April 2019...
  • Page 149: Channel 2 - Ucore1 - Fuel Pump Drive Source Code

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set 5.4 Channel 2 – Ucore1 – Fuel Pump Drive Source Code Revision history Revision history Date Description • 20190429 Table 29: added stmfm instruction • Section 3.2.2: added description for stmfm instruction •...
  • Page 150: Legal Information

    Customer is responsible for doing all necessary testing for the customer’s applications and products using NXP Semiconductors products in order to avoid a Limited warranty and liability — Information in this document is believed default of the applications and the products or of the application or use by to be accurate and reliable.
  • Page 151: Format

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Tables Tab. 1. Arithmetic condition register ......3 Tab. 54. jocr instruction format ........59 Tab. 2. Current feedback assignment ......6 Tab. 55. joidf instruction format ........60 Tab. 3. Wait instructions ..........7 Tab.
  • Page 152: Description Of

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Tab. 110. sto instruction format ........124 Tab. 120. sub instruction format ........132 Tab. 111. stoc instruction format ........125 Tab. 121. subi instruction format ........133 Tab. 112. store instruction format ........126 Tab.
  • Page 153: Table Of Contents

    PT2001SWUG NXP Semiconductors PT2001 programming guide and instruction set Contents Introduction ............1 Microcore programming description ....1 CRAM addressing mode ........1 Arithmetic logic unit ........... 1 2.2.1 Arithmetic condition register ......3 Start management ..........4 Microprogram counter block ......5 2.4.1...

Table of Contents