Sign in

Not a member? | Forgot your Password?

Search msp430



Search tips

Subscribe to msp430



Free PDF Downloads

Advanced Linux Programming

What Every Programmer Should Know About Memory

Introduction to Embedded Systems

C++ Tutorial

Embedded Systems - Theory and Design Methodology

Discussion Groups

See Also

ElectronicsDSPFPGA

Find us on Facebook





Discussion Groups | MSP430 | I2C example

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

I2C example - km5h - Jan 14 13:47:34 2008

I am trying to use the example code in "Using the USI I2C Code Library
(SLAA368)".
They leave a some essential code necessary out so I am trying to add
the missing code. I am not a very good C programmer (yet).
Has anyone successfully used this code to control an I2C device?

Any comments would be appreciated

Thanks,
Tom Hoflich

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - km5h - Jan 14 23:10:41 2008

TxData0, TxData1, RxData, i , j, at least are not defined anywhere.

Tom
--- In m..., Aaron Greer wrote:
>
> What code do you believe is missing? I played around with that for
a bit a while back and thought it was complete.
> -Aaron
>
> ----- Original Message -----
> From: "km5h"
> To: m...
> Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700) America/Denver
> Subject: [msp430] I2C example
>
> I am trying to use the example code in "Using the USI I2C Code
Library
> (SLAA368)".
> They leave a some essential code necessary out so I am trying to
add
> the missing code. I am not a very good C programmer (yet).
> Has anyone successfully used this code to control an I2C device?
>
> Any comments would be appreciated
>
> Thanks,
> Tom Hoflich
>
>
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - old_cow_yellow - Jan 15 2:11:43 2008

Yes, there are lots of things left undefined in the examples shown in
SLAA386.pdf

Also, if you use c, make sure you use the same version of the same c
compiler the author used. Otherwise you will need to "port" the code.
(c is "portable", so you need to "port" it from compiler to compiler
and from version to version.)

--- In m..., "km5h" wrote:
>
> TxData0, TxData1, RxData, i , j, at least are not defined anywhere.
>
> Tom
> --- In m..., Aaron Greer wrote:
> >
> > What code do you believe is missing? I played around with that for
> a bit a while back and thought it was complete.
> > -Aaron
> >
> > ----- Original Message -----
> > From: "km5h"
> > To: m...
> > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700) America/Denver
> > Subject: [msp430] I2C example
> >
> >
> >
> >
> >
> >
> >
> > I am trying to use the example code in "Using the USI I2C Code
> Library
> > (SLAA368)".
> > They leave a some essential code necessary out so I am trying to
> add
> > the missing code. I am not a very good C programmer (yet).
> > Has anyone successfully used this code to control an I2C device?
> >
> > Any comments would be appreciated
> >
> > Thanks,
> > Tom Hoflich
> >
> >
> >
> >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - Aaron Greer - Jan 16 0:29:31 2008

What code do you believe is missing? I played around with that for a bit a while back and thought it was complete.
-Aaron

----- Original Message -----
From: "km5h"
To: m...
Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700) America/Denver
Subject: [msp430] I2C example

I am trying to use the example code in "Using the USI I2C Code Library
(SLAA368)".
They leave a some essential code necessary out so I am trying to add
the missing code. I am not a very good C programmer (yet).
Has anyone successfully used this code to control an I2C device?

Any comments would be appreciated

Thanks,
Tom Hoflich

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - km5h - Jan 16 11:03:10 2008

Thanks for the link. I have not had a time to work with it but will
soon. It looks like everything is there. I was doing a copy and
past out of the manual. I somehow missed the that the zip file
existed.
I have the Si570 working on a 16F88, but wanted to use the 430.

Sorry for the confusion.
Thanks again
Tom

