Welcome to the Industrial Automation website!

NameDescriptionContent
HONG  KANG
E-mail  
Password  
  
Forgot password?
  Register
当前位置:

TI C2000 CLA Software Development Guide

来源: | 作者:FANS | 发布时间 :2026-05-14 | 15 次浏览: | 🔊 Click to read aloud ❚❚ | Share:

Instruction set relationship

The CLA instruction set is a subset of the C28x+FPU instruction set, but with a small number of unique instructions. For example, CLA does not support Repeat Block Instructions (RPTB), but supports some local integer operation instructions (AND, OR, XOR, ADD, SUB, shift) as well as local branch/call/return instructions.

List of Key Differences

Project CLA C28x+FPU

Execution method independent of C28x parallel running and C28x fixed point instruction sharing pipeline

4 floating point registers (MR0-MR3) and 8 registers (R0H-R7H)

Two 16 bit auxiliary registers (MAR0, MAR1) and eight 32-bit registers (XAR0-XAR7)

Pipeline 8 stages, completely independent 8 stages, finger/decoding and fixed point sharing

Single step behavior: The pipeline advances 1 cycle and completely refreshes the pipeline

Direct and indirect incremental addressing modes, all C28x addressing modes without data page pointers

The interrupt source comes directly from the peripheral (device related) and is extended through PIE

Task nesting Type0/1 is not supported; Type2 supports Level 1 background software to enable nesting

Floating point multiplication/conversion 1 cycle, 2p cycles without delay slots (2 cycles with delay slots)

Repetitive instructions are not supported and support repeated MACF32 and RPTB

Share RAM, message RAM, and interrupt with C28x communication on the same CPU internal register copy

Program memory access limited to CLA program/data/message RAM, all memory

Performance benchmark considerations

For mathematical functions such as division, sine, cosine, etc., the instructions of CLA and C28x+FPU are not completely equivalent. The difference comes from:

The cycle difference between multiplication and type conversion (CLA single cycle, FPU 2p cycle, but FPU can arrange another instruction in the delay slot).

The difference between branch and call instructions (CLA supports delayed branch, where the three instructions before and after the branch are always executed, requiring developers to fill the delay slot reasonably to improve performance).

Register resource difference (CLA only has 4 floating-point registers, making it more prone to register overflow).

There are fewer addressing modes, which may add additional data movement instructions.

Therefore, the actual acceleration effect depends on the specific structure of the code. For control algorithms that can fully utilize CLA's independent parallelism and no delay slot waste, CLA typically brings significant acceleration.


Method for measuring the execution time of CLA tasks

Accurate measurement of CLA task time is crucial in real-time systems. Recommend the following two methods:

Method 1: Use PWM counter

CLA can access the counter of ePWM module (TBCTR). Read the counter values at the beginning and end of the task and calculate the difference:

uint16_t ct1, ct2, delta;ct1 = EPwm1Regs.TBCTR;//Measured codect2 = EPwm1Regs.TBCTR;delta = ct2 - ct1;

Pay attention to handling counter overflow situations (using unsigned subtraction to automatically modulo). This method has extremely low overhead, but its resolution is limited by the ePWM clock frequency.

Method 2: Utilize GPIO pins

If CLA can directly access GPIO (with device support), the pin can be set high before the task starts and low at the end, and then the duration of high level can be measured with an oscilloscope. This method is intuitive and not affected by counter overflow, but introduces additional GPIO operation instructions that require evaluation of testing accuracy.

Consider the cost of triggering and completing notifications

There is a fixed overhead for CLA task start and end notifications. To accurately measure the pure algorithm execution time, it is recommended to use an idle timer on C28x to record the entire cycle from software triggering to MIRUN flag clearing, and then subtract the CLA task external overhead (which can be measured in an empty task).


How to terminate CLA task for C28x

In certain abnormal situations, the main CPU needs to forcibly terminate the running CLA task.

If a task has been triggered but has not yet started execution, the main CPU can cancel the task by clearing the corresponding flag bit through the MICLR register.

If the task is already in progress, a Soft Reset signal can be written to the MCTL register, which will terminate the current task and clear the MIER register. To completely reset all registers of CLA, the Hard Reset option can be used.

Note: Forcefully terminating may result in inconsistent data, and the CLA state should be reinitialized after resetting.


Interpretation of common linker warnings

When using the C2000 code generation tool v20.2. x LTS and above versions, the linker may issue the following warning:

"Symbol, X, referenced in a.obj, assumes that data is blocked but is accessing non-blocked data in b.obj. Runtime failures may result"

