Page 1 of 1

Setting up the PICs

Posted: Thu Jan 03, 2008 7:17 am
by Silver Blade
Most of the guides I've found on IRQs/PICs seem to send an init sequence to both PICs at the same time.

So, it sends the first byte to PIC 1, then to PIC 2.
Then it sends the next byte to PIC 1, then PIC 2.
...and so on.

Is this actually necessary, or can the entire init sequence be sent to each chip separately/individually?

The only reason I can think that this might not be appropriate is that the chips are set up for cascade/slave etc. at the same time and I'm not sure if this is really necessary or not.

Also some guides suggest the use of an I/O "wait" function between sending each byte. Does this really offer reliability or other advantages? (I do it anyway...)

Posted: Thu Jan 03, 2008 7:46 am
by Combuster
The key is that old PICs need some delay between writes. So you offer them that delay by doing an OUT to the otherPIC. Pretty much the most efficient way of doing things.

But as long as you provide the delay, any method should work.

Posted: Thu Jan 03, 2008 11:52 am
by Silver Blade
I see!

Though one tutorial I read seemed to do both (ie, alternate writes to the PICs *and* have a delay after each write! :lol: )

The alternating PIC access does make more sense now.