CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I2C Beetwen PIC16F8676 and PC Open Collector Problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
fadeout



Joined: 28 Jan 2004
Posts: 15

View user's profile Send private message Visit poster's website

I2C Beetwen PIC16F8676 and PC Open Collector Problem
PostPosted: Fri Feb 20, 2004 8:37 am     Reply with quote

Hi,
I have a discussion with my elettoronic-designer and I need your help.

In a previous post ("Does I2c has a minimun clock freq") I asked something about I2C and in the replies Ttelmah and a Guest tolds me about an "open collector driver" I need to have on the LPT port of my PC to make all working. I told this to my elettronic designer but he said that it's all ok.

At the moment I have a code on c# (PC - I2C Master) and a code on PICC (16F876 - I2C Slave) that can write from PC to PIC but never read nothing including ACK. I can test this because I "hackered" the ACK signal and I can see that PIC can read what I send from the PC. I think it means that the code can work well.

On the LPT port I have lines (SDA and SCL) on PIN0 (Control Register Bit 0 - Strobe signal) and PIN14 (Control register Bit 1 Signal nAuto-Linefeed). This are "open collectors" pins, but I think that they are only output pins.
I can mesaure that the pic outputs (that have the pull-up resistor) goes low when is the right moment (for example for an ACK) but from PC I always read high. I also made a simple test program only forcing 0 to pins C4 an C3 tryng to read from PC: if PC says high I read high even if PIC is forcing low.

I think that to make all works I need to use data lines adding an Open Collector driver, but my elettronic designer "don't care" about this.

Can someone help me ?

Thanks,

Best Regards.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri Feb 20, 2004 9:52 am     Reply with quote

I did something once using one line as an output through a diode that allowed the output to act as a pull down only and had another line reading the state on the other side of the diode. Your hardware guy should be able to make this work. You only need add 1 diode and attach an aditional line from the PC. Is it actually posiable to read one pin and write to another at the same time on the parrallel port?
fadeout



Joined: 28 Jan 2004
Posts: 15

View user's profile Send private message Visit poster's website

PostPosted: Fri Feb 20, 2004 10:00 am     Reply with quote

Dear Neutone,
first of all thank you for your reply.
Secondly yes, is possible to read and write: parallel port is seen as a "normal" register that you read and write. So I can read and immediatly after write.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri Feb 20, 2004 11:48 am     Reply with quote

So you can have some pins as input and some as outputs? I assumed it was all in or all out at any given time.
fadeout



Joined: 28 Jan 2004
Posts: 15

View user's profile Send private message Visit poster's website

PostPosted: Fri Feb 20, 2004 12:04 pm     Reply with quote

Well... maybe I'm in wrong. I'm not so sure. I think that some pins are input, some output and some I/O. I read Microsoft ECP Register implementation spec. from http://www.fapo.com/ieee1284.htm .

But at this moment I can't understand whats happening !

I found a lot of stuff in Internet about people using LPT and I2C and every one has a (different) circuit: how can I am the only one that do this without everything ?!?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group