Learning Resources: Cape Technology in DSP TMS320F28335, CCS6.0.0
1. The introduction and use of the board's features
Main features: motor control, enhanced PWM.
Usage: CCS installation software, the installation DSP emulator driver, and power boards connected to the PC via the emulator.
2. DSP TMS320F28335 Introduction
2.1 Naming
TMS: Prefix (qualified device), 320: Serial No. (DSP Family), F: Process (Flash EEPROM), 28335: device type, PGF: package (176 pin QFP), A: temperature range (40 to 85 deg.] C).
The main features of the kernel 2.2 F28335
- DSP and microcontroller integrated strengths, the F28335 can be completed in 32 × 32-bit multiply-accumulate operations within one cycle or two 16 × 16-bit multiply-accumulate operations;
- Fast interrupt response;
- It can be a single-cycle read at any memory location, modify, write operation;
- Can be C / C ++ programming efficiency is very high.
The main resource of 2.3 F28335 processor
- The DSP 32-bit floating point, clocked at 150MHz, easy motor control, power control and industrial control devices;
- On-chip memory: Flash - 256K × 16 bit, SRAM - 34K × 16 bit, BOOT ROM - 8K × 16 bit, OPT ROM - 2K × 16 place;
- On-chip peripherals: PWM - 18 Road, HRPWM - 6 Road, CAP - 6 Road, QEP - 2 Channel, ADC - 2 × 8-channel, 12-bit, 80ns conversion time, 0 ~ 3V range high (Acquisition voltage may outer portion is pressed), SCI - 3 channels, MCBPS - 2 channel, cAN - 2 channel, SPI - 1 channel, I2C - 1 channel, an external memory expansion interface --XINTF, general purpose input / output IO --88 a watchdog circuit.
Comparison with 2812:
2.4 pinout
- JTAG pins: burning program, burn to debug RAM, ultimately burn to Flash;
- Clock pin: X1, X2;
- Reset pin: XRS;
- Power pin: VDD, VSS ...;
- ADC signal pin: 16;
- Peripherals and GPIO signal pins.
2.5 F28335 what to do
- Automation Technology;
- Intelligent measuring instruments;
- Household, commercial electronic products;
- communication;
- Military field.
3. Minimum System Introduction
3.1 Minimum system components
1. The power supply circuit
Two supply terminal → → turn pressure switch. D8 for the indicator.
Analog, digital isolation.
2. The reset circuit
Manual reset RST1, XRS directly to ground. Capacitor charging circuit: POR.
3. The crystal oscillator circuit
System clock.
30MHz, X1 and X2 connected to oscillator, XCLKIN ground.
4. Download circuit
With JTAG downloader.
C_D3.3V pull, GND pull down.
3.2 F28335 startup mode
TMS320F28335 supports multiple startup mode.
By four DIP selection of 16 Start:
4. CCS6 import project
Project→Import CCS Projects…
View→Project Explorer
View→Target Configuration
Test Connection: test whether the connection is successful.
Compile, debug.
The memory and the register
5.1 Memory Map
Address to memory allocation is the process of mapping the memory.
1. Memory allocation
There 256K × 16 bits on F28335 FLASH chip, 34K × 16 bit SARAM, 8K × 16 bit BOOT ROM, 2K × 16-bit OPT ROM, uniform addressing mode (program, data and I / O uniform addressing) , thereby improving the utilization of storage space, facilitate the development of the program. In addition, F28335 also provides a parallel external expansion interface XINTF, storage space can be further extended.
2. F28335 memory features
F28335 is enhanced using a multi-stage pipeline Harvard bus configuration, concurrent access to programs and data storage space.
(1) piece SARAM
(2) Boot ROM
(3) On-chip OTP and FLASH
flash partition :( total 256K × 16)
3. Code Security Module
Via a 128-bit code (equivalent to 8 16-bit words) to the security zone to be encrypted or decrypted. This password is saved in the last eight words in FLASH (0X33FFF8-OX33FFFF), i.e. in the password area (PWL), a password matching (PMF), the device can be unlocked.
Full 1 indicates no encryption, all-0 can not be unlocked.
4. The external memory interface XINTF
5.2 Register and register map
#Pragma DATA_SECTION by the pre-command and the defined registers assigned to the respective memory cell, and then these registers can be operated by the C language.
Let's say we find this unit 0x007010 address, you can understand that a review of the datasheet This unit is a system control register functions. Therefore, in order to better distinguish between functions of this unit and to facilitate the subsequent program development, the unit can give an alias SysCtrlRegs, then this is SysCtrlRegs register, and the register address is 0x007010. This process is mapped registers.
5.3 How to access the contents of the register
For GPIO control register, which can be seen by querying the first address data sheet is 0x006F80, and then using #pragma DATA_SECTION actual register storage unit defined association.
#pragma DATA_SECTION(GpioCtrlRegs,"GpioCtrlRegsFile");
volatile struct GPIO_CTRL_REGS GpioCtrlRegs;
This definition can be found at DSP2833x_GlobalVariableDefs.c file.
GpioCtrlRegsFile is defined within the SECTIONS, this definition can be found at DSP2833x_Headers_nonBIOS.cmd file.
GPIO Data Register GPIO_DATA_REGS:
struct GPIO_DATA_REGS { union GPADAT_REG GPADAT; // GPIO Data Register (GPIO0 to 31) union GPADAT_REG GPASET; // GPIO Data Set Register (GPIO0 to 31) union GPADAT_REG GPACLEAR; // GPIO Data Clear Register (GPIO0 to 31) union GPADAT_REG GPATOGGLE; // GPIO Data Toggle Register (GPIO0 to 31) union GPBDAT_REG GPBDAT; // GPIO Data Register (GPIO32 to 63) union GPBDAT_REG GPBSET; // GPIO Data Set Register (GPIO32 to 63) union GPBDAT_REG GPBCLEAR; // GPIO Data Clear Register (GPIO32 to 63) union GPBDAT_REG GPBTOGGLE; // GPIO Data Toggle Register (GPIO32 to 63) union GPCDAT_REG GPCDAT; // GPIO Data Register (GPIO64 to 95) union GPCDAT_REG GPCSET; // GPIO Data Set Register (GPIO64 to 95) union GPCDAT_REG GPCCLEAR; // GPIO Data Clear Register (GPIO64 to 95) union GPCDAT_REG GPCTOGGLE; // GPIO Data Toggle Register (GPIO64 to 95) Uint16 rsvd1[8]; };
union GPCDAT_REG { Uint32 all; struct GPCDAT_BITS bit; };
all for the overall operation of the 32-bit, bit for bit operation is generally used.
struct GPCDAT_BITS { // bits description Uint16 GPIO64:1; // 0 GPIO64 Uint16 GPIO65:1; // 1 GPIO65 Uint16 GPIO66:1; // 2 GPIO66 Uint16 GPIO67:1; // 3 GPIO67 Uint16 GPIO68:1; // 4 GPIO68 ... Uint16 GPIO87:1; // 23 GPIO87 Uint16 rsvd1:8; // 31:24 reserved };
So let GPIO68 outputs a low level language may be used to call a member of the body structure C, as follows:
= GpioDataRegs.GPCCLEAR.bit.GPIO68 . 1 ; // set the low signal is output GPIO
6. Create a Project Template
6.1 basis for obtaining documents
TI header file Download: http://www.ti.com/tool/CONTROLSUITE?keyMatch=controlsuite&tisearch=Search-EN
Directory: \ device_support \ f2833x \ v141
\DSP2833x_common\cmd:
28335_RAM_lnk: simulation debugging, F28335: burn to Flash.
\ DSP2833x_common \ include: headers; \ DSP2833x_common \ lib: arithmetic library file; \ DSP2833x_common \ source: the source file.
\ DSP2833x_headers \ cmd: whether to use the operating system.
\ DSP2833x_headers \ include: headers; \ DSP2833x_headers \ source: global definition.
6.2 New Project
Project→New CCS Project…
Auto-generated files:
A complete basic engineering of the configuration file:
- You first need to debug or emulation flash .cmd file and DSP BIOS or nonBIOS .cmd file the required programming;
- Secondly, we need to use the chip .ccxml target profile;
- Chip core and peripheral .c source file, such DSP2833x_Gpio.c, DSP2833x_PieCtrl.c the like;
- Peripheral chip core and a .h file, such DSP2833x_Gpio.h, DSP2833x_PieCtrl.h the like;
- DSP .lib library files, frequently used as IQmath.lib and so on.
6.3 Add Files
Right-click User → New → Source File → main.c
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File #include "DSP2833x_Examples.h" // DSP2833x Examples Include File void main() { }
Right-click the project → Properties → Include Options: Add the corresponding header file path.
Engineering structures:
│ .ccsproject
│ .cproject
│ .project
│ 28335_RAM_lnk.cmd
│ F28335.cmd
│
├─.settings
│ …
│
├─APP
├─Debug
│ …
│
├─include
│ DSP2833x_Adc.h
│ DSP2833x_CpuTimers.h
│ DSP2833x_DefaultIsr.h
│ DSP2833x_DevEmu.h
│ …
│
├─Libraries
│ DSP2833x_ADC_cal.asm
│ DSP2833x_CodeStartBranch.asm
│ DSP2833x_DefaultIsr.c
│ DSP2833x_GlobalVariableDefs.c
│ DSP2833x_Gpio.c
│ DSP2833x_Headers_nonBIOS.cmd
│ DSP2833x_PieCtrl.c
│ DSP2833x_PieVect.c
│ DSP2833x_SysCtrl.c
│ DSP2833x_usDelay.asm
│ IQmath.lib
│
├─targetConfigs
│ readme.txt
│ TMS320F28335.ccxml
│
└─User
main.c