Signalling between COGs via a pin
Cluso99
Posts: 18,069
Not sure if this has been mentioned before.
I know some of you want to signal a change in code between COGs and know that you can use a pin(s) to do this by writing (setting) in one cog and reading in another.
Typically, we do not reuse the SDA and SCL pins (P29 & P28) connected to the eeprom. SDA has a pullup on the boards I have seen, but not necessarily on SCL. You can use SDA as a tristate output (or just as a plain output if you want), provided you know that the eeprom will not be accessed by other cogs, once booting has taken place.
So one Cog can set/pulse P29 (SDA) either by presetting OUTA[noparse][[/noparse]29] := 0 and then by toggling DIR[noparse][[/noparse]29] between 0 (off meaning p29 will be high via the pullup) and 1 (on meaning P29 will be low by driving the line). The other cog(s) will look for the appropriate level on P29.
This will save a valuable pin, providing of course you are not already using this pin for something else (like my sram).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I know some of you want to signal a change in code between COGs and know that you can use a pin(s) to do this by writing (setting) in one cog and reading in another.
Typically, we do not reuse the SDA and SCL pins (P29 & P28) connected to the eeprom. SDA has a pullup on the boards I have seen, but not necessarily on SCL. You can use SDA as a tristate output (or just as a plain output if you want), provided you know that the eeprom will not be accessed by other cogs, once booting has taken place.
So one Cog can set/pulse P29 (SDA) either by presetting OUTA[noparse][[/noparse]29] := 0 and then by toggling DIR[noparse][[/noparse]29] between 0 (off meaning p29 will be high via the pullup) and 1 (on meaning P29 will be low by driving the line). The other cog(s) will look for the appropriate level on P29.
This will save a valuable pin, providing of course you are not already using this pin for something else (like my sram).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm