Interface and microcontroller
An I/O circuit block comprising: a register unit; an input/output unit connected to a plurality of terminals; an instruction memory; and a state machine configured to execute a program stored in the instruction memory to transfer data between the register unit and the input/output unit. The state machine is configured to execute instructions of an instruction set, the instruction set consisting of: an IN instruction to transfer a specified number of bits into the register unit; and an OUT instruction to transfer a specified number of bits from the register unit; a JMP instruction; a WAIT instruction; a PUSH instruction; a PULL instruction; a MOV instruction; an IRQ instruction; and a SET instruction.
1 . An I/O circuit block comprising:
a register unit;
an input/output unit connected to a plurality of terminals;
an instruction memory; and
a plurality of state machines configured to execute a program stored in the instruction memory to transfer data between the register unit and the input/output unit, wherein instructions executed by one of the plurality of state machines to perform arithmetic function include an operation to set a value to at least one of the plurality of terminals concurrently with execution of another operation defined by the instruction, wherein at least one state machine of the plurality of state machines comprises a configurable clock divider to enable the at least one state machine to operate at a lower clock rate than an external clock.
2 . An I/O circuit block according to claim 1 wherein the state machine is configured to execute instructions of an instruction set, the instruction set including: an IN instruction to transfer a specified number of bits into the register unit; and an OUT instruction to transfer a specified number of bits from the register unit.
3 . An I/O circuit block according to claim 2 wherein the instruction set consists of: the IN instruction; the OUT instruction; a JMP instruction; a WAIT instruction; a PUSH instruction; a PULL instruction; a MOV instruction; an IRQ instruction; and a SET instruction.
4 . An I/O circuit block according to claim 1 wherein the register unit comprises an input FIFO register and an output FIFO register, the input FIFO register and the output FIFO register being configurable as a single, double length FIFO register for input or output.
5 . An I/O circuit block according to claim 1 wherein the state machine comprises an input shift register and an output shift register and is operable in an auto pull mode wherein a first predetermined number of bits are transferred from the register unit to the output shift register when the content of the output shift register is less than a first threshold and/or in an auto push mode wherein a second predetermined number of bits are transferred to the register unit from the input shift register when the content of the input shift register is greater than a second threshold.
6 . An I/O circuit block according to claim 1 wherein the state machine is configured to also execute instructions from one or more of: the register unit, a shift register within the state machine and a configuration register within the state machine.
7 . An I/O circuit block according to claim 1 wherein the state machine comprises a wrap control field specifying a sequence of instructions which are executed repeatedly.
8 . An I/O circuit block according to claim 1 having a plurality of state machines and a corresponding plurality of register units.
9 . An I/O circuit block according to claim 8 wherein the instruction memory is shared between the plurality of state machines and configured for multiple simultaneous reads.
10 . An I/O circuit block according to claim 8 wherein the input/output unit comprises a multiplexer configured to enable each of the state machines to be connected to any of the terminals.
11 . An I/O circuit block according to claim 8 further comprising a plurality of IRQ flags and wherein each of the state machines can set and read each of the IRQ flags.
12 . An integrated circuit comprising at least one I/O circuit block according to claim 1 .
13 . An integrated circuit according to claim 12 further comprising a plurality of clock sources and wherein the integrated circuit is operable in a DORMANT mode wherein all the clock sources are halted, and wherein the circuit is configured to wake from DORMANT mode on receipt of an input without a clock running.
14 . An integrated circuit according to claim 12 further comprising a plurality of peripheral registers and wherein the peripheral registers are addressable bitwise in at least one of the following modes:
atomic XOR on write
atomic bitmask set on write
atomic bitmask clear on write.
15 . An integrated circuit according to claim 14 wherein the peripheral register comprises a read/write accessible register and a bus interposer which translates upstream atomic writes into downstream read-modify-write sequences.
16 . An integrated circuit according to claim 12 further comprising at least one general purpose CPU.
17 . An assembler for a state machine having an instruction set consisting of: an IN instruction; an OUT instruction; a JMP instruction; a WAIT instruction; a PUSH instruction; a PULL instruction; a MOV instruction; an IRQ instruction; and a SET instruction, wherein the instructions to perform arithmetic function include an operation to set a value to at least one of a plurality of terminals concurrently with execution of another operation defined by the instruction.
18 . A program executable by a state machine having an instruction set consisting of: an IN instruction; an OUT instruction; a JMP instruction; a WAIT instruction; a PUSH instruction; a PULL instruction; a MOV instruction; an IRQ instruction; and a SET instruction, wherein the instructions to perform arithmetic function include an operation to set a value to at least one of a plurality of terminals concurrently with execution of another operation defined by the instruction.