Forum: Mikrocontroller und Digitale Elektronik SBC65EC mit LM75 Sensor


von gibata (Gast)


Lesenswert?

Hallo zusammen,

Ich versuche seit 1 Woche einen LM75 Temp. Sensor an einen SBC65EC von 
Modtronix zum laufen zu bekommen, leider ohne erfolg. Vieleicht ist ja 
hier jemand der bereits damit Erfahrung hat und mir helfen kann.

Ich verwende die letzte FW und HW Version.

Folgendes habe Ich in der mxwebsrvr.c stehen btemp1 und 2 sind vom Typ 
unsigned char:
1
i2cOpen(I2C_MASTER, I2C_SLEW_OFF, 400000);
2
while(1)
3
    {
4
        aliveCntrMain = 38;     //Reset if not services in 52.42ms x 38 = 2 seconds
5
6
        //Blink SYSTEM LED every second.
7
        if (appcfgGetc(APPCFG_SYSFLAGS) & APPCFG_SYSFLAGS_BLINKB6) {
8
            //Configure RB6 as output, and blink it every 500ms
9
            if ( TickGetDiff8bit(t) >= ((TICK8)TICKS_PER_SECOND / (TICK8)2) )
10
            {
11
                t = TickGet8bit();
12
                
13
                //If B6 is configured as input, change to output
14
                if (appcfgGetc(APPCFG_TRISB) & 0x40) {
15
                    appcfgPutc(APPCFG_TRISB, appcfgGetc(APPCFG_TRISB) & 0b10111111);
16
                }
17
          
18
                TRISB_RB6 = 0;
19
                LATB6 ^= 1;     //Toggle
20
                
21
                //Toggle IOR5E LED, if IOR5E is present
22
                if (appcfgGetc(APPCFG_XBRD_TYPE) == XBRD_TYPE_IOR5E) {
23
                    ior5eLatchData.bits.ledPWR ^= 1;    // Toggle
24
                }
25
26
            }
27
      
28
        }
29
    // Read LM75 Temperature
30
    if ( TickGetDiff8bit(tc) >= 2500 )
31
        {
32
      i2cWaitForIdle(); 
33
34
      i2cPutStartAndWait();         // begin I2C communications
35
        i2cPutByte( 0x90 );   // addresses the chip
36
      i2cPutByte( 0x00 );   // write register address
37
        i2cPutStopAndWait();          // Stop condition I2C on bus
38
39
      i2cPutStartAndWait();         // Start condition I2C on bus
40
        i2cPutByte( 0x91 );   // addresses the chip with a read bit
41
      btemp1 = i2cGetByte(0);  // read first byte and store in byte1
42
      
43
      btemp2 = i2cGetByte(1);  // read second byte and store in byte2
44
          
45
        i2cPutStopAndWait();          // Stop condition I2C on bus
46
47
      tc = TickGet8bit();
48
    }


Und das steht in der cmd.c bytemp1 und 2 stehen hier als extern unsigned 
char:
1
else if (tagGroup == CMDCODE_ONEWIRE)
2
    {
3
     *pGetTagInfo->val = cmdGetWordVar(ref, pGetTagInfo->val, btemp1);   
4
    }
5
6
    pGetTagInfo->ref = HTTP_END_OF_VAR;   
7
    return 0;   //No bytes was written
8
}


Leider bekomme Ich es nicht zum laufen kann mir jemand bitte helfen?

von gibata (Gast)


Lesenswert?

Sorry kleiner Nachtrag es heist natürlich
i2cOpen(I2C_MASTER, I2C_SLEW_OFF, 24);

von gibata (Gast)


Lesenswert?

Keiner der helfen kann?

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.