TLE94112

This module is used to initialize and setup an Infineon TLE94112. For testing I used a NUCLEO-STM32F401 + Infineon Shield with the TLE94112 (About Modules) module.

Required Resources

This module require the following resources:

  • SPI Interface
  • Chip select pin
  • Chip Enable pin

How to use my module

A5, A6 and A7 are the SPI Interface (SPI1), B6 is the chip select and A9 Chip enable.

SPI1.setup({sck:A5, miso:A6, mosi:A7, baud:integer=1000000, mode:integer=1, order:'lsb' });
var TLE = require("TLE94112").connect(SPI1, B6, A9);
TLE.enable();
TLE.setPWMSource(1,1);
TLE.setPWMFrequency(1,3);
TLE.setDutyCycle(1, 240 ); // Set duty cycle of PWM channel to 90 %
TLE.setDirection(1,1);

Display device status

TLE.logCtrlReg();
TLE.logSysDiag();

Shutdown

This will stop the complete chip. Enter this also on command line to stop during testing.

TLE.disable();

Reference

/* Connect the TLE94112 to the SPI interface.
tlespi = SPI interface, psck, pmiso and pmosi have to be connected to this interface 
pcsp  = Pin chip select 
pen  = Pin enable
*/
exports.connect = function (tlespi, pcsp, pen) { ... }

// enable TLE94112 chip. All registers will have their reset value.
TLE94112.prototype.enable = function () { ... }

// disable TLE94112 chip. The chip will enter power done mode
TLE94112.prototype.disable = function () { ... }

// send a data byte to the defined register on available device
TLE94112.prototype.writeRegister = function (addr, data) { ... }

// read a register from SPI
TLE94112.prototype.readRegister = function (addr) { ... }

/* Set duty cycle,
Channel should between 1 and 3, 
Value 0..255 -> 0% - 100%
*/
TLE94112.prototype.setDutyCycle = function (Channel, Value) { ... }

/* set PWM Soruce for a motor.
Motor 1..6, Source 1..3
*/
TLE94112.prototype.setPWMSource = function (Motor, PWMCh) { ... }

/* set Half Bridge configuration, if all HB used for motor control
Motor 1..6, Dir 0 = Stop, 1 = Right, 2 = Left
*/
TLE94112.prototype.setDirection = function (Motor, Dir) { ... }

/* set PWM Frequency
Channel 1 - 3
FReqnecy
0 - off
1 - 80 Hz
2 - 100 Hz
3 - 200 Hz

Channel 4 is used for modulation.
00B No modulation (default)
01B Modulation frequency 15.625kHz
10B Modulation frequency 31.25kHz
11B Modulation frequency 62.5kHz
*/
TLE94112.prototype.setPWMFrequency = function (Channel, Freq) { ... }

// Read all overcurrent flags and return as one value.
TLE94112.prototype.getOvercurrentFlags = function () { ... }

// Read all open load flags and return as one value
TLE94112.prototype.getOpenLoadFlags = function () { ... }

// Dump all Control registers
TLE94112.prototype.logCtrlReg = function () { ... }

// Dump all Diagnose registers
TLE94112.prototype.logSysDiag = function () { ... }

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.