MSP430 I2C funktioniert nicht

OP #3714820
Lesenswert?

Hi,
Ich versuche  die I2C Kommunikation mit MSP430F2013  programmieren
hier ist mein assembler  Code:
1
#include "msp430.h"  ;
2

3
       ADDR:   EQU 0x40     ; address ADDR1 and ADDR0 to GND
4
       P_Vol:  EQU 0x00; Pointer to Vobj
5
       P_Temp: EQU 0x01;  Pointer to ambient Temp
6
       P_Conf: EQU 0x02 ; Pointer to configuration
7

8

9
        RSEG    CSTACK                  ; pre-declaration of segment
10
        RSEG    CODE                    ; place program in 'CODE' segment
11
 Reset:
12
        mov.w #SFE(CSTACK), SP        ; set up stack
13
        mov.w #WDTPW|WDTHOLD,&WDTCTL  ; Stop watchdog timer
14
        bis.b #0, &DCOCTL;
15
        bic.b #RSEL0|RSEL1|RSEL2,&BCSCTL1;
16
        mov.b #SELM_3|SELS,&BCSCTL2; VCO as SMCLK,DCO as MCLK
17
        mov.b #LFXT1S_2,&BCSCTL3; USE VCO as LFXT (ACLK)
18
        mov.b #0, &P1OUT;
19
        mov.b #0, &P2OUT; low
20
        mov.b #0xFF, &P2DIR;
21
        mov.b #0xFF, &P1DIR; output
22
        mov.w #MC_0|TACLR, &TACTL; stop and clear timer
23
        bis.w #TASSEL0|TAIE, &TACTL;  CLOCK ACLK
24
        ;----------------------IIC configuation---------------------;
25

26
        bis.b #USISSEL_1|USICKPL,&USICKCTL; ACLK,  IdleState=Low
27
        bis.b #USII2C, USICTL1; I2C mode
28
        mov.b #USIPE7|USIPE6|USIMST, &USICTL0; Enable SDO/SDI/SCLK etc, master mode
29
        bis.w #MC0, &TACTL;
30
        mov.w #0x0fff, &TACCR0;
31

32

33
  Main:
34
       bis.w #GIE,SR; enable interrupts ,LPM3
35
       jmp Main;
36
  Timer:
37
       bis.w #MC_0|TACLR, &TACTL; stop and clear timer
38
       bic.w #TAIFG, &TACTL;clear flag
39
       bic.b #BIT1, &P1OUT;
40
       call #I2C_SendAddress
41
       bis.w #MC0,&TACTL; start timer
42
       reti
43
;--------------------------------------I2C procedures------------------------------------------------;
44
  I2C_SendAddress:   ; send address 1st
45
       bic.b #USI16B,&USICNT; 8 bit  shift register
46
       mov.b #0,&USISRH
47
       bis.b #BIT1, &P1OUT; Trigger signal
48
       mov.w #ADDR, &USISR; load I2C address
49
       bis.b #USIOE,&USICTL0; I2C output enable
50
       bis.b #0x8, &USICNT; output 8 Bits
51
       ret
52

53
RSEG RESET
54
DW Reset
55
RSEG INTVEC
56
ORG TIMER0_A1_VECTOR;
57
      DW Timer
58

59

60
        END

Der  Triggersignal kommt, aber die SCL und SDA schweigen.

Was mache ich falsch?

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren