Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
Thread Tools Display Modes
Old 17th May 2007, 08:47 PM   (permalink)
New Member
oeginc is on a distinguished road
Default Simple I2C interface chip?

Ok, I'm in the beginning stages of designing an electronics platform that will interface to many other devices (think phidgets like).

I believe I'd like all of the devices (which I will be making as well) to interface using the I2C (TWI) protocol (unless there is something better/easier/more universal). I want to leave open the ability for 3rd parties to create devices for this platform as well.

The question I have is:

1) Is there a simple chip that will handle all of the i2c interface stuff for me (analog and/or digital interface to various things like temperature sensors, tilt sensors, etc). Currently I have been using PIC chips to do the interfacing, but when you start talking about having to add a PIC chip to every device and then have special programming for that device, it starts to increase the price quite a bit.

2) If *I* must use a PIC chip (or similar), can anyone recommend a good/cheap chip to use? It only needs to have a couple ADC lines (2-4), a couple digital i/o lines (2-4), and the i2c interface. It doesn't have to be from Microchip, any readily available manufacturer will do. I've used the 16F877a chip, but I'm looking for something that's not so overkill.
oeginc is offline   Reply With Quote
Old 17th May 2007, 09:00 PM   (permalink)
Experienced Member
 
Leftyretro has a spectacular aura about
Default

You would always require some kind of programmable device to act as the master device on any I2C buss. The simplest, cheapest, quickest to develop device I've come across is the Picaxe series of PIC microcontroller chips.

T hey are PIC based but have a preinstalled bootloader that are programmed by basic language via a passive serial cable to a PC using their free ICD programming editor. Their version of basic includes hi-level I2C set-up and command functions and their newest released chips can act as a I2C slave as well as a I2C master. Most of their chips are under $10 and there is no need for a hardware programmer/burner.

http://www.rev-ed.co.uk/picaxe/

Lefty
Leftyretro is offline   Reply With Quote
Old 17th May 2007, 09:12 PM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by Leftyretro
They are PIC based but have a preinstalled bootloader
This isn't entirely so, the original PICAXE's didn't run a bootloader, and you don't actually program the PIC - the PICAXE is a BASIC interpreter, which runs tokenised programs stored in the internal data EEPROM memory - which means it's fairly slow, and only has very limited program space. It's really a limited 'poor mans' BASIC STAMP, but VERY impressive for what it is, and how cheap it is!.

The newer, larger PICAXE's presumably still run as an interpreter?, but because of the new FLASH memory writing capabilities presumably store the tokenised BASIC as tables in the program memory?. I don't really think this system would be considered a 'bootloader' either?, as it's only transferring data and not PIC code.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 17th May 2007, 09:31 PM   (permalink)
New Member
oeginc is on a distinguished road
Default

I can get the 16F877a chips for under $8/piece, and I (correct me if I am wrong) believe the PIXAXE chips -ARE- Microchip PIC chips...

I don't care so much about the ease of programming as I do the ease of implementation (fewest components) and the cost of the chips.

In the end, I expect I will need to make hundreds of these, so the difference between a $2.00 chip and a $10.00 chip (as well as supporting components) will be significant.
oeginc is offline   Reply With Quote
Old 17th May 2007, 09:32 PM   (permalink)
Experienced Member
 
Leftyretro has a spectacular aura about
Default

Quote:
Originally Posted by Nigel Goodwin
This isn't entirely so, the original PICAXE's didn't run a bootloader, and you don't actually program the PIC - the PICAXE is a BASIC interpreter, which runs tokenised programs stored in the internal data EEPROM memory - which means it's fairly slow, and only has very limited program space. It's really a limited 'poor mans' BASIC STAMP, but VERY impressive for what it is, and how cheap it is!.

The newer, larger PICAXE's presumably still run as an interpreter?, but because of the new FLASH memory writing capabilities presumably store the tokenised BASIC as tables in the program memory?. I don't really think this system would be considered a 'bootloader' either?, as it's only transferring data and not PIC code.
You may very well be correct. Piaxe's FAQ document referes to their chip's preloaded code as a 'bootstrap program' but of course the user program being downloaded is a tokenised series of commands that is interpreted on chip as you stated. So perhaps Picaxe is not using the best or correct term for the function they preburn into their chips that communicates to their Windows ICD programming editor.

Speed for I2C should not be an issue as with their higher clock speed options their I2C commands can utilize I2c devices communication at well over 1mhz which is well above the standard low and high speed I2C standards. Of course if the application requires a lot of additonal computational functions in addition to just moving the data back and forth then certainly there are more powerful microcontroller systems/languages.

