View previous topic :: View next topic |
Author |
Message |
bwgames
Joined: 21 Jul 2005 Posts: 36
|
2 wire interface to a PIC using C? Is it i2c? |
Posted: Thu Aug 25, 2005 4:14 am |
|
|
Hiya,
I'm trying to intergrate a programmable oscillator (DS1077 (link to datasheet/info etc)) into a circuit, in place of a crystal oscillator.
What I'm looking to do is to be able to program it on the fly from a PIC, and according to a very informative AppNote (AppNote 171), I've got an idea of how to program it, but unfortuately the code is in assembler, not C.
Its two pins, one a clock signal, the other data, which isn't that difficult.
I had major problems trying to get a similar circuit to work for another application, so I'm looking at ways of speeding it up.
I'm new to PIC programming, but is I2C any relevance to what I want to do? I keep hearing mentions of it on the forums, but I don't have a great understanding of what it is...
Thanks:) |
|
|
valemike Guest
|
|
Posted: Thu Aug 25, 2005 7:48 am |
|
|
First of all, you should look at the timing diagrams to see if it truly is i2c-like or proprietary.
Also, "2-Wire interface" seems to be a term that is synonymous with i2c. It's just the company doesn't want to get in legal trouble with Philips who has that name trademarked. |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Thu Aug 25, 2005 8:10 am |
|
|
It is I2C. Also, Maxim does have an application note for writing PC C code to program the part through a parallel port. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
bwgames
Joined: 21 Jul 2005 Posts: 36
|
|
Posted: Thu Aug 25, 2005 8:13 am |
|
|
I've read the PC parallel notes, but I'm looking to control it from a PIC, is it simple enough to adapt the code?
Thanks |
|
|
Ttelmah Guest
|
|
Posted: Thu Aug 25, 2005 8:15 am |
|
|
The big 'caveat', is that you either have to set your I2C rate to always be 'in spec' at the fastest clock rate, or you need to change the I2C speed definitions, when you change the multiplier byte in the chip.
If you use the software I2C implementation, and add a new USE_DELAY statement for the new rate, once the speed change occurs, the compiler _should_ handle this for you...
Best Wishes |
|
|
|