CANNY 5.3 Pico

CANNY 5.3 Pico is a miniature and cost-effective automotive programmable logic controller with a CAN 2.0A/B interface, three general purpose IO channels, up to two LIN interfaces and a protected ADC. The features and miniature size of CANNY 5.3 Pico enable it to be used both as a standalone device and as an embedded controller.

General Information

CANNY 5.3 Pico has a limited number of external channels and can therefore be classified as a smart relay or a Nano PLC. Nevertheless, CANNY 5,3 Pico has enough channels and driver features to serve as a solution for many different control, automated and monitoral tasks.

CANNY 5.3 Pico has the following unique combination of features:

  • three universal input / output channels that can work in the modes of outputs and inputs, with both positive and negative polarity;
  • rated power supply and IO channels voltage 0 / 12V (16V max);
  • the maximum output current of each of the 3 IO channels: +/- 100mA, sufficient to control a standard automotive relay;
  • one CAN 2.0B Interface, compliant with ISO-11898, SAE J2411 standards, which are widely used in modern cars;
  • support for widely-used communication protocols: 2 UART, 2 LIN, 1-Wire Dallas*;
  • built-in energy consumption management in the range of 1 to 25mA, helps conserve battery power during period of inactivity in a car;
  • EEPROM for applications and sixty-four 16-bit non-volatile memory data cells, available to user application to preserve critical data during a power failure;
  • wide operating temperature range from -40 to +85°C;
  • integrated surge protection and short circuit protection;
  • compact dimensions that allow it to be mounted in places that have limited capacity and even in vehicle wiring harnesses, as well as use the controller as a built-in.

* - currently in development.

The CFD (Canny Function Diagram) visual programming language was created specifically for the purpose of creating applications in a fast, intuitive fashion. These programs are called function diagrams. The free CannyLab IDE is used to create, edit, debug and deploy these programs.

Requirements for writing software to the controller:

  • PC with a USB port version 1.1 or higher;
  • installed CannyLab IDE;
  • ordinary miniUSB cable.

The amount of controller memory accessible to you is enough to accommodate a function diagram consisting of several hundred function blocks. This allows you to implement fairly sophisticated algorithmms.

The controller has a two-coloured LED controlled from the user application, useful for indicating controller operation mode and debugging.

Design and functional operation

The appearance and layout

The main components of CANNY 5.3 Pico are:

  • a micro controller (MCU) with the auxiliary circuits;
  • power supply system for all controller elements;
  • IO channels level matching circuit;
  • electric protection system;
  • connectors and LED.

All of these components are based on a single 40 x 15 mm printed circuit board.

The controller has a pre-installed microUSB connector and pads for soldering wires or installing an 8-pin double-row connector. Depending on the desired configuration for connecting the controller to a power source and external devices, a set of wires or a harness with an 8-pin double-row connector as well as a heat-shrink tubing may be included in its package. The 8 pads/8-pin double-row connectors correspond to the following interfaces/connections: power input +7V…+16V, power input GND, CAN-H, CAN-L, three contacts corresponding to input-output channels 8, 9 and 10, ADC contact. The pre-installed microUSB connector of the controller is used to connect the interface cable connecting the controller to the PC.

All contacts of the 8-pin connector are additionally available through special edge contacts located on the long sides of the controller board. These additional contacts can be used to solder CANNY 5.3 Pico directly to a motherboard. The contacts of the microUSB connector are also located on the sides of the board, which allows you to conveniently place the microUSB connector when the controller is installed on a motherboard, which lets you conveniently update controller software.

Description of CANNY 5.3 Pico channels

Overall and installation dimensions of the controller

Overall and installation dimensions of CANNY 5.3 Pico

Recommended dimensions and location of pads for surface mounting of the controller

Recommended dimensions and location of pads for surface mounting CANNY 5.3 Pico.

Software Architecture

CANNY 5.3 Pico is a digital programmable computing controller. Its main structural elements are:

  • arithmetic logic unit (ALU);
  • internal memory;
  • command execution management subsystem;
  • input-output system.
CANNY 5.3 Pico software architecture

Arithmetic Logic Unit is the processing core of CANNY 5.3 Pico. ALU is used to execute both system software and function diagrams that were uploaded into the controller’s internal memory. The controller’s internal memory is divided into the EEP program memory, EEP data memory, and ROM. The command management subsystem is responsible for switching and setting up the operation mode of the controller. The IO system is used to communicate with the outside world, using both discrete IO channels and standard digital interfaces CAN / LIN / RS232 / USB.

Software Structure