--- In m..., Aaron Greer wrote:
>
> Tom,
> all those things look fine in my code. Do you have an old copy or
something? Did you download the code in a zip file?
> Here is where I got mine:
> http://focus.ti.com/general/docs/techdocsabstract.tsp?
abstractName=slaa368
> If you can verify that you've got the same zip file of code as me
and if you still don't see those variables defined, can you provide
more details of where you're looking?
> -Aaron
>
> ----- Original Message -----
> From: "km5h"
> To: m...
> Sent: Monday, January 14, 2008 9:08:17 PM (GMT-0700) America/Denver
> Subject: [msp430] Re: I2C example
>
> TxData0, TxData1, RxData, i , j, at least are not defined anywhere.
>
> Tom
>
> --- In m... , Aaron Greer wrote:
> >
> > What code do you believe is missing? I played around with that
for
> a bit a while back and thought it was complete.
> > -Aaron
> >
> > ----- Original Message -----
> > From: "km5h"
> > To: m...
> > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700)
America/Denver
> > Subject: [msp430] I2C example
> >
> >
> >
> >
> >
> >
> >
> > I am trying to use the example code in "Using the USI I2C Code
> Library
> > (SLAA368)".
> > They leave a some essential code necessary out so I am trying to
> add
> > the missing code. I am not a very good C programmer (yet).
> > Has anyone successfully used this code to control an I2C device?
> >
> > Any comments would be appreciated
> >
> > Thanks,
> > Tom Hoflich
> >
> >
> >
> >
> >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - old_cow_yellow - Jan 17 1:33:56 2008

If you use c, you still has to watch out for which revision of which
compiler/linker you are using.

BTW, are you using version 3 of IAR?

--- In m..., "km5h" wrote:
>
> Thanks for the link. I have not had a time to work with it but will
> soon. It looks like everything is there. I was doing a copy and
> past out of the manual. I somehow missed the that the zip file
> existed.
> I have the Si570 working on a 16F88, but wanted to use the 430.
>
> Sorry for the confusion.
> Thanks again
> Tom
>
> --- In m..., Aaron Greer wrote:
> >
> > Tom,
> > all those things look fine in my code. Do you have an old copy or
> something? Did you download the code in a zip file?
> > Here is where I got mine:
> > http://focus.ti.com/general/docs/techdocsabstract.tsp?
> abstractName=slaa368
> > If you can verify that you've got the same zip file of code as me
> and if you still don't see those variables defined, can you provide
> more details of where you're looking?
> > -Aaron
> >
> > ----- Original Message -----
> > From: "km5h"
> > To: m...
> > Sent: Monday, January 14, 2008 9:08:17 PM (GMT-0700) America/Denver
> > Subject: [msp430] Re: I2C example
> >
> >
> >
> >
> >
> >
> >
> > TxData0, TxData1, RxData, i , j, at least are not defined anywhere.
> >
> > Tom
> >
> > --- In m... , Aaron Greer wrote:
> > >
> > > What code do you believe is missing? I played around with that
> for
> > a bit a while back and thought it was complete.
> > > -Aaron
> > >
> > > ----- Original Message -----
> > > From: "km5h"
> > > To: m...
> > > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700)
> America/Denver
> > > Subject: [msp430] I2C example
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > I am trying to use the example code in "Using the USI I2C Code
> > Library
> > > (SLAA368)".
> > > They leave a some essential code necessary out so I am trying to
> > add
> > > the missing code. I am not a very good C programmer (yet).
> > > Has anyone successfully used this code to control an I2C device?
> > >
> > > Any comments would be appreciated
> > >
> > > Thanks,
> > > Tom Hoflich
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - jernst9967 - Jan 17 5:32:16 2008

I've written some code for the i2c interface. Can you post your code
and I'll look through it. Unfortunately, I am not allowed to post
code from that particular project.

--- In m..., "km5h" wrote:
>
> TxData0, TxData1, RxData, i , j, at least are not defined anywhere.
>
> Tom
> --- In m..., Aaron Greer wrote:
> >
> > What code do you believe is missing? I played around with that for
> a bit a while back and thought it was complete.
> > -Aaron
> >
> > ----- Original Message -----
> > From: "km5h"
> > To: m...
> > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700) America/Denver
> > Subject: [msp430] I2C example
> >
> >
> >
> >
> >
> >
> >
> > I am trying to use the example code in "Using the USI I2C Code
> Library
> > (SLAA368)".
> > They leave a some essential code necessary out so I am trying to
> add
> > the missing code. I am not a very good C programmer (yet).
> > Has anyone successfully used this code to control an I2C device?
> >
> > Any comments would be appreciated
> >
> > Thanks,
> > Tom Hoflich
> >
> >
> >
> >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - Aaron Greer - Jan 17 7:17:41 2008

Tom,
all those things look fine in my code. Do you have an old copy or something? Did you download the code in a zip file?
Here is where I got mine:
http://focus.ti.com/general/docs/techdocsabstract.tsp?abstractName=slaa368
If you can verify that you've got the same zip file of code as me and if you still don't see those variables defined, can you provide more details of where you're looking?
-Aaron

----- Original Message -----
From: "km5h"
To: m...
Sent: Monday, January 14, 2008 9:08:17 PM (GMT-0700) America/Denver
Subject: [msp430] Re: I2C example

TxData0, TxData1, RxData, i , j, at least are not defined anywhere.

Tom

--- In m... , Aaron Greer wrote:
>
> What code do you believe is missing? I played around with that for
a bit a while back and thought it was complete.
> -Aaron
>
> ----- Original Message -----
> From: "km5h"
> To: m...
> Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700) America/Denver
> Subject: [msp430] I2C example
>
> I am trying to use the example code in "Using the USI I2C Code
Library
> (SLAA368)".
> They leave a some essential code necessary out so I am trying to
add
> the missing code. I am not a very good C programmer (yet).
> Has anyone successfully used this code to control an I2C device?
>
> Any comments would be appreciated
>
> Thanks,
> Tom Hoflich
>
>
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - km5h - Jan 17 13:17:33 2008

Yes, I have version 3 of the IAR. However, the file at the link has
a version of 2. I changed it to 3 so that the compile would work.
Hope that was not a bad idea. Or should I go back to version 2 of the
IAR?

Thanks, Tom

--- In m..., "old_cow_yellow"
wrote:
>
> If you use c, you still has to watch out for which revision of which
> compiler/linker you are using.
>
> BTW, are you using version 3 of IAR?
>
> --- In m..., "km5h" wrote:
> >
> > Thanks for the link. I have not had a time to work with it but
will
> > soon. It looks like everything is there. I was doing a copy and
> > past out of the manual. I somehow missed the that the zip file
> > existed.
> > I have the Si570 working on a 16F88, but wanted to use the 430.
> >
> > Sorry for the confusion.
> > Thanks again
> > Tom
> >
> >
> >
> > --- In m..., Aaron Greer wrote:
> > >
> > > Tom,
> > > all those things look fine in my code. Do you have an old copy
or
> > something? Did you download the code in a zip file?
> > > Here is where I got mine:
> > > http://focus.ti.com/general/docs/techdocsabstract.tsp?
> > abstractName=slaa368
> > > If you can verify that you've got the same zip file of code as
me
> > and if you still don't see those variables defined, can you
provide
> > more details of where you're looking?
> > > -Aaron
> > >
> > > ----- Original Message -----
> > > From: "km5h"
> > > To: m...
> > > Sent: Monday, January 14, 2008 9:08:17 PM (GMT-0700)
America/Denver
> > > Subject: [msp430] Re: I2C example
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > TxData0, TxData1, RxData, i , j, at least are not defined
anywhere.
> > >
> > > Tom
> > >
> > > --- In m... , Aaron Greer
wrote:
> > > >
> > > > What code do you believe is missing? I played around with
that
> > for
> > > a bit a while back and thought it was complete.
> > > > -Aaron
> > > >
> > > > ----- Original Message -----
> > > > From: "km5h"
> > > > To: m...
> > > > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700)
> > America/Denver
> > > > Subject: [msp430] I2C example
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I am trying to use the example code in "Using the USI I2C
Code
> > > Library
> > > > (SLAA368)".
> > > > They leave a some essential code necessary out so I am trying
to
> > > add
> > > > the missing code. I am not a very good C programmer (yet).
> > > > Has anyone successfully used this code to control an I2C
device?
> > > >
> > > > Any comments would be appreciated
> > > >
> > > > Thanks,
> > > > Tom Hoflich
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - Aaron Greer - Jan 17 13:33:13 2008

