I2c

Started by nuepatrick October 9, 2004

Hello all,

This might be a dumb question, but is the basicx compatible with the
I2c Standard? I have a couple of chips that I want to interface with
it and am just curious.

Thanks

Patrick




Take a look at Peter Anderson's site at
http://www.phanderson.com/basicx/index.html

He has a couple of I2C examples as well as many others.

William

----- Original Message -----
From: "nuepatrick" <>
To: <>
Sent: Saturday, October 09, 2004 2:40 PM
Subject: [BasicX] I2c >
>
> Hello all,
>
> This might be a dumb question, but is the basicx compatible with the
> I2c Standard? I have a couple of chips that I want to interface with
> it and am just curious.
>
> Thanks
>
> Patrick >
>
> Yahoo! Groups Links





It is certainly NOT a dumb question.

The BasicX is compatible with a lot of things -- mainly 74HCXXX logic
chips. But also with Darling driver chips for real muscle and H-
bridge driver chips for motors with speed.

On the input side, you have light, temperature, voltage measurements,
and keyboards or buttons.

The whole concept of a hobby microcontroller is to allow you to try
many things, learn how to build them and recombine.

Also,more recent advancements in one-wire devices that use only one
or at most two pins to communicate with the microcontroller are
allowing you to build a lot more without the expense of creating
large circuit boards. In many cases a one of a kind circuit board is
far more expensive that a BasicX-24.

Try the site referals - you will find that there are many different
visions of what the little microcontrollers can do.

--- In , "nuepatrick" <nuepatrick@y...> wrote:
>
> Hello all,
>
> This might be a dumb question, but is the basicx compatible with
the
> I2c Standard? I have a couple of chips that I want to interface
with
> it and am just curious.
>
> Thanks
>
> Patrick





--- In , "nuepatrick" <nuepatrick@y...> wrote:
> [...] is the basicx compatible with the I2c Standard?

One way to send data to or get data from an I2C device is to use the
ShiftOut() and ShiftIn() library functions. You'll note in the
description of those functions that it says explicitly "... to be
compatible with I2C devices, the bit rate is less than 400kHz". Of
course, if you need a bi-directional interface, it is slightly more
complicated because you have to switch the data line from output to
input and back again during communication.

Alternately, you can "bit bang" the interface. The term "bit bang"
means to implement in software by manipulating I/O lines in the
proper sequence and with the proper timing. Although the resulting
interface is usually slower than might be otherwise obtained, it is
often a useful learning experience and may reduce project cost by
eliminating the need for external hardware. On the down side, it is
sometimes difficult (but not impossible) to get the interface correct
without the aid of observation tools like an oscilloscope or logic
analyzer.

As a final note, TWI (two wire interface) is the same as I2C. The
latter is a trademark of Philips which is why Atmel and others talk
about TWI instead of I2C.



Hello,

What I am trying to understand and use are the following chip

Microchip TC 654 Dual SMBus PWM fan speed controller

I admit I am not a software wizard by any means. I am trying to
learn the very hard way by just doing things which to be honest is
very frusterating and time consuming.
Any help along the way is always greatly appericated.

Here is the link to the part if anybody would like to help

http://ww1.microchip.com/downloads/en/DeviceDoc/21734a.pdf

Thanks in advance for the advice and the help
Patrick

--- In , "#@!%! Herzog" <hwanghetw@y...> wrote:
>
> It is certainly NOT a dumb question.
>
> The BasicX is compatible with a lot of things -- mainly 74HCXXX
logic
> chips. But also with Darling driver chips for real muscle and H-
> bridge driver chips for motors with speed.
>
> On the input side, you have light, temperature, voltage
measurements,
> and keyboards or buttons.
>
> The whole concept of a hobby microcontroller is to allow you to
try
> many things, learn how to build them and recombine.
>
> Also,more recent advancements in one-wire devices that use only
one
> or at most two pins to communicate with the microcontroller are
> allowing you to build a lot more without the expense of creating
> large circuit boards. In many cases a one of a kind circuit board
is
> far more expensive that a BasicX-24.
>
> Try the site referals - you will find that there are many
different
> visions of what the little microcontrollers can do.
>
> --- In , "nuepatrick" <nuepatrick@y...>
wrote:
> >
> > Hello all,
> >
> > This might be a dumb question, but is the basicx compatible with
> the
> > I2c Standard? I have a couple of chips that I want to interface
> with
> > it and am just curious.
> >
> > Thanks
> >
> > Patrick