This warning is used to detect data access consistency: when a target file assumes that data is "blocked" access, while the data in another target file is defined as "non blocked" access, the linker will warn that runtime may fail. A typical scenario is when the global variables defined in CLA are used by C28x code. The solution is to ensure that the access properties of all shared data are consistent, which can be found in the compiler version release notes.

  • EUCHNER HBA-079827 Pendant Station
  • CLC-2 4L PLC Lubrication Pump
  • KEYENCE GS-51P5 Safety Switch
  • AB 442G-MABH-R Safety Switch
  • GE Fanuc VersaMax PLC Module Set
  • Siemens 6ES7214-1HF40-0XB0 CPU 1214FC
  • Microchip DSPIC30F4011-30I/P DSC
  • FANUC A20B-2102-0081 I/O Link Module
  • Endress Hauser CLS15-B1M2A Conductivity Sensor
  • B&R 3AM050.6 Analog I/O Module
  • Fanuc A16B-2201-0320 MAIN-B CPU Board
  • Pilz 475650 PNOZ 1 Safety Gate Relay
  • Omron NSH5-AL001 Handheld HMI Terminal
  • Allen-Bradley 1756-OF8 Analog Output 8 Ch
  • Siemens 6SL3210-1SE31-0AA0 45kW Power Module
  • PMA TB45-110-00000-000 Temperature Limiter
  • PSR-SCP-24DC-ESD-5x1-1x2-300 Safety Relay
  • Pilz 774140 PZE 9 24V AC Safety Relay
  • Telemecanique TSXRKN82F 8 Slot Rack
  • Mitsubishi R16CPU iQ-R PLC CPU
  • Mitsubishi A2ACPU-R21-S1 PLC CPU
  • Omron NX-AD4208 Analog Input Unit
  • Schneider LMC802CAA10000 PacDrive 3 Controller
  • Reliance Electric 0-51874 Static Sequence Card
  • Pilz 787310 PNOZ X3P C Safety Relay
  • B&R X20CP1684 CPU Module
  • Siemens 6SN1145-1BB00-0FA1 Power Module
  • Beckhoff EL3174 Analog Input EtherCAT Terminal
  • CLC-2P 4L PLC Lubrication Pump System
  • Omron CJ1W-DA08C Analog Output Unit
  • Metso Automation D201776 ACN PO DC PLC Control Server Computer
  • GE AT868 AquaTrans Ultrasonic Flow Transmitter
  • ABB PFSA107-Z42 DTU Stressometer Digital Transmission Unit
  • ABB PFSA240 3BSE073476R1 Roll DC Supply Unit
  • Fanuc A16B-2201-0320 CPU MAIN Board
  • Pilz 475650 PNOZ 1 Safety Gate Relay
  • Omron NSH5-AL001 HMI Interface Unit
  • Allen-Bradley 1756-OF8 Analog Output Module
  • Siemens 6SL3210-1SE31-0AA0 Power Module 45kW
  • PMA TB45-110-00000-000 Temperature Limiter
  • PSR-SCP-24DC-ESD-5x1-1x2-300 Safety Relay
  • Pilz 774140 PZE 9 Safety Relay
  • Telemecanique TSXRKN82F PLC Rack Chassis
  • Mitsubishi R16CPU PLC CPU Module
  • OMRON C500-PS223-E Power Supply Module
  • Siemens 3VL4731-1DC36-0AA0 Circuit Breaker
  • Siemens 7ML5201-0EA0 Ultrasonic Level Transmitter
  • OMRON NQ3 NQ5 Touch Panel HMI
  • OMRON CJ1W-AD081-V1 Analog Input Module
  • OMRON NJ301-1100 Machine Automation Controller
  • B&R X20BC00G3 EtherCAT Bus Controller
  • Schneider ATV212HD22N4S Variable Speed Drive
  • B&R 8B0C0320HW00.002-1 Power Supply Module
  • Mitsubishi OSA105S2A Incremental Rotary Encoder
  • Pilz 777514 PNOZ XV3P Safety Relay
  • Gould AS-884A-111 Modicon 884 Controller
  • Siemens 6SC6130-0FE00 SIMODRIVE Control Card
  • Omron CV500-PS221 PLC Power Supply Module
  • ABB CM577-ETH AC500 PLC Ethernet Module
  • Omron NX-SIH400 Safety Input Unit NX Series
  • Omron NJ501-1300 Machine Automation Controller
  • Siemens 3VT8563-2AA03-2KA2 Molded Case Breaker
  • Pilz PNOZ m1p ETH 773103 Safety Controller
  • Omron CJ1H-CPU66H-R CJ1 Series CPU Module
  • ASI ASI533-S00 PLC Module S1
  • Mitsubishi AJ71C21-S1 Serial Module
  • Keyence IX-1000 Laser Sensor Amplifier
  • Siemens 6SN1145-1AA01-0AA1 Power Module
  • Siemens 3VA2340-5HL32-0AA0 MCCB 400A
  • Mitsubishi OSA104S Absolute Encoder
  • Siemens 6ES7350-1AH03-0AE0 FM 350-1 Counter
  • Siemens 6SE7038-6EK84-1JC2 IGD8 Gate Driver
  • Eaton EASY819-AC-RC Programmable Relay
  • Omron CPM1A-40CDT-D PLC 24V DC
  • Omron NA5-12W101B-V1 12-inch Programmable Terminal
  • Siemens 6ES7331-7KF02-0AB0 Analog Input SM 331
  • Moxa PTC-101-S-SC-HV Photoelectric Converter
  • Fanuc A20B-3300-0031 CNC Control Circuit Board
  • OMRON NA5-7W001B-V1 Programmable Terminal HMI
  • Parker AH385851U002 590C DC Drive Power Board
  • ABB 3BSE040662R1 AI830A Analog Input Module
  • DOLD BF9250.01/001 Solid State Relay
  • Siemens 6ES7331-7KF02-0AB0 SIMATIC S7-300 SM 331
  • ABB 07AC91 I6 GJR5252300R3101 Advant Controller 31
  • Schneider HMIST6500 Touch Screen HMI
  • Phoenix IL PN BK DI8 DO4 2TX-PAC Bus Coupler
  • NLTECH NL8060AC21-21D 8.4 inch LCD Display
  • Mitsubishi A2NCPU-P21 CPU Module A2NCPUP21
  • 1841-PL1-B-LH-ES Pressure Controller
  • Mitsubishi GT2512-STBA GT2512-STBD HMI
  • Cosel PJA600F-24 24V 600W Power Supply
  • B&R X67DM1321 Digital Mixed Module
  • Fanuc A16B-1310-0010 Power Supply Unit
  • Festo VABF-S4-1-V2B1-C-VH-20 Vacuum Generator
  • Mitsubishi A3ACPUP21 A3ACPU-P21 CPU
  • Mitsubishi Mazak PD14B-1 Power Supply
  • Siemens 6SY7000-0AC80 Module
  • PILZ 774400 PDZ Safety Relay
  • Mitsubishi A1SX81 Digital Input Module
  • Asyst Gasonics R94-1163 Controller 112671
  • Cincinnati Milacron 3 545 1000A Card
  • Siemens 6DD1607-0AA2 UPS Module
  • Square D 8536SCG3V02S Motor Starter
  • Siemens 6SL3100-1DE22-0AA1 Control Supply
  • Beckhoff EL9400 EtherCAT Power Terminal
  • Fanuc A16B-2202-0421 Power Supply Board
  • Turck TBEN-LG-8DIP-8DOP I/O Block
  • Euchner MGB-L1B-PNA-L-121861 Safety Switch
  • Pilz 772170 PNOZ M EF 1MM Safety Expansion
  • Mitsubishi AY51 MELSEC-A Output Module
  • Advantech AMAX-5056-A 8-Channel Digital Output
  • NXP MC912D60ACPV8 16-Bit MCU 60KB Flash
  • Omron C500-PS223-E SYSMAC PLC Power Supply Unit
  • Balluff BNI0047 BNI PBS-302-101-Z001 Profibus Module
  • Siemens 6SN1118-0DM31-0AA0 Regulation Card
  • Bently Nevada 9200-02-01-10-00 Sensor
  • Omron C500-PS223-E Power Supply Unit
  • Cognex COG-VC5-120-000 Vision Controller
  • ABB P-HC-BRC-40000000 Bridge Controller
  • Mitsubishi AJ71E71N-B5T PLC Module
  • Phoenix PSI-REP-PROFIBUS/12MB 2708863
  • Siemens 6SL3210-5BE31-8UV0 Converter
  • ABB CI868K01-eA 3BSE048845R2 Module
  • Honeywell S7999D1006 Touch Screen
  • Keyence CA-CHX10U Repeater Unit
  • Keyence VT5-W07 Touch Screen HMI
  • Keyence KV-8000 PLC CPU
  • Siemens 7MH4900-3AA01 Weighing Module