CANNY 5.3 Pico software structure

CANNY 5.3 Pico software structure consists of:

  • a bootloader;
  • system software (operating system and drivers);
  • function diagram.

The bootloader enables the operation of the controller in the software download mod by organizing data transmission between CANNY 5.3 Pico and the PC using the USB protocol. It is responsible for checking the integrity of data transmitted for PC and subsequently writing it to the controller’s internal memory. The bootloader is placed into the internal memory of the controller during production and can not be deleted or modified by you.

The manufacturer distributes CANNY 5.3 Pico firmware in the CCX file format. Firmware includes an operating system and a set of drivers providing function diagram execution and its interaction with controller resources. You can write/erase firmware to/from the controller, but you cannot modify CCX file content.

The function diagram is created and modified in CannyLab IDE. You can then save it to a CFD file or load it into the controller where it specifies the controller’s algorithm in Run mode.

Operation modes

There are three operation modes, each of them used for specific functionality.

Software upload mode

In software download mode, the controller is ran by bootloader. The bootloader writes firmware and function diagrams according to commands received from the CannyLab IDE. Transition to this mode happens automatically when the controller is connected to a PC via a USB cable. During the transition to software upload mode the controller performs a master reset: the function diagram execution stops, IO channels are switched to the neutral state, built-in green LED turns on. When the controller establishes communication with CannyLab, the green LED starts blinking.

This mode is exited automatically when the controller is disconnected from the PC. When exiting the mode if system software is loaded into the EEPROM correctly, the controller will switch to running mode, otherwise it returns to software download mode.

Running mode

Run mode is the controller’s main operation mode. In this mode, the controller is operated by the system software continuously, executing the function diagram in a never-ending loop. Transition to this mode happens automatically when the controller is connected to an external +7V..+16V power supply and not connected via USB. In this mode the function diagram has access to all controller resources that are supported by the drivers currently uploaded to the controller.

Sleep mode

This mode is a variant of run mode in which the controller pauses to reduce its power consumption to a minimum after each loop of the function diagram. Thus, the controller operates in a “pulsed” mode, periodically “falling asleep” and “waking up”. Enable, disable, and configure the parameters of this mode via the function diagram. This mode is useful when developing systems where power consumption matters, such as on-board car equipment.

Runtime Environment

Function diagram presentation

Programs for CANNY 5.3 Pico controller, function diagrams are developed within the CannyLab IDE. Upon uploading the diagram to the controller, it is automatically processed by the translator. The translator checks the consistency of the diagram, determines function block execution order and converts the diagram into the executable code - a sequence of machine instructions for CANNY 5.3 Pico controller’s ALU.

The execution order

When written to the controller the executable program code is included in the sequence of system software machine instructions. Thus, the entire command sequence for a controller that contains both system software and a function diagram will be:

  • initialisation routine executed once after each reset of the controller;
  • infinite loop, called the diagram execution loop. It consists of:
  • procedures for reading the status of hardware resources;
  • executable function diagram code;
  • procedures for changing the status of hardware resources.

Some of the drivers included in the controller system software, such as the CAN driver, need the controller to react immediately to program events and received data. Program code of these drivers is asynchronously processed by the controller in parallel with the main execution flow. When processing asynchronous drivers calls, the execution of the diagram’s main loop is briefly suspended.

Algorithm of diagram execution by the CANNY 5.3 Pico controller

Access to hardware resources

The following resources are available from the function diagram :

  • controller system resources;
  • IO subsystem;
  • additional drivers included in the system software.

All of these resources appear within the controller’s internal memory protected address space. This address space is divided into input and output registers.

You can use input registers as a source of input data for virtually any function block of the diagram. This allows you to access and use the data received by the controller from the outside world for your algorithms. For example, you can access information about the electric potential on any of the controller’s connector pins, or data packet contents received via the CAN bus.

You can use output registers as the output target for any function block on the diagram. This lets you control controller resources from the function diagram, which lets you influence objects in the outside world. For example, you can switch an external relay by changing the electrical potential on one of the pins of the controller, turn the controller LED on, set CAN operation mode, send a data packet via the CAN bus.

To use most controller resources you will first need to assign the necessary operating parameters, such as the polarity of output channels, the polarity and the sensitivity of input channels, CAN communication speed and so on.

Assigning these parameters is done by recording special constants into one or several specific output registers, depending on the resource that needs to be accessed. For example, writing a constant with a value of 260 into the register located at 1349 address sets channel №8 to an output positive polarity mode.

Writing a constant to a register of the CANNY 5.3 Pico controller

