Advertisement

Quick Links

N4X Reference Manual
Scannex Electronics Limited
2023-03-10

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for Scannex N4X

  • Page 1 N4X Reference Manual Scannex Electronics Limited 2023-03-10...
  • Page 2 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Scannex Electronics Ltd, UK Scannex LLC, USA t: +44(0)1273 715460 t: 1-866-BUFFER (1-866-428-3337) https://www.scannex.co.uk https://www.scannex.com info@scannex.co.uk info@scannex.com Date Author Release 2023-03-10 Initial document Preface | 1...
  • Page 3: Table Of Contents

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Table of Contents N4X Overview ................
  • Page 4 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd WakeupCounter ............... . .
  • Page 5: N4X Overview

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd N4X Overview Description The ip.buffer N4X combines the ip.buffer with a special Power Control Board inside an N4X class enclosure. The Power Control Board (PCB) contains a small CPU that provides monitoring and timing functions, and can be controlled by the ip.buffer through an I2C/TWI interface.
  • Page 6 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Features includes these features: • Controlling the power of the ip.buffer • Waking the ip.buffer up: ◦ WAKEUP inputs (pulse or level) ◦ Interval or periodic times ◦ Magnet/push-button activation ◦...
  • Page 7: Version History

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Version History Power Control Board • v1.00.0002, 2023-02-22 ◦ Initial released version ip.buffer • v3.03.328, 2023-02-14 ◦ Correct I2C internals ◦ Prebuilt Lua APIs for accessing PowerControlBoard ◦ Prebuilt LuaDebug terminal handler code...
  • Page 8: Upgrading

    The ip.buffer can be upgraded through the normal methods. has to be upgraded on-site, with access to the 10-way IDC connector (HD2), using a standard CMSIS-DAP Cortex programming adapter. This requires access to the inside of the N4X enclosure, and cannot be done  remotely.
  • Page 9: Cables

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Connections & Cables Physical connections and electrial information. PCB Layout Pin 1 on each connector highlighted in red/orange. 8 | PCB Layout...
  • Page 10: Configuration

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Configuration DIP Switch switch (top left) provides power overrides. DIP1 DIP# Description Forces ip.buffer power when "ON" (default "OFF") Forces COM1 POWER OUT when "ON" (default "OFF") Output Drive Select HD3 (middle right) controls the power output voltage to the COM1 to COM4 power outputs.
  • Page 11: Connections

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Connections COM1-4 • Mating Connector: Souriau UTS6JC10E7P • Internal Cable ◦ Panel Connector: Souriau UTS710E7S ◦ 8-way JST XHP-8 (CON9, CON11, CON8, CON10) Souriau JST Pin Description POWER OUT# COM#.TX COM#.RX...
  • Page 12: Ethernet

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Ethernet • Mating cable: ◦ Metz Connect 142M4D15020 ◦ Farnell 2442817 • Panel Connector: M12 D-Code M12 D-Code RJ45 Antenna • Panel Connector: TNC Ethernet | 11...
  • Page 13: Internal Connections

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Internal Connections ip.buffer COM Ports D9F ←→ 6-way JST XHP-6 (CON5, CON7, CON4, CON6) JST Pin Description 3-way JST XHP-3 (CON13 + CON1) JST Pin Description LED (blue) MAGNET (pull to GND for active) The Blue LED is controlled by the PCB.
  • Page 14 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd JST Pin Description  For adding I2C/TWI devices to the ip.buffer bus. QUICC/I2C | 13...
  • Page 15: Manufacturing Connections

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Manufacturing Connections PROG 10-way IDC (HD2) Standard CMSIS-DAP / SWD connection for programming the Atmel ATSAML10 CPU. TEST 8-way SIL 0.1" (CON2) JST Pin Description E.SDA (expansion) E.SCL (expansion) E.INT (expansion)
  • Page 16: Electrical Characteristics

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Electrical Characteristics Input Supply • 11.5-30V input VIN • Protection: ◦ 1.8A slow blow PTC thermal fuse ◦ Reverse Battery Protected ◦ Power output switches turn off when VIN < 10.5V Power Outputs •...
  • Page 17: Lua Api

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Lua API The Lua API for the ip.buffer. : Power Control Board API v = pcb.led() v = pcb.led(seq) v = lcd.led(seq, enable) Control LED Sequence Bits Parameters • seq: The sequence number, e.g. 0x42 •...
  • Page 18 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd pcb.debug() Enable Debug Timings Parameters None Returns None Description Some timing parameters have enforced minimum values. This API method allows for shorter times that are more useful for testing. t = pcb.info()
  • Page 19 There should be no need to use this function. This register allows emulation of the rt.buffer LED patterns. However, since the window on the N4X shows green/amber/blue, it is confusing to flash the PCB’s blue LED while the ip.buffer is alive.
  • Page 20 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd pcb.off() pcb.off(int) Power Off the ip.buffer Parameters • int: True means interval. False means periodic (i.e. do not reset the timer) Returns None Description Turns off the ip.buffer, and optionally modifies the wakeup counter.
  • Page 21 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd seconds = pcb.onfor(sec) seconds = pcb.onfor() Keep ip.buffer Alive Parameters • sec: The number of seconds to keep the ip.buffer alive. Returns • seconds: The number of seconds remaining. Description Reads, or updates the number of seconds the should keep the ip.buffer...
  • Page 22 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd     v == lookfor   then return       return nil local v,t = pcb.power_out() FindInTable(t, 4) then   -- COM4 POWER is enabled r1,r2,r3,r4 = pcb.random() Get Random Bytes...
  • Page 23 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Bit Text Description WAKEUP4 COM4 WAKEUP pin triggered WAKEUPPWR POWER WAKEUP pin triggered DTR1 The ip.buffer COM1.DTR is asserted The DIP1 (MAIN) switch is set to 'On' USER The magnet sensor has been triggered...
  • Page 24 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd degc = pcb.temp() Read Temperature Parameters None Returns • degc: Temperature in °C, with resolution of 0.125°C Description has a temperature sensor that allows the ip.1 to read temperature, and gives the ip.4 better resolution.
  • Page 25: Pcb.user : Access User Data

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd : Access User Data pcb.user The User Data Register in the CPU is RAM-based. All the while the N4X has power, the data will persist.  If the power cycles or reboots, the contents will be erased.
  • Page 26: Pcb : Helper Api Methods

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd : Helper API Methods txt = pcb._pk(pt,v) Pack a Value Parameters • pt: Packet format • v: Value Returns • txt: Return string Description Wrapper abbreviation for struct.pack(pt,v) txt = pcb.bits2string(tbl, bits)
  • Page 27 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd pcb.cmd(c) Send Command Parameters • c: Command byte Returns None Description Writes the command byte into register 0x20. d = pcb.rd(addr, …) Read I2C Register Parameters • addr: Register address Returns •...
  • Page 28 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd txt = pcb.rdvar() Read 16-byte Variable Return Register Parameters None Returns • txt: String data Description Reads the 16-byte variable return register, after the command has been issued. txt = pcb.reasons2string(v)
  • Page 29 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd v = pcb.string2bits(tbl, txt) Convert String to Bit-Field Parameters • tbl: Table of bit-field names • txt: String to convert Returns • v: Integer value Description Converts from a string to a value, using a table of names.
  • Page 30 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd txt = pcb.var(n) Request and Fetch Variable Parameters • n: Variable number Returns • txt: String data Description Wraps up a call to request and read pcb.rdvar(). Locks the Lua state pcb.cmd(n)
  • Page 31: Internal Registers

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Internal Registers The internal I2C registers of the PCB. Register Map Address Size Description 0x00 SecondsPowered 0x04 SecondsMain 0x08 WakeupCounter 0x0c WakeupInterval 0x10 WakeupFlags 0x12 WakeupInputs 0x14 LedBits 0x18 InputVoltage...
  • Page 32: Secondspowered

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd SecondsPowered Address Size Description 0x00 SecondsPowered The number of seconds that power has been applied to the PCB. See also SecondsMain SecondsMain Address Size Description 0x04 SecondsMain The number of seconds the ip.buffer has been powered.
  • Page 33: Wakeupflag Bits

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Address Size Description 0x10 WakeupFlags A bit-field showing the reasons the ip.buffer was woken. To clear one of the flags, a value should be written. e.g. to clear the MAGNET and WAKEUP1 flags,...
  • Page 34: Ledbits

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd LedBits Address Size Description 0x14 LedBits The LED pattern bit field for the blue LED. The following are special patterns: - 11 - idle, when the ip.buffer is off. Happens every 8 seconds - 12 - auto-clearing 'data collecting' pattern.
  • Page 35: Inputvoltage

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Bit Flash pattern InputVoltage Address Size Description 0x18 InputVoltage The voltage, in millivolts. PowerTimer Address Size Description 0x1a PowerTimer The number of seconds the PCB will keep the ip.buffer running.
  • Page 36: Wakeuptime

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd WakeupTime Address Size Description 0x1c WakeupTime The number of seconds the ip.buffer should be kept alive when woken up. Defaults to 60. PowerControl Address Size Description 0x1e PowerControl A bit field that indicates which outputs should be held active while the ip.buffer is sleeping.
  • Page 37: Controller Status Bits

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Controller Status Bits Bit Decimal Reason Power On Reset BOD12 BOD33 External Reset Watchdog Timer System Reset Request via SWD See ATSAML10 datasheet, section 21.8.1 "Reset Cause" Command Address Size...
  • Page 38: Variable

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd ◦ 0xee - enable extended values for diagnostics • Power off commands ◦ 0xfa - crash (reboots SAML via WDT) test command ◦ 0xfc - power off and reset the WakeupCounter, making the wakeup an interval ◦...
  • Page 39: Approvals

    European Union Waste Electrical and Electronic Equipment (WEEE) Statement. UK Users In the UK Scannex is registered as a WEEE producer and has responsibility for the recycling of Scannex products and any products returned to Scannex, postage paid, will be recycled at Scannex’s cost.
  • Page 40: Index

    N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Index clear Clear LED Patterns (pcb.led_clear), alive pcb.led_clear (Clear LED Patterns), Keep ip.buffer Alive (pcb.onfor), pcb.power_clear (Turns all power off), pcb.alive (Read Time Alive), Read Time Alive (pcb.alive), pcb.cmd (Send...
  • Page 41 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd field Convert Bit-Field to String ( pcb.bits2string), lcd.led (Control LED Sequence Bits), Convert Reason String to Bit-Field (pcb.string2reasons), Clear LED Patterns (pcb.led_clear), Convert String to Bit-Field ( Control LED Sequence Bits (lcd.led), pcb.string2bits),...
  • Page 42 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Set LED Patterns (pcb.led_set), pcb.user.write (Write User Data), pcb.var (Request and Fetch Variable), Check if PCB present (pcb.ok), pcb.version (Get Version Strings), pcb._pk (Pack a pcb.wakeup (Read or Set Wakeup...
  • Page 43 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Read Unsigned Integer Register (pcb.rd4), pcb.rd2 (Read Unsigned Integer Register), Write I2C Register (pcb.wr), Write Unsigned Integer Register (pcb.wr1), pcb.rd4 (Read Unsigned Integer Register), Write Unsigned Integer Register (pcb.wr2), rdvar pcb.rdvar...
  • Page 44 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Convert Reason String to Bit-Field Write Unsigned Integer Register (pcb.wr4), (pcb.string2reasons), Convert String to Bit-Field ( user pcb.user.read (Read User pcb.string2bits), Data), string2bits pcb.user.write (Write User Data), pcb.string2bits (Convert String to Bit- Read User Data (pcb.user.read),...
  • Page 45 N4X Reference Manual | © UK 2023 Scannex Electronics Ltd Write Unsigned Integer Register (pcb.wr2), Write Unsigned Integer Register (pcb.wr4), Write User Data (pcb.user.write), 44 | Index...

Table of Contents