Shop OBEX P1 Docs P2 Docs Learn Events
So, I use the external EEPROM... — Parallax Forums

So, I use the external EEPROM...

MarkSMarkS Posts: 342
edited 2007-12-18 05:40 in Propeller 1
to store a program, correct? After loading, the two I/O pins are free to be used, again, correct?

Question...

How do you disconnect the EEPROM after the program is loaded? For the application I'm doing, all I/O pins will be outputs. How do I keep from trashing the data in the EEPROM? A diode will not work in this case, as it would block the I/O line(s) during the boot load. What am I missing? confused.gifconfused-8.gif

Comments

  • MarkSMarkS Posts: 342
    edited 2007-12-12 02:53
    OK, I forgot about the write protect pin on the EEPROM, but with the SDA and SCL pins suffer any adverse effects from having PWM pulses shot at them constantly?
  • hippyhippy Posts: 1,981
    edited 2007-12-12 03:03
    Ignoring the fact that the data line from Eeprom is an open-collector, pulled-up, active low line; after the pull-up to the Propeller it's just a high/low data line, and read only during booting, so any means of tri-stating that line to the Propeller would work there. I don't know if the Propeller supports clock-stretching on the clock line, a lack of pull-up suggests not, in which case it's an output only line to the Eeprom which can simply be gated.

    You'd need some means of enabling / disabling access to the the Eeprom. !Reset can enable it and a 'first pulse' from any I/O not used until after booting is complete could be used to disable access.

    Alternatively it may be possible to do it by keeping the clock line to the Eeprom high which could be done using simple diode mixing and the enable/disable access logic.

    Added, posts crossed in the ether : Write Protect alone won't be good enough. The Eeprom could interpret the signals as a 'read command', output data and interfere with the Propeller output, pulling a high line low.
  • MarkSMarkS Posts: 342
    edited 2007-12-12 03:07
    So, I'm to assume that no one uses these pins for anything else, even though they can? This is going to be an issue. I need 30 of the I/O pins for LEDs and two for an I2C bus to other Props. There is no way around this. All of the pins will be needed.

    I'm making a large (understatement!) Tetris game. It will consist of a 10 x 20 grid of 4" x 4" cells. One Prop (20 in total) will control the LEDs for a single row, consisting of 10 red, 10 green and 10 blue LEDs. Each Prop will only be responsible for its row, but they will all need to communicate so that they know when a piece is about to drop through their row and it's orientation and position.

    Post Edited (MarkS) : 12/12/2007 3:21:42 AM GMT
  • GavinGavin Posts: 134
    edited 2007-12-12 03:19
    Use the same pins for the I2C bus, as long as the other parts have different addresses than the boot EEPROM you should be ok.
    The I2C protocol uses addresses so put the other props on unused addresses.
    You could have RTC, I/O expanders, serial LED drivers etc all on these two pins.

    Gavin
  • MarkSMarkS Posts: 342
    edited 2007-12-12 03:23
    Gavin said...
    Use the same pins for the I2C bus, as long as the other parts have different addresses than the boot EEPROM you should be ok.
    The I2C protocol uses addresses so put the other props on unused addresses.
    You could have RTC, I/O expanders, serial LED drivers etc all on these two pins.

    Gavin

    Thanks for the info. I need to read up on the I2C protocol. I've never dealt with it before and haven't the slightest clue as to how it works. All I know is that it will work in this application.
  • hippyhippy Posts: 1,981
    edited 2007-12-12 11:49
    MarkS said...
    So, I'm to assume that no one uses these pins for anything else, even though they can?

    Could be, or those using them aren't here or speaking out on how they achieved it.

    I have a design to use a PICAXE/PICmicro communicating on the I2C data line which will work alongside I2C. Providing I2C clock is never asserted the Eeprom should never do anything nor interfere with what's on the data line. The Propeller and micro can communicate using a bi-directional serial protocol. A particular long low on the data line which will not occur during normal Eeprom access is used to tell the micro it is about to be communicated with.

    To re-use the I2C lines there are two things you need to achieve -

    1) Changing I2C clock and data lines must not cause the I2C devices to perform any adverse unintended operation.

    2) I2C devices must not interfere with clock and data lines when they are not being specifically controlled.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-12-12 11:58
    > So, I'm to assume that no one uses these pins for anything else, even though they can? This is going to be an issue.
    > I need 30 of the I/O pins for LEDs and two for an I2C bus to other Props. There is no way around this. All of the pins will be needed.

    Yes, I'm using them. For other devices on the I2C bus. wink.gif
    Are you aware, that there do exist LED-drivers that connect to the I2C-bus?
    Also shift-registers that can be used to drive LEDs and thus saving you lots-o-pins?


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • MarkSMarkS Posts: 342
    edited 2007-12-12 19:51
    Nick Mueller said...

    Are you aware, that there do exist LED-drivers that connect to the I2C-bus?
    Also shift-registers that can be used to drive LEDs and thus saving you lots-o-pins?

    Thanks for the tip! yeah.gif

    I was trying to keep the component count low. Searching Digi-Key's site, I found this: TCA62724FMG. If I did it the way I was planning, I'd need 30 MOSFETs, a bunch of resistors and other stuff. Each LED will be mounted on its own small PCB, so I could just add this chip to the PCB. The driver board would then shrink to 10 connectors and the Prop. This will reduce the component count by 2/3 and each of these driver chips cost the same as two of the MOSFETs I was going to use. Moreover, the SCL line will be the same for all 20 rows, so I could do this entire thing with one slave Prop and 21 I/O pins.

    Just curious though... How would you use a shift register in this application. A shift register is either cycling one high signal or one low signal along the outputs. How would that work in this application?
  • JoergJoerg Posts: 91
    edited 2007-12-12 20:01
    What about building up your own multiplexer?

    Saluti Joerg
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-12-12 20:35
    > Just curious though... How would you use a shift register in this application.

    I was too brief.
    I meant a shift and latch. Shift in the bits with a Clk and a Data and then store them and change the output by a strobe line.
    Something like a CD4094BC. Normaly, they can be cascaded.
    The type I gave you isn't the perfect solution, but it was the first hit. smile.gif


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • bambinobambino Posts: 789
    edited 2007-12-12 22:57
    I don't know how low a component count you need but here's just a thought. A relay or signal switch from Maxim could be inserted on the sca and scl lines with a RC timing circuit attached to the switch. Set the resistance high enough to not throw the switch until the Prop has been loaded and Walaaa!

    This circuit has not been tested by me, and me nor my dog will be held liable in the event Polar ice caps melt due to the use of said circuit.
  • kevin101kevin101 Posts: 55
    edited 2007-12-18 04:57
    To save I/O You could charlieplex the leds. using a 568-3354-5-nd from digikey, you get 40 I/O from the i2c expander. Using charlieplexing you can control 1560 leds with this IC. The formula for calculating the # of leds is :
    #number of I/O^2-# of I/O
    40^2-40=1560
    There are some disadvantages, the wiring is more complex, the leds have to be able to withstand reverse voltage, and the control code would not be fun.

    Charlieplexing theory www.instructables.com/id/Charlieplexing-LEDs--The-theory/

    Post Edited (kevin101) : 12/18/2007 5:07:41 AM GMT
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2007-12-18 05:40
    You could also use the Texas Instruments TLC5940 LED control chip (they have other chips as well). This is the chip I used in my DMX LEDs on my bookshelf posted in a recent thread. The chip is basically a serial shift register with latch. Data is shifted out of the prop to the chips. There are 16 channels per chip. Each channel has 12 bits of control. Depending on what chip package you chose and your PCB design you can have currents up to 160mA per channel. You can use multiple channels for higher current. Depending on what speed you need, you could code your routines in SPIN or ASM. Multiple chips can be daisy chained together. I bet you could do the whole tetris game in one prop with several slave boards.

    I know this doesn't exactly answer how to use the data lines, but this is another approach to help you reduce part count and I/O count.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter
    tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
Sign In or Register to comment.