Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Wich PIC? 8 analog in, I2C out.

Status
Not open for further replies.

Odin

Member
I'm working on a project for a friend. He wants to read 8 analog values, and send them by I2C to some other circuits. Some pots, me thinks.

I've tried to find out what pic to choose, but get a little bit confused over the terms slave and master. Seems like the small pics can only be a slave? Or are there functions in there I don't understand.

What I have at hand here now is 16F73, 16F870 and 16F628. As far as I've understood, the F73 has some I2C functionality, although only 5 A/D-channels. But I could test with 1 channel first.

Please guide me in the right direction.. :)

Thanks!
 
Odin said:
I'm working on a project for a friend. He wants to read 8 analog values, and send them by I2C to some other circuits. Some pots, me thinks.

I've tried to find out what pic to choose, but get a little bit confused over the terms slave and master. Seems like the small pics can only be a slave? Or are there functions in there I don't understand.

What I have at hand here now is 16F73, 16F870 and 16F628. As far as I've understood, the F73 has some I2C functionality, although only 5 A/D-channels. But I could test with 1 channel first.

The PIC16F877 is a very common PIC, it's 40 pin and includes 8 A2D inputs plus I2C capabilities.

A lot depends really what he wants to do with the values, I2C is a protocol for connections between particular compatible IC's, it's not a very good general purpose interface - you can do it far easier, faster and better.

I2C can be either Master or Slave, usually the micro-controller will be Master, storing analogue readings in I2C EEPROM is a very common task.

If you consult my tutorials I show how to read analogue inputs, and how to read and write I2C - but using software Master routines, not the 16F877 hardware.
 
Nigel Goodwin said:
The PIC16F877 is a very common PIC, it's 40 pin and includes 8 A2D inputs plus I2C capabilities.

A lot depends really what he wants to do with the values, I2C is a protocol for connections between particular compatible IC's, it's not a very good general purpose interface - you can do it far easier, faster and better.

I'm not sure, but I think these pots (potmeter IC) are for I2C only. So I have to stick with that.

I2C can be either Master or Slave, usually the micro-controller will be Master, storing analogue readings in I2C EEPROM is a very common task.

If you consult my tutorials I show how to read analogue inputs, and how to read and write I2C - but using software Master routines, not the 16F877 hardware.

So I should go the software way, and not bother with hardware I2C? Thought it would be a lot easier to use the hardware. Guess I could use any PIC with 8 A/D-channels then. What about 16F676? It's small, cheap, internal osc. 8 ch 10bit AD.
 
Odin said:
I'm not sure, but I think these pots (potmeter IC) are for I2C only. So I have to stick with that.

That's fine, I2C isn't a problem, as long as you have a need for it.

So I should go the software way, and not bother with hardware I2C? Thought it would be a lot easier to use the hardware. Guess I could use any PIC with 8 A/D-channels then. What about 16F676? It's small, cheap, internal osc. 8 ch 10bit AD.

That would be fine!, as it's a master situation a software solution works perfectly, my tutorials contain both I2C code and code for using the A2D.
 
Nigel Goodwin said:
That would be fine!, as it's a master situation a software solution works perfectly, my tutorials contain both I2C code and code for using the A2D.

I'm using your code right now. Need some studying before I understand all of it, but it comes. Great help, thanx!

Had a look at Farnell. Seems like pics are getting cheaper with more functions everyday. Like computers. Good for us.. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top