Shop OBEX P1 Docs P2 Docs Learn Events
i2c Master and slave — Parallax Forums

i2c Master and slave

Doug WheelandDoug Wheeland Posts: 4
edited 2007-01-16 05:38 in Propeller 1
This toy uses three cogs to run a Spin master and an ASM slave with wired bus.· I wrote it just to see how i2c basics worked but it might be used to develop master and/or slave functionallity.· One may also fault the bus lines to see if recovery logic works.·

The third cog runs what would normaly be a hardware start/stop detector for the slave.

Not much to it so folks new to programming will be able to figgur it out.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards, Doug W.

Comments

  • Marc GebauerMarc Gebauer Posts: 60
    edited 2007-01-07 17:45
    I was looking at your code and it·appears that·you are·clocking the i2c bus at 5kbit/s. Is this a limitation of the slave? Can you tell me what maximum speed the·slave is capable of? If I speed up·the master·clock to maximum, will·the slave·accept it·or will I have to make changes to it's code? Thanks.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Marc Gebauer) : 1/7/2007 5:49:15 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-01-08 00:08
    Doug Wheeland,

    After writing an I2C object "Master", the next natural thing to do is to write a "Slave" object...... You might reconsider this. Philips Semiconductor has the
    licensing rights for I2C and there is a potential for infringement when writing "Slave" code. "Master" code is grandfathered in, because it assumes that you
    have purchased the I2C license through the transaction of purchasing the I2C "Slave" device that you are planning on communicating with. If you create your
    own slave device, then the actual purchase of the I2C license is now out of the loop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Doug WheelandDoug Wheeland Posts: 4
    edited 2007-01-16 05:36
    Marc...· The slave will follow the master clock and should work up to the published limit for i2c.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards, Doug W.
  • Doug WheelandDoug Wheeland Posts: 4
    edited 2007-01-16 05:38
    Beau... Thanks for that info... I have no slave projects beyond this toy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards, Doug W.
Sign In or Register to comment.