For user convenience all the of the controller’s available registers, as well as all special constants used for interacting with these resources, are named. As demonstrated above, instead of writing 260 into the register 1349, you instead write a named “Strong VDD/Weak GND” constant to “DIO Output Mode Setup Register, IO Channel 8”.

Receiving a signal from an input register of CANNY 5.3 Pico

Controller Registers

System Registers

Main article: CANNY 5.3 Pico, System Registers

System resources are divided into an address group of input registers and an address group of output registers. By accessing these registers from the function diagram you can receive useful information about the current status of the controller, and control its operating mode. The set of system registers is located in the “System Registers” directory of the CannyLab IDE register list. The list is accessible via “Input Register” and “Output Register” context menu options in the editor.

Discrete Inputs and Outputs

Main article: CANNY 5.3 Pico, Discrete IO Driver

CANNY 5.3 Pico gives you access to three discrete general purpose IO channels. Each channel is physically accessed through a corresponding pin of the controller: channel 8 - contact 4; channel 9 - contact 3; channel 10 - contact 5. By writing and reading data of the respective driver registers, the functional diagram can manage the electric potential in each of these contacts, as well as get information about the current potential of each of them.

The physical characteristics of these channels allow them to be connected to a variety of external devices. All channels can be used to work with any type of load, for example: electromagnetic relays, small electric motors, LEDs, low current systems. You can use a variety of input signal sources, such as: mechanical, electromechanical, and electronic buttons and switches, pulse generators, voltage source 0-12V, transistor outputs of various equipment, etc.

Channel operation mode and parameters are set via the function diagram. At any given moment in time, the channels can only work in one of the possible modes, but it is possible to dynamically override the channel configuration from the function diagram.

High Resolution PWM

Main article: CANNY 5.3 Pico, High Resolution PWM

One input-output channel of CANNY 5.3 Pico (channel 8) can work in high-frequency pulse-width modulator mode. In HR PWM mode, the PWM timing parameters - the period and duty cycle can be set in the range from 2 to 32767 microseconds, in 1 microsecond increments.

An HR PWM channel has a fixed pulse polarity - GND 100mA. Generation can be done in either open collector (no pull-up or external pull-up) mode or internal pull-up mode to +12V (specified by setting value in the appropriate register). In this mode, the channel is asynchronous to the function diagram, which allows for maximum stability of generated signal timing parameters.

HR PMW driver operates using the controller’s channel resources, but has a higher priority than the discrete input-output driver. This means that for all channels, for which the HR PMW driver is activated, all value changes in registers associated with discrete input-output driver will be ignored.

Note: When a channel is set to the high-resolution pulse width modulator mode the electrical short circuit protection for the channel is disabled! Overload or short circuit of a channel set to this mode can cause damage to the controller!

CAN driver

Main article: CANNY 5.3 Pico, CAN driver

Two dedicated external contacts of CANNY 5.3 Pico controller, contact 1 (CAN-L) and contact 7 (CAN-H), are provided to connect to the digital information CAN-bus.

UART / RS232 / Modbus driver

Main article: CANNY 5.3 Pico, UART Driver

