please dont rip this site

Q:What pins should be used when interfacing a PIC or SX to  IIC devices? Would open-drain pin RA4 would be the pin to use for SDA on an PIC xF84 then to make life a little easier ?

A: from Ken Webster

Perhaps. I actually found the ordinary pins quite easy to use on a 16C74, particularly because it is ok to use BCF and BSF directly on the TRISA, TRISB, or TRISC registers (thus you needn't use a mirror register like you do with PORTA, PORTB, or PORTC with read-modify-write instructions).

For example, with an open-drain pin:

      BSF   PORTA_MIRROR,2
      MOVF  PORTA_MIRROR,W
      MOVWF PORTA

With an ordinary pin:
Initialization:

      CLRF PORTA

Toggling a pin high:

      BSF  STATUS,RP0
      BSF  TRISA,2
      BCF  STATUS,RP0

A shortcut I often used was to point FSR at TRISA at the start of a subroutine that talks to the EEPROM. Then, in the body of ths subroutine, I could use the following (instead of switching STATUS,RP0 back and forth):

      BSF  INDF,2

So, actually, I think it is easier to not use an open-drain pin as long as you can use 2 pins on the same port and point FSR to that port. For the 17C756 I chose to use the open-drain pins only because they were not useful for anything else and I was short on pins.


file: /techref/io/i2c/odvspin.htm, 1KB, , updated: 2002/11/4 09:25, local time: 2008/12/2 23:11,
TOP NEW HELP FIND: 
38.103.63.55:LOG IN
©2008 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it!
<A HREF="http://www.sxlist.com/techref/io/i2c/odvspin.htm"> io i2c odvspin</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be reviewed) Just type in the box and press the Post button. (HTML welcomed!): A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Did you find what you needed?

 
RpS i 2o3i2c
Cheap & easy I2C I/O and Monitor
Watch, recieve and send I2C via serial port. 100Kb/s. Also 5 TTL out & 8 in.
$15 chip $30 w/ PCB $40 kit $50 A&T
Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
  'What can I do?' - SiCKO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .