Hi,

I wrote the following to the tinyos-devel list a few days ago but got no
answer:

The i2c driver for msp430f1611 is broken if you use mspgcc 4.5.3 or 4.6.3 .

The i2c data register I2CDR in tos/chips/msp430/usart/HplMsp430I2C0P.nc
is no longer defined in the new (TI) header files. Therefor I2CDR is
placed somewhere in RAM instead at register address 0x0076. The new
header files define I2CDRB and I2CDRW.

app.c excerpt:

# 49 "/opt/tinyos2/tos/chips/msp430/usart/HplMsp430I2C0P.nc"
static volatile uint8_t HplMsp430I2C0P__U0CTL __asm ("0x0070");
static volatile uint8_t HplMsp430I2C0P__I2CTCTL __asm ("0x0071");

static volatile uint8_t HplMsp430I2C0P__I2CDR __asm ("I2CDR_");

static volatile uint16_t HplMsp430I2C0P__I2CSA __asm ("0x011A");
static volatile uint8_t HplMsp430I2C0P__I2CIE __asm ("0x0050");


msp430-objdump -t main.exe gives

SYMBOL TABLE:
...
0000111a l     O .bss   00000001 I2CDR_
...
00000076 g       *ABS*  00000000 __I2CDRW
...
00000076 g       *ABS*  00000000 __I2CDRB


3 byte quick fix: change I2CDR to I2CDRB

Best,
Jonas


--
_______________________________

Jonas Meyer

Decentlab GmbH
Überlandstrasse 129
CH-8600 Dübendorf

Phone +41 44 809 35 99
[email protected]

www.decentlab.com
_______________________________






diff --git a/tos/chips/msp430/usart/HplMsp430I2C0P.nc b/tos/chips/msp430/usart/HplMsp430I2C0P.nc
index 8aa5aea..bcfd7d8 100644
--- a/tos/chips/msp430/usart/HplMsp430I2C0P.nc
+++ b/tos/chips/msp430/usart/HplMsp430I2C0P.nc
@@ -45,10 +45,10 @@ module HplMsp430I2C0P @safe() {
 }

 implementation {
-
+
   MSP430REG_NORACE(U0CTL);
   MSP430REG_NORACE(I2CTCTL);
-  MSP430REG_NORACE(I2CDR);
+  MSP430REG_NORACE(I2CDRB);
   MSP430REG_NORACE(I2CSA);
   MSP430REG_NORACE(I2CIE);

@@ -147,8 +147,8 @@ implementation {
   async command void HplI2C.setStartBit() { I2CTCTL |= I2CSTT; }

   // I2CDR
-  async command uint8_t HplI2C.getData() { return I2CDR; }
-  async command void HplI2C.setData( uint8_t v ) { I2CDR = v; }
+  async command uint8_t HplI2C.getData() { return I2CDRB; }
+  async command void HplI2C.setData( uint8_t v ) { I2CDRB = v; }

   // I2CNDAT
   async command uint8_t HplI2C.getTransferByteCount() { return I2CNDAT; }
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to