⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example-5.txt

📁 DSP TMS320 LF2407 or 243 经典 例程, from TI
💻 TXT
字号:
Example 5 : F243ADC 

  

Hardware- Environment : 

This example runs on TI's evaluation board EVM TMS320F243 with additional glue hardware connected to the external board connectors P1 to P4. Again we use the general purpose IO's Port D0..D7. Each Pin of Port D is used as output, connected with a resistor R1 (1,5k) to the basis of an npn-general purpose transistor. The emitter of this npn is connected to ground, the collector to the cathode of a LED. The anode of the LED is connected with an resistor R2 (220 Ohm) to Vcc. 
For this particular example we have to add two potentiometers(22k) to the board. Pin 1 of this potentiometers connects to Vcc, Pin 3 to ground and the middle Pin 2 to the inputs of ADCIN0 and ADCIN1 (external connector P2-pin5 and P2-pin6). Thus we can sweep the analogue input voltage between Vcc and ground.


Aim: 

The program converts the analogue inputs from ADCIN0 and ADCIN1 and shows the result as a 'light-beam' on the 8 LED's connected to GPIO-D0...D7 in an endless loop. The conversion  starts each time when the general purpose timer GPT1 reaches its period. This is done by using the autostart function for the AD-Converter ( 'start on GPT1-period-event' in register GPTCON). The results are stored in two global variables by using the ADC's Interrupt Service Routine.  

Files: 

Generate a new project inside Code Composer, the GO-DSP integrated design environment. The project consists of the following files, all files can be downloaded ( see zip-file ) 

  f243adc2.c      -- C-source code for this example 

 vectors.asm     -- jump table for Interrupt Service Routines 

 regs243.h         -- pointer definitions to memory mapped  perihperals 

 f243adc.cmd    -- memory map definition file for the linker 

 init243.gel       -- Code Composer Setup file ( GO-DSP extension language ) 

 rts2xx.lib        -- runtime library file (part of TI's compiler/assembler) 

 wait.asm     -- small collection of supplemental assembler functions 


    Download (all files zipped):   Example 5

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -