Renesas Renasas Single-Chip Microcomputer SH7086 Bedienungsanleitung Seite 17

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 21
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 16
SH7080 Group
A/D Conversion in Single-cycle Scan Mode
REJ06B0699-0100/Rev.1.00 January 2008 Page 15 of 19
6. Flowchart
A flowchart for this sample application is shown below.
6.1 Main Routine
main ()
ad_conv ()
ad_conv ()
ad_conv ()
Initialize A/D
conversion counter
Initialize A/C
conversion
channel numbers
Set the frequency
control register
(FRQCR)
Set the standby
control register 4
(STBGR4)
Set the A/D
Control/Status
Register 0
(ADCSR_0)
Set the A/D
Control/Status
Register 0 (ADCR_0)
Internal clock: 80 MHz
Bus clock: 40 MHz
Peripheral clock: 40 MHz
MTU2S clock: 80 MHz
MTU2 clock: 40 MHz
Set MSTP16 of STBCR4 to 0.
[Function]
Supplying clocks to A/D_0.
- Clear the A/D end flag (ADF) to 0.
[Function]
Clearing the A/D end flag.
- Clear the A/D interrupt enable bit (ADIE) to 0.
[Function]
Disabling ADI interrupt.
- Clear the trigger enable bit (TRGE) to 0.
[Function]
Disabling trigger for starting A/D conversion.
- Clear the state control bit (STC) to 0.
[Function]
Setting A/D conversion time to 50 states.
- Set the clock select bits (CKSL) to 00.
[Function]
Setting A/D conversion time to Pφ/4.
- Set the A/D mode bits (ADM) to 01.
[Function]
Setting A/D conversion mode to 4-channel scan mode.
- Clear the A/D continuous scan bit (ADCS) to 0.
[Function]
Setting single-cycle scan mode.
- Set channel select bits (CH) to 011.
[Function]
Setting channels to AN0-AN3.
Clear the A/D start bit (ADST) to 0.
Perform A/D conversion and store the result to the RAM.
Seitenansicht 16
1 2 ... 12 13 14 15 16 17 18 19 20 21

Kommentare zu diesen Handbüchern

Keine Kommentare