Lefty
Leftyretro is offline   Reply With Quote
Old 17th May 2007, 09:39 PM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by oeginc
In the end, I expect I will need to make hundreds of these, so the difference between a $2.00 chip and a $10.00 chip (as well as supporting components) will be significant.
As I understand it, you're basically trying to make your own I2C 'chips', although in your case the 'chip' will actually be a module. So each 'chip' will be a slave device, will require it's own address, and will probably require a PIC that has I2C hardware? - master is easy in software, but to do slave you really need hardware.

And yes, the PICAXE is a pre-programmed PIC - funnily enough the name PICAXE was used by Don McKenzie of Dontronics years and years before Reved used the name.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 17th May 2007, 09:41 PM   (permalink)
Experienced Member
 
Leftyretro has a spectacular aura about
Default

Quote:
Originally Posted by oeginc
I can get the 16F877a chips for under $8/piece, and I (correct me if I am wrong) believe the PIXAXE chips -ARE- Microchip PIC chips...

I don't care so much about the ease of programming as I do the ease of implementation (fewest components) and the cost of the chips.

In the end, I expect I will need to make hundreds of these, so the difference between a $2.00 chip and a $10.00 chip (as well as supporting components) will be significant.
Yes, they are certainly based on selected PIC chips. And for volume production the underlining PIC chip is cheaper. It just wasn't clear from your original posting that you have no issues with programming skills or were considering high volume production. For those of us that aren't skilled in ASM or C and just want something simple and cheap that can do I2C, the Picaxe is a neat solution....

Lefty
Leftyretro is offline   Reply With Quote
Old 17th May 2007, 09:53 PM   (permalink)
3v0
Moderator
 
Blog Entries: 3
3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold3v0 is a splendid one to behold
Default

Quote:
Originally Posted by oeginc
I can get the 16F877a chips for under $8/piece, and I (correct me if I am wrong) believe the PIXAXE chips -ARE- Microchip PIC chips...

I don't care so much about the ease of programming as I do the ease of implementation (fewest components) and the cost of the chips.

In the end, I expect I will need to make hundreds of these, so the difference between a $2.00 chip and a $10.00 chip (as well as supporting components) will be significant.
Newark has the following price on the MICROCHIP PIC16F877A-I/PQty List Price 1 - 25 $4.94 26 - 99 $4.81 100 + $4.68
IIRC you said you did not need that many pins. They have the PIC16F88 for under $3. If you choose one with an internoscosc such as the 88 you can save another 50 cents by not buying the crystal caps board space etc.

Depending on you exact needs you might find one with all the features you need for under $2.

I suggest you build and debug the system with a overkill chip like the 877A or the 88. Then once you know you memory needs you can select a chip with just enough to do the job.
__________________
search engine for electronic parts
Junebug USB PIC programmer kit. USB Bit Wacker
3v0 is offline   Reply With Quote
Old 18th May 2007, 01:57 AM   (permalink)
Experienced Member
 
justDIY is a jewel in the roughjustDIY is a jewel in the rough
Default

pull up the parametric search on the microchip website, and filter out all the 16f (or 18f) series chips that don't have an "MSSP" - master synchronous serial port. now pick one with a price that's right, and meets your other requirements.

you can do reasonably well emulating i2c timing with a software uart, but why bother when Microchip has a Philips certified I2C Master/slave interface built right into the chip.

the commands to operate the hardware are pretty simple, and using soft-interrupts (polling) can handle 400kbps transfers no problem, and leaves plenty of CPU power left over for other routines.
__________________
If you don't have a planet, what good are gold bars?

want to contact me directly? gmail gordonthree
check out my project website: http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY is offline   Reply With Quote
Old 18th May 2007, 05:00 AM   (permalink)
New Member
oeginc is on a distinguished road
Default

Quote:
Originally Posted by Nigel Goodwin
As I understand it, you're basically trying to make your own I2C 'chips', although in your case the 'chip' will actually be a module. So each 'chip' will be a slave device, will require it's own address, and will probably require a PIC that has I2C hardware? - master is easy in software, but to do slave you really need hardware.

And yes, the PICAXE is a pre-programmed PIC - funnily enough the name PICAXE was used by Don McKenzie of Dontronics years and years before Reved used the name.
Yes, exactly. I am planning to make an i2c servo control module, lcd display module, temperature module, sonar module, H-Bridge motor control module, Relay control module, Accelerometer module, etc.

For the temperature module, the *only* thing I need it to do is read the temperature (adc) and send it down the pipe so I thought there would be something "simple" that I could use in place of a PIC chip.

