I2C example

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?

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?

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]
>

Re: I2C example

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.)

Re: Re: I2C example

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=slaa368If 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

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]
>

Re: I2C example

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?

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

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

Re: I2C example

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.)

Re: Re: I2C example

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.

>
> 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.
>