Quantcast

I2C example

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

I2C example

km5h
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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

Aaron Greer
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" <[hidden email]>
To: [hidden email]
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



[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

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

Tom


--- In [hidden email], Aaron Greer <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" <km5h@...>
> To: [hidden email]
> 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
>
>
>
> [Non-text portions of this message have been removed]
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

old_cow_yellow
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 [hidden email], "km5h" <km5h@...> wrote:

>
> TxData0, TxData1, RxData, i , j, at least are not defined anywhere.
>
> Tom
>
>
> --- In [hidden email], Aaron Greer <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" <km5h@>
> > To: [hidden email]
> > 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
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

Joseph Ernst
In reply to this post by km5h
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 [hidden email], "km5h" <km5h@...> wrote:

>
> TxData0, TxData1, RxData, i , j, at least are not defined anywhere.
>
> Tom
>
>
> --- In [hidden email], Aaron Greer <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" <km5h@>
> > To: [hidden email]
> > 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
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: I2C example

Aaron Greer
In reply to this post by km5h
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" <[hidden email]>
To: [hidden email]
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 [hidden email] , Aaron Greer <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" <km5h@...>
> To: [hidden email]
> 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
>
>
>
> [Non-text portions of this message have been removed]
>



[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

km5h
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 [hidden email], Aaron Greer <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" <km5h@...>
> To: [hidden email]
> 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 [hidden email] , Aaron Greer <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" <km5h@>
> > To: [hidden email]
> > 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
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
> [Non-text portions of this message have been removed]
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

old_cow_yellow
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 [hidden email], "km5h" <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 [hidden email], Aaron Greer <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" <km5h@>
> > To: [hidden email]
> > 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 [hidden email] , Aaron Greer <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" <km5h@>
> > > To: [hidden email]
> > > 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
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

km5h
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 [hidden email], "old_cow_yellow" <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 [hidden email], "km5h" <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 [hidden email], Aaron Greer <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" <km5h@>
> > > To: [hidden email]
> > > 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 [hidden email] , Aaron Greer <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" <km5h@>
> > > > To: [hidden email]
> > > > 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
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: I2C example

Aaron Greer
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" <[hidden email]>
To: [hidden email]
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 [hidden email] , "old_cow_yellow" <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 [hidden email] , "km5h" <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 [hidden email] , Aaron Greer <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" <km5h@>
> > > To: [hidden email]
> > > 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 [hidden email] , Aaron Greer <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" <km5h@>
> > > > To: [hidden email]
> > > > 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
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>



[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

old_cow_yellow
In reply to this post by km5h
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 [hidden email], "km5h" <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 [hidden email], "old_cow_yellow" <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 [hidden email], "km5h" <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 [hidden email], Aaron Greer <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" <km5h@>
> > > > To: [hidden email]
> > > > 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 [hidden email] , Aaron Greer <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" <km5h@>
> > > > > To: [hidden email]
> > > > > 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
> > > > >
> > > > >
> > > > >
> > > > > [Non-text portions of this message have been removed]
> > > > >
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> >
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: I2C example

Anders Lindgren
In reply to this post by km5h
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.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I2C example

old_cow_yellow
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 [hidden email], Anders Lindgren <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.
>


Loading...