Using pins 28-31 after boot
Kallikak
Posts: 8
in Propeller 1
Hi,
I am wondering what people here think of the suggestion from this post:
https://electronics.stackexchange.com/questions/271448/microcontrollers-disconnect-i2c-and-serial-lines-after-loading-from-eeprom
Here's the circuit:
The idea looks good to me, but I'm wondering in particular whether transients in the S-R latch on powerup will be problematic for the EEPROM loading.
Ken
I am wondering what people here think of the suggestion from this post:
https://electronics.stackexchange.com/questions/271448/microcontrollers-disconnect-i2c-and-serial-lines-after-loading-from-eeprom
Here's the circuit:
The idea looks good to me, but I'm wondering in particular whether transients in the S-R latch on powerup will be problematic for the EEPROM loading.
Ken
Comments
Muxes are usually unidirectional and may interfere with I2C at bootup.
Yes. I'm sure he means using an analog switch.
I understand avoiding when possible, but if the pins are available for general use after boot it seems reasonable to consider using them.
I think 50ms to boot after transition from low to high on reset will ensure the approach is effective.
Ken
Your code cannot run until it is loaded into RAM. Once your code is running, it is free to use the pins -- no timing from reset is required.
P28,29 are connected to the I2C bus of the EEPROM and as the name implies, it is a bus that is shared with other devices, most commonly RTC chips but also many others such as I/O devices. I also use these pins as clock and data for shift register outputs in which case I just need one other I/O as the strobe and clocking data does not interfere with I2C chips since their "chip select" needs a start condition and device address anyway. Besides my software needs to use EEPROM because it is also general-purpose non-volatile memory and I use the upper 32k or more for driver objects, logging, settings, etc.
P30,31 I use constantly since I use Tachyon for programming and debugging and on many occasions I also have Bluetooth serial connected to these pins.
I won't go into the many ways I use and need these pins for communication because the forum software has a limit on the message size and there is no point in listing the many reasons why in much the same way we might not try to explain why we can't just tape our mouth shut between meals, since you might reason that you only use it for eating (uh uh, don't say a word).
So while we might not even bother to comment on the merits and many pitfalls of your switching scheme, we are happy to comment on making effective use of the I/O that you need to use, if you would like to kindly list them. Obviously if you need it for "almost anything" then maybe you don't need them at all because if you need them at all then you know what you need them for.
BTW: If your I/O is slow, there are plenty of I2C I/O expanders around...
Assuming that you have some GPIO that dont have to be particularly fast. You can just connect it up alongside the eeprom and your done.
You have to treat each design case on the pin requirements.
So, if you are running out of pins, then you need to list what you are doing. Otherwise we cannot help. ie there isn't a generic solution here.
You'll need to have pullups on both I2C lines, note, and maybe on the TX pin too to avoid line noise. That should
avoid any transients I think.
As I was using it on a DracBlade circuit I used the start up of the Horz syncs to drive a diode and capacitor to raise the DC to do the switching of the I2C lines. That made sure that all of the transfer to the Prop had finished before anything got disconnected.
I made sure that there were a couple of pull up resistors on the "eeprom" side to keep things happy.
All that was a few years ago ...