What do you mean by "I changed it to 3 so that the compile would work"?

Are you having more luck with the downloaded code? When I used it, it seemed to work OK.

-Aaron

----- Original Message -----
From: "km5h"
To: m...
Sent: Thursday, January 17, 2008 11:14:03 AM (GMT-0700) America/Denver
Subject: [msp430] Re: I2C example

Yes, I have version 3 of the IAR. However, the file at the link has
a version of 2. I changed it to 3 so that the compile would work.
Hope that was not a bad idea. Or should I go back to version 2 of the
IAR?

Thanks, Tom

--- In m... , "old_cow_yellow"
wrote:
>
> If you use c, you still has to watch out for which revision of which
> compiler/linker you are using.
>
> BTW, are you using version 3 of IAR?
>
> --- In m... , "km5h" wrote:
> >
> > Thanks for the link. I have not had a time to work with it but
will
> > soon. It looks like everything is there. I was doing a copy and
> > past out of the manual. I somehow missed the that the zip file
> > existed.
> > I have the Si570 working on a 16F88, but wanted to use the 430.
> >
> > Sorry for the confusion.
> > Thanks again
> > Tom
> >
> >
> >
> > --- In m... , Aaron Greer wrote:
> > >
> > > Tom,
> > > all those things look fine in my code. Do you have an old copy
or
> > something? Did you download the code in a zip file?
> > > Here is where I got mine:
> > > http://focus.ti.com/general/docs/techdocsabstract.tsp?
> > abstractName=slaa368
> > > If you can verify that you've got the same zip file of code as
me
> > and if you still don't see those variables defined, can you
provide
> > more details of where you're looking?
> > > -Aaron
> > >
> > > ----- Original Message -----
> > > From: "km5h"
> > > To: m...
> > > Sent: Monday, January 14, 2008 9:08:17 PM (GMT-0700)
America/Denver
> > > Subject: [msp430] Re: I2C example
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > TxData0, TxData1, RxData, i , j, at least are not defined
anywhere.
> > >
> > > Tom
> > >
> > > --- In m... , Aaron Greer
wrote:
> > > >
> > > > What code do you believe is missing? I played around with
that
> > for
> > > a bit a while back and thought it was complete.
> > > > -Aaron
> > > >
> > > > ----- Original Message -----
> > > > From: "km5h"
> > > > To: m...
> > > > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700)
> > America/Denver
> > > > Subject: [msp430] I2C example
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I am trying to use the example code in "Using the USI I2C
Code
> > > Library
> > > > (SLAA368)".
> > > > They leave a some essential code necessary out so I am trying
to
> > > add
> > > > the missing code. I am not a very good C programmer (yet).
> > > > Has anyone successfully used this code to control an I2C
device?
> > > >
> > > > Any comments would be appreciated
> > > >
> > > > Thanks,
> > > > Tom Hoflich
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - old_cow_yellow - Jan 17 14:10:53 2008

I am not sure what the version # of IAR I was referring to. Let me put
it this way:

I downloaded the KickStart form TI a while back. The file name was
slac050p.zip and it works with the source code in slaa386.zip

At a later date, I downloaded the KickStart from TI again. The file
name was slac050q.zip and it does not work with the same source code.

Do you have to use the code in slaa386.zip? There are other source
code somewhere else. For me, I would rather write the code myself so
that I do not need to understand what others are thinking and
assuming. I would also use assembly so that I do not need to
understand what version and what brand of the compiler is used. (For
that matter, the Assembler also do me in from time to time. But less
frequent and easier to fight.)

