ADC 400F Spezifikationen Seite 11

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 26
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 10
7
The user can put channel select and ADC mode control data into the holding register within the microcontroller, via the
8-bit wide port A bidirectional I/O port, using a bank of eight toggle switches as shown in Figure 9. Alternatively, the
mode and channel data can be sent to the microcontroller holding register via the asynchronous serial communications
interface (SCI). This option is available only on those versions of the TMS370, such as the TMS370C020, which include
both SPI and SCI interfaces. Additional software to control the SCI must be appended to the software shown in List 1
to provide this method of control.
List 1
LINE LOC OBJ SOURCE
1 ;* * * * * * * * * * * * * * * *
2 ;* *
3 ;* TLC2543 to TMS 370Cx10 Interface Program *
4 ;* *
5 ;* This program reads channel select and mode *
6 ;* control data (provided by toggle switches) *
7 ;* into the microcontroller, using subroutine *
8 ;* DATAIN. *
9 ;* It then provides the control signals to *
10 ;* the TLC2543 to perform a 12 bit analog to *
11 ;* conversion, using subroutine ADC. It *
12 ;* finally stores the MSByte and LSByte of *
13 ;* each conversion in consecutive even and *
14 ;* odd number registers respectively starting *
15 ;* at R64 corresponding to channel 0, using *
16 ;* subroutine STORE. *
17 ;* * * * * * * * * * * * * * * *
18 0030 SPICCR .EQU P030 ;* * * * * * * *
19 0031 SPICTL .EQU P031 ;* *
20 0037 SPIBUF .EQU P037 ;* *
21 0039 SPIDAT .EQU P039 ;* *
22 003d SPIPC1 .EQU P03D ;* *
23 003e SPIPC2 .EQU P03E ;* Name Peripheral *
24 003f SPIPRI .EQU P03F ;* Registers *
25 0021 APORT2 .EQU P021 ;* *
26 0022 ADATA .EQU P022 ;* *
27 0023 ADIR .EQU P023 ;* *
28 002c DPORT1 .EQU P02C ;* *
29 002d DPORT2 .EQU P02D ;* *
30 002e DDATA .EQU P02E ;* *
31 002f DDIR .EQU P02F ;* * * * * * * *
32 7ffe RESET .EQU 7FFEH ;Reset vector named
33 2e CSBIT .DBIT 7,DDATA ;TLC2543 Chip Select bit
34 ;named CSBIT
35 ;
36 ;
37
38 4000 .TEXT 4000H ;Start program at 4000H
39 ;Main Program
40 4000 5260 START MOV #60H,B ;
41 4002 fd LDSP ;Set SP to address 60H
42 4003 * 88400000 MOVW #4000H,A
43 4007 8b7ffe MOV A,RESET ;Set reset vector
44 400a b5 CLR A
45 400b 2121 MOV A,APORT2
46 400d 2123 MOV A,ADIR
47 400f f7802f MOV #080H,DDIR
48 4012 2280 MOV #80H,A
49 4014 2130 MOV A,SPICCR
50 4016 2207 MOV #07,A ;Configure SPI for 8–bit
51 4018 2130 MOV A,SPICCR ;character length.
52 401a 2203 MOV #03,A ;Configure SPICLK
53 401c 213d MOV A,SPIPC1 ;function and direction.
54 401e 2222 MOV #22H,A ;Configure SPISOMI and
55 4020 213e MOV A,SPIPC2 ;SPISIMO pin functions.
56 31 SPIF .DBIT 6,SPICTL ;SPI INT FLAG named SPINTF
57 0b MSLSB .DBIT 1,R11 ;Bit 1 of R11 named MSLSB
58 4022 ’8e402d CALL DATAIN
59 4025 ’8e403e CALL ADC
60 4028 ’8e409d CALL STORE
Seitenansicht 10
1 2 ... 6 7 8 9 10 11 12 13 14 15 16 ... 25 26

Kommentare zu diesen Handbüchern

Keine Kommentare