Are PIC's the best/cheapest chip for doing i2c stuff? Where do the AVR's, the Scenix, or the ARM's fall on this subject? I only have experience with PIC's at the moment (although I have a bunch of Scenix chips laying around to experiment with, as well as some propeller chips - but I think 8 CPU cog's is *WAY* overkill).

And to complicate matters more, is I2C or CAN (or SPI for that matter) better/more popular?

Last edited by oeginc; 18th May 2007 at 05:18 AM.
oeginc is offline   Reply With Quote
Old 18th May 2007, 09:10 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

All the commercial buses are designed to meet specific needs, so none really meet your requirements very well - there was a project called PICNET a few years ago, which did a similar scheme over serial, and later USB, essentialy networking PIC's over a simple bus. Unfortunately the site has disappeared

But all the buses you suggest are probably more complicated than you need?, if you're going to use one of them I would suggest picking one that has devices available that you're going to use directly on the bus (such as I2C chips).

Processor wise I don't think it makes much difference?, and PIC's are by far the most popular.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 18th May 2007, 12:20 PM   (permalink)
Experienced Member
 
justDIY is a jewel in the roughjustDIY is a jewel in the rough
Default

for reading the temperature, consider the LM75 (or equivalent). i2c connected thermostat, it can both read the temperature and operate stand-alone, responding to set-points.

Texas Inst seems to have the cheapest version, the TMP175
__________________
If you don't have a planet, what good are gold bars?

want to contact me directly? gmail gordonthree
check out my project website: http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY is offline   Reply With Quote
Old 18th May 2007, 01:45 PM   (permalink)
New Member
oeginc is on a distinguished road
Default

Quote:
Originally Posted by justDIY
for reading the temperature, consider the LM75 (or equivalent). i2c connected thermostat, it can both read the temperature and operate stand-alone, responding to set-points.

Texas Inst seems to have the cheapest version, the TMP175
Excellent, I should have thought of that (PC's, duh!). And to expand on this a little further, I did some more digging and happened across these:

PCF8591; 8-bit A/D and D/A converter
=============================
The PCF8591 is a single-chip, single-supply low power 8-bit CMOS data acquisition device with four analog inputs, one analog output and a serial I2C-bus interface. Three address pins A0, A1 and A2 are used for programming the hardware address, allowing the use of up to eight devices connected to the I2C-bus without additional hardware. Address, control and data to and from the device are transferred serially via the two-line bidirectional I2C-bus.

The functions of the device include analog input multiplexing, on-chip track and hold function, 8-bit analog-to-digital conversion and an 8-bit digital-to-analog conversion. The maximum conversion rate is given by the maximum speed of the I2C-bus.

ADT7516/ADT7517/ADT7519
=====================
The ADT7516/ADT7517/ADT7519* combine a 10-bit temperature-to-digital converter, a 10-bit 4-channel ADC, and a quad 12-/10-/8-bit DAC, respectively, in a 16-lead QSOP package. The parts also include a band gap temperature sensor and a 10-bit ADC to monitor and digitize the temperature reading to a resolution of 0.25°C.

I've read that Analog Devices also makes a very simple 4 ADC/DAC chip as well.

Both of these chips are very similar to what I am looking for. Something that allows my devices to interface with the i2c bus without causing me too much headache (like having to program every single module that goes out). In the end, I'm not sure which way I'll go because choosing a PIC chip appears to cost about the same, but it gives me alot more functionality...

If anyone has any other suggestions, please let me know.
oeginc is offline   Reply With Quote
Old 18th May 2007, 05:16 PM   (permalink)
Experienced Member
 
justDIY is a jewel in the roughjustDIY is a jewel in the rough
Default

take a look at NXP (fka Philips) offering ... their website is like a Candy Store for i2c gizmos.

http://www.nxp.com/products/interface_control/i2c/
__________________
If you don't have a planet, what good are gold bars?

want to contact me directly? gmail gordonthree
check out my project website: http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY is offline   Reply With Quote
Old 19th May 2007, 12:55 PM   (permalink)
New Member
oeginc is on a distinguished road
Default

After looking around, I think I might go with the Scenix (now Parallax) SX28AC chip for this project.

Parallax sells them for $2.79/each (or down to $1.89 in quantity), they have 20 I/O pins, 2K program space, 136 bytes of RAM, require very little extra hardware to run, and can run at 75MIPS.

Compare that to a 16F84a that sells for ~$6.00/each, has 13 I/O pins, 1.75K program space, 68 bytes of RAM, and can only run 20MIPS...

am I crazy here? What am I missing...
oeginc is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Wireless I2C adamthole Electronic Projects Design/Ideas/Reviews 5 24th April 2007 01:13 PM
WRT54G Power Supply Chip ParkingLotLust Datasheet/Parts Requests 32 5th January 2007 09:26 PM
Chip Identity edcross1 General Electronics Chat 5 21st July 2005 07:51 PM
little help with my program please - simple count loop kud0s Micro Controllers 5 7th July 2005 09:40 PM
simple help.. Making a simple amplifier. pls help urgent. paulbostaph General Electronics Chat 19 20th May 2003 04:32 PM



All times are GMT. The time now is 10:53 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.