PDA

View Full Version : Two 18F4550 and One 74HC595 line How to ?



pretourian
- 21st January 2009, 10:28
Hi all,

Itīs been sometime since my last post in the forum so long that my account was deactivated. But I am back.

Iīve been working on this project which consists in 2 independent computers controlling audio switches (SSM2404) through their usb ports. We were thinking of something like two 18F4550, one for each computer and a few 74HC595, acctually there are 24 of them (too many audio lines). But here goes my questions.

1- How can I attach two PICs to one data line 74HC595 (data,clock,latch) in order not to have data conflicts? Will I have to double the 74HC595 or there is another way to achieve this ?

2- In order to save I/O lines from the pics is it possible to perform a 32 bits Shout command with 4 cascaded 74HC595. Something like SHOUT DTA,CLK,MSBFIRST,[$FE56\32] ?

Any help will be really appreciated.

PS:See the attached file.

mister_e
- 21st January 2009, 23:07
Several different ways to do this kind of patch bay. Easy way, use a busy line to know which pic is going to write/read the I/O expander (74hcxxx)...

each PIC interaction will begin AND end with an open collector output.. well says they will be set as input.

I'd already done a 948 studio audio patch bay controlled by 48 different PIC like that in the past, i used I2C i/o expander for that. Still on the market, no problem at all.

pretourian
- 22nd January 2009, 23:40
Thank you very much for your atention Mirter_e.
A "busy line" would work just fine but Iīve just realized that thereīs need to know which computer has set which I/O. I am not sure if explain myself. Whenever PC1 sets an I/O port it is supposed to be shown in the PC2 and vice-versa. (USB Read and Write).

So hereīs my idea from your tip. What if we have only one pic reading from or writing the I/O expander and whenever the second pic needs to do so, it just "tells" it to the pic number one through I2C ? Is it possible to have a bilateral comuniction with I2C ? See attached file.
I have no idea how the interruptions would work in this configuration

What do you say ???