PDA

View Full Version : Need help defining I2C and Serial pins



Navaidstech
- 18th August 2007, 16:13
Hi all..

I'm just getting into PIC programming and currently working on a little gizmo that will communicate with a computer as well as a Real Time Clock using I2C.
I've got a pile of 16F84 PIC and I'm well aware that they're pretty obsolete now, however I would like to put them to a good use.
I'm having trouble finding any info on which pins can be used for serial (RS232) and I2C communications. Seems that every schematic I see uses different ports for that purpose, does that mean that you can actually assign ports to perform these functions (unlike the 68HH11 that has fixed ports to do this and that).

I'm using Microcode studio to write the projects that makes the communications easy, however I'm still a little confused as to how to go about determining which pins are to be used for all this.

Any help would be greatly appreciated.
Thanks

Alex

mackrackit
- 18th August 2007, 16:19
If you use SERIN/SEROUT or SERIN2/SEROUT2 any pin configures for I/O will work for serial comms.

Navaidstech
- 18th August 2007, 17:46
Thanks for the info Dave...
Does this apply to I2C communications as well?

If so, how does one assign I2C and Serial TX/RX functions to specific pins on the 16F84 using Microcode Studio?

thanks
Alex

mackrackit
- 18th August 2007, 18:31
PBP has I2CREAD and I2CWRITE commands built in. Look in the manual on how to set one up.

But the answer to your question is


I2CREAD PORT?.?, the rest of the statement
SERIN PORT?.?, the rest of the statement

Navaidstech
- 18th August 2007, 18:49
Thank you very much Dave... appreciate your help.

Alex

mackrackit
- 18th August 2007, 19:08
Thank you very much Dave... appreciate your help.

Alex
No problem, been there myself. On second thought I am still there:D