Shop OBEX P1 Docs P2 Docs Learn Events
Clock stretching supported in boot mode? — Parallax Forums

Clock stretching supported in boot mode?

Jimmy W.Jimmy W. Posts: 112
edited 2008-06-30 21:00 in Propeller 1
Does the prop support the eeprom stretching the clock when its booting?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-30 02:36
    No. This is manifest from the lack of a pullup resistor on SCL in most Prop boards.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-06-30 18:26
    Clock stretching is one of those aspects of I2C that just never got utilized in production chips. EEPROMS you would think would be the ideal candidate for it: when write is enabled, last clock is stretched until the write to memory has occured, but they don't use that, instead you have to poll a memory location.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • hippyhippy Posts: 1,981
    edited 2008-06-30 19:48
    It's a real shame that SCK is hard driven. As that seems to be only because of the way the Bootloader is written maybe Chip could have his arm twisted to make it soft driven for the Propeller Mk II ?

    That would allow multiple Propellers to all boot from the same Eeprom and use those I2C lines for inter-Propeller communications.

    I'm not asking for full multi-master I2C support or arbitration, that can be handled after boot-up by user-written I2C objects. Making it work is up to the develper but this would prevent the hardware damage which would currently occur if two Propellers had their SCK lines directly connected.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-30 19:52
    What makes a clock-stretching protocol difficult for EEPROMS is the way their page-write capability is implemented. To write a page after sending a bunch of data to the on-chip buffer, you have to send a STOP condition. But to do that, SCL already has to be high. At that point it's too late for the chip to hold SCL low to hold the bus.

    If writes to an EEPROM were restricted to whole pages of data only, the STOP would not be necessary to signal the end of a block, and the EEPROM could hold the bus after each group of 64 (or whatever page-length) bytes until the write is complete.

    I have a feeling that manufactureres are reluctant to implement bus-hold in their slave devices since so few masters support it. In that light, it's kind of a chicken-and-egg problem.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • hippyhippy Posts: 1,981
    edited 2008-06-30 21:00
    A totally transparent solution ...

    Clock stretch can be deferred to the next time the device is accessed. If the write cycle is complete no stretch, otherwise stretch a clock cycle sometime during the location address. That means further access blocks until the previous write cycle completes.

    Leave stretching to the last instant and there's a greater chance a write will have completed before holding up the next access.

    That's a very useful technique for Propeller-based I2C Slaves, and far better than guessing how long a delay is needed after each access. All it needs is an I2C Driver which supports clock stretching.
Sign In or Register to comment.