Hi Patrick
The device will connect directlu to the bx24 as per
fig 4-1 in your applicatio note. For example, you could connect SCLk
directly to say pin 13, SDA to pin 14 and fault to pin15 of the bx24.
Don't forget the 20k pullups.
BUT BUT ( Big But) the software is quite involved. If you are not
familiar with reading and writing to registers, then I'd suggest you get
started on something more simple...say a real timew c;lock chip for
instance, where there is no external wiring other than the chip and the
crystal. You need to be able to understand reading writing to registers,
then its simply a matter of deciding the register address, and pokimg
the data to it using the BX24 shiftout command. For instance if you
wrote a 1 to the duty cycle register, the fan would run at 30%. Wring a
4 would give you 48.6% and a 5 would give you 53%. You need to figure
out how to write to the duty cycle register. A quick look at fig 5-1
tells me that to write to a duty cycle register, you would send a start,
then a 7 bit address ( decimal 27 or 0011 011) for the appropriate
device you are talking to, then a WR , then look for an ack back from
the remote device. then to write to the duty cycle register, you send a
8 bit decimal 3 ( 0000 0110) and wait for another ack. You then send an
8 bit data byte to set the fan speed and wait for another ack, then send
a stop.
good luck
neil uepatrick wrote:

>
> Hello,
>
> What I am trying to understand and use are the following chip
>
> Microchip TC 654 Dual SMBus PWM fan speed controller
>
> I admit I am not a software wizard by any means. I am trying to
> learn the very hard way by just doing things which to be honest is
> very frusterating and time consuming.
> Any help along the way is always greatly appericated.
>
> Here is the link to the part if anybody would like to help
>
> http://ww1.microchip.com/downloads/en/DeviceDoc/21734a.pdf
>
> Thanks in advance for the advice and the help
> Patrick
>
> --- In , "#@!%! Herzog" <hwanghetw@y...> wrote:
> >
> > It is certainly NOT a dumb question.
> >
> > The BasicX is compatible with a lot of things -- mainly 74HCXXX
> logic
> > chips. But also with Darling driver chips for real muscle and H-
> > bridge driver chips for motors with speed.
> >
> > On the input side, you have light, temperature, voltage
> measurements,
> > and keyboards or buttons.
> >
> > The whole concept of a hobby microcontroller is to allow you to
> try
> > many things, learn how to build them and recombine.
> >
> > Also,more recent advancements in one-wire devices that use only
> one
> > or at most two pins to communicate with the microcontroller are
> > allowing you to build a lot more without the expense of creating
> > large circuit boards. In many cases a one of a kind circuit board
> is
> > far more expensive that a BasicX-24.
> >
> > Try the site referals - you will find that there are many
> different
> > visions of what the little microcontrollers can do.
> >
> > --- In , "nuepatrick" <nuepatrick@y...>
> wrote:
> > >
> > > Hello all,
> > >
> > > This might be a dumb question, but is the basicx compatible with
> > the
> > > I2c Standard? I have a couple of chips that I want to interface
> > with
> > > it and am just curious.
> > >
> > > Thanks
> > >
> > > Patrick >
>
> *
> <http://promotions.yahoo.com/ydomains2004/index.html" target="_blank" rel="nofollow">http://us.ard.yahoo.com/SIG92q1i0o/M)4855.5468653.6549235.3001176/D=groups/S06554205:HM/EXP97538650/A#76776/R=0/SIGldm1jvc/*http://promotions.yahoo.com/ydomains2004/index.html >
>
> *>.





Patrick
oops that should have been
........you send a 8 bit decimal 5 ( 0000 0110) and wait for another
ack. You then send .....

Sorry about the bad spelling.
neil Neil Jepsen wrote:

> Hi Patrick
> The device will connect directlu to the bx24 as per
> fig 4-1 in your applicatio note. For example, you could connect SCLk
> directly to say pin 13, SDA to pin 14 and fault to pin15 of the bx24.
> Don't forget the 20k pullups.
> BUT BUT ( Big But) the software is quite involved. If you are not
> familiar with reading and writing to registers, then I'd suggest you get
> started on something more simple...say a real timew c;lock chip for
> instance, where there is no external wiring other than the chip and the
> crystal. You need to be able to understand reading writing to registers,
> then its simply a matter of deciding the register address, and pokimg
> the data to it using the BX24 shiftout command. For instance if you
> wrote a 1 to the duty cycle register, the fan would run at 30%. Wring a
> 4 would give you 48.6% and a 5 would give you 53%. You need to figure
> out how to write to the duty cycle register. A quick look at fig 5-1
> tells me that to write to a duty cycle register, you would send a start,
> then a 7 bit address ( decimal 27 or 0011 011) for the appropriate
> device you are talking to, then a WR , then look for an ack back from
> the remote device. then to write to the duty cycle register, you send a
> 8 bit decimal 3 ( 0000 0110) and wait for another ack. You then send an
> 8 bit data byte to set the fan speed and wait for another ack, then send
> a stop.
> good luck
> neil > uepatrick wrote:
>
> >
> > Hello,
> >
> > What I am trying to understand and use are the following chip
> >
> > Microchip TC 654 Dual SMBus PWM fan speed controller
> >
> > I admit I am not a software wizard by any means. I am trying to
> > learn the very hard way by just doing things which to be honest is
> > very frusterating and time consuming.
> > Any help along the way is always greatly appericated.
> >
> > Here is the link to the part if anybody would like to help
> >
> > http://ww1.microchip.com/downloads/en/DeviceDoc/21734a.pdf
> >
> > Thanks in advance for the advice and the help
> > Patrick
> >
> > --- In , "#@!%! Herzog" <hwanghetw@y...> wrote:
> > >
> > > It is certainly NOT a dumb question.
> > >
> > > The BasicX is compatible with a lot of things -- mainly 74HCXXX
> > logic
> > > chips. But also with Darling driver chips for real muscle and H-
> > > bridge driver chips for motors with speed.
> > >
> > > On the input side, you have light, temperature, voltage
> > measurements,
> > > and keyboards or buttons.
> > >
> > > The whole concept of a hobby microcontroller is to allow you to
> > try
> > > many things, learn how to build them and recombine.
> > >
> > > Also,more recent advancements in one-wire devices that use only
> > one
> > > or at most two pins to communicate with the microcontroller are
> > > allowing you to build a lot more without the expense of creating
> > > large circuit boards. In many cases a one of a kind circuit board
> > is
> > > far more expensive that a BasicX-24.
> > >
> > > Try the site referals - you will find that there are many
> > different
> > > visions of what the little microcontrollers can do.
> > >
> > > --- In , "nuepatrick" <nuepatrick@y...>
> > wrote:
> > > >
> > > > Hello all,
> > > >
> > > > This might be a dumb question, but is the basicx compatible with
> > > the
> > > > I2c Standard? I have a couple of chips that I want to interface
> > > with
> > > > it and am just curious.
> > > >
> > > > Thanks
> > > >
> > > > Patrick
> >
> >
> >
> >
> > *
> >
> <http://promotions.yahoo.com/ydomains2004/index.html>" target="_blank" rel="nofollow">http://us.ard.yahoo.com/SIG92q1i0o/M)4855.5468653.6549235.3001176/D=groups/S06554205:HM/EXP97538650/A#76776/R=0/SIGldm1jvc/*http://promotions.yahoo.com/ydomains2004/index.html>
>
> >
> >
> >
> >
> > *>.
> >
> > *
> <http://companion.yahoo.com" target="_blank" rel="nofollow">http://us.ard.yahoo.com/SIG9qktue4/M)5196.4901138.6071305.3001176/D=groups/S06554205:HM/EXP97558763/A!28215/R=0/SIGse96mf6/*http://companion.yahoo.com >
>
> *>.