Re: Multi Pic Control Board
I have found that saving money on hardware is the most expensive thing you can do. I use 18F8723's for some pretty mundane tasks, simply because by using that part, I don't have to worry about codespace, or speed, or what peripherals it doesn't have, and then spend time working around the limitations.
It can be rewarding to build a complete system with a device that has only has 2K of FLASH, but very few outside of this group will recognize your brilliance. I would just use both serial ports of a second 8722 and be done with it.
That said, I have recently become a fan of I2C, now that I have a good interrupt-driven slave working. I2C is handy because it doesn't generate an interrupt if the address doesn't match. It is also fast ~200Kbaud.
For device-device transfers using a port, you can use a method that I once used:
Connect two ports together, use one more line as a "ACK" line and two more to connect to each other's PORTB.0. When one device wants to speak
to the other, he checks the ACK line for a "high" (bus empty), places the data on the port, and toggles the interrupt (of the other device). The other device's ISR pulls the ACK line low, grabs the data, and then lets the ACK line go high (it is driven open-collector, and has a pullup). Whenever a device isn't sending data, its port is tri-stated. You can even use a couple more lines to indicate the type of data being transferred. It is a little messy, but it does work. I used it when I had an application similar to yours - that needed 4 UARTS, so I "lashed together" two 8723's.
Re: Multi Pic Control Board
Quote:
Originally Posted by
shawn
I have the software for communicating on the modbus 485 network working but only with a master and one slave. I am getting no bus collisions and all is fine. However I can see in the future that when I get multiple devices on the network my pic is going to be pretty busy dealing with network (bus) traffic and not have a lot of time for anything else.
First of all, you cannot get collisions in a well behaved modbus environment. An occasional hiccup may occur due to false interpretation by multiple slaves. Modbus RTU is typically a master-slave protocol and unless queried, a slave will not reply.
Usually there is only a single master and multiple slaves. This kind of load is easily handled by any PIC with a hardware UART and I do not think you need another comms processor for that.
If you are trying to do a peer-peer network which is also called a multi-master topology, you can anticipate collisions to be the norm. For this, you need to implement CSMA/CD on your PIC. Again, this is no big deal for a microcontroller running reasonable baud rates like 9600/19200.
For the small packet sizes you talk of, I do not think you need bother with the comms processor for your CPU.
This is my way of thinking. YMMV
Cheers