Two IO channels (#9 and #10) of CANNY 5.3 Pico support UART and RS-232 serial protocols for data transmission/reception. It may be used to connect the controllers with each other or with external equipment supporting this communications protocols. The channels may be activated independently of each other and have individual data speed setting, protocol type and configuration, pull up line.

Size of receive and transmit buffers for each of the UART interfaces in the CANNY 5.3 Pico driver is 64 bytes.

UART implementation in CANNY 5.3 Pico controllers enables serial data reception and transmission over a single wire in half-duplex mode. Thus CANNY 5.3 Pico may have two independent connections when using the UART protocol. Monitoring of the data link status is done from the function diagram. If the channel is free, the device may start data transmission, otherwise the device should wait for the line release.

RS-232 implementation, by using both UART data channels, enables the exchange of data with other RS-232 devices in duplex mode, i.e. one channel is used to send data, while the other is used to simultaneously receive data.

Modbus protocol in CANNY 5.3 Pico controllers is implemented both over UART or over RS-232. A compact binary variant called Modbus RTU is used as the ADU (Application Data Unit). Checking the data integrity is done via the automatically calculated checksum (CRC). Package size is limited to 64 bytes including the CRC.

UART / RS232 / Modbus driver operates using the controller’s channel resources, but has a higher priority than the discrete input-output driver. This means that for all channels, for which the UART/RS-232/Modbus driver is activated, all value changes in registers associated with discrete input-output driver will be ignored.

LIN driver

Main article: CANNY 5.3 Pico, LIN driver

Channels 9 and 10 of CANNY 5.3 Pico can be used to organize data reception and transmission as two independent LIN driver channels.

LIN driver channels can be connected both in tandem and individually. They have individual settings for baud rate, pull-up line and bus node type - MASTER or SLAVE.

LIN driver operates using the controller’s channel resources, but has a higher priority than the discrete input-output driver. This means that for all channels, for which the LIN driver is activated, all value changes in registers associated with discrete input-output driver will be ignored.

Драйвер Dallas 1-Wire

Основная статья: CANNY 5.3 Pico, Драйвер Dallas 1-Wire

Контроллер CANNY 5.3 Pico может быть использован в качестве ведущего (MASTER) узла в однопроводной сети передачи данных Dallas 1-Wire, при этом он имеет возможность только отправлять запросы на получение данных от ведомых устройств.

Для подключения контроллера CANNY 5.3 Pico к шине 1-Wire может быть использован толькео канал ввода-вывода №9, при этом он должен быть снаружи подтянут к напряжению 5В резистором номиналом от 3 кОм до 7 кОм.

В контроллерах CANNY 5.3 Pico предусмотрена возможность обращения к конкретному устройству на шине 1-Wire по его адресу, что позволяет организовать работу контроллера с несколькими ведомыми устройствами по одному каналу.

User Preprogrammed Parameters

Main article: CANNY 5.3 Pico, User Preprogrammed Parameters

The custom configuration parameters can be specified by the end user when loading software into the controller using SFX-files. After uploading software and running the controller in standalone mode, parameters set by user become available in the function diagram within the relevant controller registers folder.

Proper use of user-defined parameters significantly increases the flexibility and versatility of controller-based solutions, enabling the end user to make safe changes in controller operation algorithm, using a simple user interface, bypassing the need for teaching them how to work with CannyLab.

EEPROM Non-volatile Memory

Main article: CANNY 5.3 Pico, EEPROM Driver

To eliminate loss of critical information (controller’s state, external device status, etc.) in case of a power failure, the CANNY 5.3 Pico controller is equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.

There are 64 16-bit non-volatile memory cells, which are accessed by using the corresponding input and output registers.

Note: Working with non-volatile memory does not require any special pre-configuration.

Analog-to-digital converter (ADC)

Main article: CANNY 5.3 Pico, ADC Driver

CANNY 5.3 Pico supports Analog-to-Digital Converter (ADC) mode for one special pin (contact #6) of the connector X1. This ADC converter can be used to measure the input voltage from 0 to 5V with a 12-bit resolution and 1 millisecond sample rate.

ADC driver is always active.

Specifications

Electrical characteristics and environmental requirements

Electrical characteristics and environmental requirements
Parameter Values
Supply voltage 7…16 V
Current consumption: in operation (no more than): 22 mA
in power saving mode (not more): 1 mA
The maximum current of each channel in output mode +100 mA / -100 mA
Operating temperature range -40°С…+85°С
Ingress Protection Rating IP50

Electrical circuit protections:

  • from channel short-circuit - software;
  • from channel overload - internal current-limiting fusible resistors;
  • from power supply polarity reversal - internal diode;
  • high emissions suppression circuit during inductive loads switching on channels 8, 9, 10 - diode and varistor.

Safety Precautions

The circuits of the controller do not have life-threatening voltage. Controller open terminals are under voltage during operation. Any connections to the controller as well as maintenance are to be done only with the power off to both the controller and connected devices.

Installation and connection

Installation and connection of the controller must be carried out only by qualified personnel who studied this documentation. Controller installation must be carried out in conditions suitable to operation of the controller.

Do not allow moisture to come in contact with output terminals and internal elements of the controller. It is forbidden to use the controller in the presence of ambient acids, alkalis, and other corrosive substances in the air.

Installing the controller and laying cables connected to it must be done at a distance of no less than 0.3 meters from high-voltage power lines and strong electromagnetic sources - power relays, contactors, gas discharge lamps. Avoid getting moisture on the controller enclosure at the installation site.

Transportation and storage

Controllers may be transported by all types of covered transportation . Place and secure the shipping container with packed devices in vehicles in such a way as to provide their stable position and to prevent movement during transport.

Transportation and storage should be carried out at ambient temperatures from -40 to +85 ° C and relative humidity - up to 80%, compliance with security measures of protection from shock and vibration. The air must not contain acids, alkalis and other aggressive substances. Controllers should be stored on shelves.

SEE ALSO