Em 4/2/2010 07:26, Alan B. Pearce escreveu: >>> Why don't you connect 4 PIC16Fs in an I2C arrangement? >>> Each one would be a UART port? >>> The PIC16F87 comes to mind...One as I2C master, 3 slaves... >>> = >> Some points against this idea: >> >> 1) You would need to write two different firmwares (if you use >> the same parts for master and slave, take care not to mix them); >> = > It is not that hard to write the firmware so that all 4 copies are = > identical, and the master/slave relationship is determined by the address. > = But your firmware would need to embed the complexity of the two versions anyway. Would it fit in 4 or 8k words? How about 64k words of flash? >> 2) Program the three slaves with different addresses (or waste >> at least two pins for address); >> = > But with the extra chips, there are probably going to be sufficient extra = > pins anyway. > = Probably. >> 3) Deal with an extra protocol (I2C) and bus (don=B4t forget >> that some PIC=B4s I2C modules don=B4t work well in slave mode); >> = > I2C as a protocol is pretty straight forward. Microchip has some example = > code that seems to work well, it certainly did for me. > = Even if it works, you would be using more parts and code to do the same job. >> 4) I2C is slow, its bandwidth may be insufficient for >> three 38400bps channels; >> = > Given the constraints he mentioned, I think a 400kbps I2C channel will be = > sufficient. > = Don't forget that small PICs don't have DMA, you would need to read the data from the slaves in busy-loops or in an interrupt routine. Assume a PIC16 at 20MHz =3D 5MIPS. 3*38400bps=3D115200bps 5000000/115200=3D43,4 instruction cycles. You would have 43 instruction cycles to receive each byte from the slaves, not accounting for I2C protocol overhead and the transmission side of the thing. It would be hardly doable with interrupts, and if so it would waste a very large of the CPU time both with interrupts and with busy-loop approach. You don't know what more the OP needs to do with the firmware. >> 5) Use more board area than one single bigger chip; >> = > I reckon I could get 4 SOIC 18 pin chips in a similar area to an 80/100 p= in = > TQFP. A 64 pin TQFP would be pushing it. > = The PIC32 I'm using is 64 pin TQFP and it has 6 UARTS. Don't forget the area taken by tracks betweens the chips. >> 6) May cost more than a PIC32. >> = > But would it cost more than a Maxim UART? = > = The point is: There are more than two options, why not choose the less expensive one? Besides, lots of MIPS (32-bit MIPS) make it even easier to program a successful application. Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist