Shop OBEX P1 Docs P2 Docs Learn Events
use of IC2 — Parallax Forums

use of IC2

hterrollehterrolle Posts: 30
edited 2008-02-10 23:05 in General Discussion
Hi,

I got a CMPS03 connected to the IC2 using newIC2(SDA,SCL) on CPU.pin09 and 10.

Now i want to add an SFR08. So, do i need to create a newIC2(sda,scl) or can i use the same as the CMPS03 ?

By the way i find on the forum an example using the abstarct class I2Cdevice. Can i use this class with the same CPU.pin that the CMPS03.



thanks

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-02-09 20:51
    You only need to create a new I2C if your new device is
    on another I2C bus (eg. different SDA and SCL pins).

    You can also use the I2Cdevice class. That hides all
    the start, restart and stop commands.
    You can download the I2Cdevice class (abstract) and
    its extended classes here:
    http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/protocol/i2c/

    regards peter
    ·
  • hterrollehterrolle Posts: 30
    edited 2008-02-09 21:11
    thaks you Peter for the answer,

    for performance purpose. i think that it is much better to use the same SDA and SCL for the two module CMPS03 and SFR08.

    So i do not have to add code by creating a new Object class.

    By the way does 2 IC2 open could do parallel work ? i do not think so but ?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-02-09 21:19
    You could interleave code for multiple I2C buses, but since the
    I2C code is executed as foreground code, it means the speed
    at which data is written/read on each bus will be decreased.
    However, when writing to eeprom, there are 5 millisecond delays
    (during which the eeprom stores its incoming data)
    which could be used to write on a second I2C bus.

    regards peter
  • hterrollehterrolle Posts: 30
    edited 2008-02-10 18:57
    hi, peter i am wondering if i can and some ram memory to the jevelin.

    In fact following your last message i thougth about sending all the reveided data comming from the sensor to this ram (as eeprom would die very quicly)

    It is possible to to such trik ?

    So it should be possible to use less of the javelin bus and incrise performence.

    As i am very very beginers in electronic i would like to know you idea but this idea.

    Regards herve
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-02-10 19:56
    It is of course possible to store received data in an external memory,
    like eeprom or fram (much like eeprom but unlimited writes, www.ramtron.com ).
    But that will double the datatransfers so it will not increase
    performance.

    regards peter
  • hterrollehterrolle Posts: 30
    edited 2008-02-10 22:53
    of course,

    By the way there is on the demo board an X1 with also PO,P1 exct ....

    What it is use for ?

    thanks
  • hterrollehterrolle Posts: 30
    edited 2008-02-10 22:56
    sory i forgot,

    how it is possible ot increase performance is i wannt to use many sensor.

    I thougth about adding a new microcontroleur. But i do not know if it is possible to manager 2 microcontroler and share information between ?

    thanks again
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-02-10 23:00
    X1 is the APPMOD header. Parallax sells addon products, some of which
    have an appmod interface, meaning you can connect them directly
    to the javelin board.
    However, you can also use it for parallel connections to the same I/O pin.

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-02-10 23:05
    You can always add another microcontroller and use any protocol
    to interchange data between the javelin and this microcontroller.
    However, I would first setup a system with only the javelin, making sure the sensors work
    and give back expected results. Then see if you can maximize
    performance, and if performance is less than needed, add
    another microcontroller that strictly deals with the sensor interfaces.

    regards peter
Sign In or Register to comment.