--- In m..., "km5h" wrote:
>
> Yes, I have version 3 of the IAR. However, the file at the link has
> a version of 2. I changed it to 3 so that the compile would work.
> Hope that was not a bad idea. Or should I go back to version 2 of the
> IAR?
>
> Thanks, Tom
>
> --- In m..., "old_cow_yellow"
> wrote:
> >
> > If you use c, you still has to watch out for which revision of which
> > compiler/linker you are using.
> >
> > BTW, are you using version 3 of IAR?
> >
> > --- In m..., "km5h" wrote:
> > >
> > > Thanks for the link. I have not had a time to work with it but
> will
> > > soon. It looks like everything is there. I was doing a copy and
> > > past out of the manual. I somehow missed the that the zip file
> > > existed.
> > > I have the Si570 working on a 16F88, but wanted to use the 430.
> > >
> > > Sorry for the confusion.
> > > Thanks again
> > > Tom
> > >
> > >
> > >
> > > --- In m..., Aaron Greer wrote:
> > > >
> > > > Tom,
> > > > all those things look fine in my code. Do you have an old copy
> or
> > > something? Did you download the code in a zip file?
> > > > Here is where I got mine:
> > > > http://focus.ti.com/general/docs/techdocsabstract.tsp?
> > > abstractName=slaa368
> > > > If you can verify that you've got the same zip file of code as
> me
> > > and if you still don't see those variables defined, can you
> provide
> > > more details of where you're looking?
> > > > -Aaron
> > > >
> > > > ----- Original Message -----
> > > > From: "km5h"
> > > > To: m...
> > > > Sent: Monday, January 14, 2008 9:08:17 PM (GMT-0700)
> America/Denver
> > > > Subject: [msp430] Re: I2C example
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > TxData0, TxData1, RxData, i , j, at least are not defined
> anywhere.
> > > >
> > > > Tom
> > > >
> > > > --- In m... , Aaron Greer
> wrote:
> > > > >
> > > > > What code do you believe is missing? I played around with
> that
> > > for
> > > > a bit a while back and thought it was complete.
> > > > > -Aaron
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "km5h"
> > > > > To: m...
> > > > > Sent: Monday, January 14, 2008 8:01:34 AM (GMT-0700)
> > > America/Denver
> > > > > Subject: [msp430] I2C example
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > I am trying to use the example code in "Using the USI I2C
> Code
> > > > Library
> > > > > (SLAA368)".
> > > > > They leave a some essential code necessary out so I am trying
> to
> > > > add
> > > > > the missing code. I am not a very good C programmer (yet).
> > > > > Has anyone successfully used this code to control an I2C
> device?
> > > > >
> > > > > Any comments would be appreciated
> > > > >
> > > > > Thanks,
> > > > > Tom Hoflich
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - Anders Lindgren - Jan 18 4:51:39 2008

km5h wrote:
> Yes, I have version 3 of the IAR. However, the file at the link has
> a version of 2. I changed it to 3 so that the compile would work.
> Hope that was not a bad idea. Or should I go back to version 2 of the
> IAR?

The big difference is between version 1.xx and all the rest. Typically,
you don't have to change the source when goint from version 2.xx to
3.xx, or 4.xx for that matter...

-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.


Re: I2C example - old_cow_yellow - Jan 18 13:24:01 2008

What is the difference between __rt_version 2 and 3 (aside from
calling convention)?

What are the guide lines for mixing c code and assembly code under
__rt_vesion 3? (Aside from calling convention.)

And what about migrating old assembly code intended to be mixed with c
code under _rt_version 2 into 3?

I think km5h actually has IAR version 4 of IAR which uses __rt_version
3 and he was trying to link with an old assembly code which says:

RTMODEL "__rt_version", "2"

I know you can force IAR version 4 to use the older calling
convention. But is there anything else in the runtime environment that
might cause problems?

--- In m..., Anders Lindgren
wrote:
>
> km5h wrote:
> >
> >
> > Yes, I have version 3 of the IAR. However, the file at the
> > link has a version of 2. I changed it to 3 so that the
> > compile would work.
> > Hope that was not a bad idea. Or should I go back to
> > version 2 of the IAR?
>
> The big difference is between version 1.xx and all the rest.
> Typically, you don't have to change the source when goint
> from version 2.xx to 3.xx, or 4.xx for that matter...
>
> -- Anders Lindgren, IAR Systems
> --
> Disclaimer: Opinions expressed in this posting are strictly
> my own and not necessarily those of my employer.
>

_____________________________
 Free pdf download: Beginning Microcontrollers with the MSP430.