dsPIC30F Demonstration Program Operation
3.4.2
Main Loop Code Execution
The step-by-step Main Loop execution sequence is shown in Table 3-4.
TABLE 3-4:
Seq
MAIN LOOP CODE EXECUTION SEQUENCE
Program Task
1
2
3
4
5
6
7
8
9
10
? 2006 Microchip Technology Inc.
12-bit ADC collects 256 samples from the digital potentiometer output on AN3 into
a RAM buffer. It also collects one sample each from AN4 (RP2), AN5 (RP3), AN6
(RP1) and AN8 (Temperature Sensor U9). All A/D conversions are performed in
an interrupt-driven configuration.
Buffered data set is filtered using an IIR filter to remove line noise. The filter can
be changed to an FIR filter or no filter from the DSP menu options. The filtering
operation is benchmarked using the Timer4/5 pair.
A complex in-place 256-point FFT is performed on the filtered data set, resulting
in complex frequency data (x + jy). This operation is benchmarked using the
Timer4/5 pair.
Squared magnitude is computed for each frequency bin in an in-place fashion
(x 2 + y 2 ).
The magnitude data is run through a routine that returns the frequency bin and
magnitude of the largest element.
The magnitude of the largest element is compared against a threshold and
captured if it is greater than the threshold so that low-level noise does not show
up as a frequency estimate. (Provides a simplified peak-detection algorithm.)
If a Timer3 count has expired, a software flag is set to inform the CPU that the
results recorded may now be displayed. This ensures that the CPU refreshes the
display buffers.
Any user choices entered via the switches SW1-SW4 are checked and the new
user selections are applied. May involve a change of display screen or some
parameter displayed on the LCD.
The changes are communicated to the PIC18F242 LCD controller via the SPI 2
module.
In the special case of the DTMF menu, the main routine may also kick off the DCI
module operation when the user requests DTMF tone generation.
DS70099D-page 37
相关PDF资料
DM330012 KIT USB STARTER FOR DSPIC33E
DM330013 MICROSTICK DSPIC33F/PIC24H BOARD
DNET1 SURGE SUPPRESSOR ETHERNET RJ45
DR-8094 RACK DOUBLE 84"X20.25"X36" BLK
DR-IAC5E INPUT MODULE AC 5VDC
DRIDC24A INPUT MODULE DC 34MA 24VDC
DRODC24 OUTPUT MODULE DC 13MA 24VDC
DRR-40A MODULE REDUNDANCY 40A DIN RAIL
相关代理商/技术参数
DM300027 功能描述:开发板和工具包 - PIC / DSPIC 16-bit Starter Demo Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM-3-000-K 制造商:PacTec 功能描述:Case, Plastic; ABS; Black; 11.46 in.; 3.38 in.; 10.4 in.; UL 94-HB Rated 制造商:PacTec 功能描述:ENCLOSURE, DESKTOP, PLASTIC, BLACK; Enclosure Type:Desktop; Enclosure Material:Plastic; Body Color:Black; External Height - Imperial:3.38"; External Height - Metric:86mm; External Width - Imperial:10.4"; External Width - Metric:264mm;RoHS Compliant: Yes
DM-300-C 制造商:Greenlee Textron Inc 功能描述:DMM 1000V RMS
DM-301 制造商:Labfacility Limited 功能描述:SENSOR PT100 THIN FILM 2X2.3MM CL B 制造商:LABFACILITY 功能描述:SENSOR, PT100, THIN FILM, 2X2.3MM, CL B 制造商:LABFACILITY 功能描述:TEMPERATURE RTD SENSOR, -70C to +500C, 100 OHM; Sensing Temperature Min:-70C; Sensing Temperature Max:+500C; Resistance:100ohm; Sensor Terminals:Through Hole; Temperature Sensing Range:-70C to +500C ;RoHS Compliant: Yes
DM30103J 制造商:ELMCO 功能描述:
DM30113G 制造商:n/a 功能描述:DM30X311 S7C8B
DM30-113G 制造商:n/a 功能描述:DM30X311 S7C8B
DM30133J 制造商:n/a 功能描述:DM30X313 S7C8B