Sample Code: WREN 12S SDK V2 – Bring Up Code

Download is available until [expire_date]
  • Version
  • Download 27
  • File Size 4.00 KB
  • File Count 1
  • Create Date July 27, 2021
  • Last Updated August 18, 2021

Sample Code: WREN 12S SDK V2 - Bring Up Code

Dave Williams, DitroniX 2019-2021 (
WREN 12S DC Linear Motor Controller ESP12S SDK 2.0
PCA v2.03 - Test Code Firmware v2.7 - 12th August 2021

Libraries Required:

  • MCP9808 Precision I2C Temperature Sensor - Adafruit_MCP9808
  • MCP23017 I2c Port Expander - Adafruit_MCP23017 (USE Version 1.3.0)


V2.5 Updated SFLAG monitoring. Commented out motor test on start up as part of safety.
V2.6 Updated to flash RED LED upon low voltage or no main DC supply. Assume powered via UART.
V2.7 Updated info relating to Library for MCP23017.  Use Adafruit version 1.3.0 and NOT the later library version 2.02 (as this seems to have a problem)


Simplified Board Bring Up and Test Input/Output Ports (The WREN 'Hello World')

The purpose of this test code is to cycle through the various main functions of the board as part of bring up testing.

This test code is OPEN SOURCE and although is is not intended for real work use, it may be freely used, or modified as needed.

The code assumes standard single, or dual, motor configuration. No Wifi Enabled as this is not required for initial bring up.

SFLAG is a hardware logic controlled Alert Flag, normally Low, unless of a (non-hardware latched), Safety Alert. This is monitoring both Driver
inputs and sensing the ENx internal collectors of the Overcurrent and Thermal Protection transistors, to implement over current protection.

SFLAG would benefit on an interrupt, in a working environment. Simply check for a high pulse to trigger an alert event.


Leave a Reply

This site uses User Verification plugin to reduce spam. See how your comment data is processed.