This robot will use 5 PIC 16F877 Microcontrollers, these will all be connected using a serial interface and communications protocol I have devised.
The 16f877 has ports A, B, C, D and E, these ports very in size with port A being 6 bits wide and port B being 8 bits wide, there are also several special connections which share these ports.
A single chip doesn't provide enough I/O's and instead of using 2 to make up the numbers I am going to place a chip in each sub system, this makes designing and building the system easier as everything can be modular.
One chip will control the motors, one will control the lights and horn, there will be one for the main sensor inputs and one for the traffic sign detector, a final chip will then control each of these.
This approach will create 5 threads which can run simultaneously, the 5 threads will make up for my inefficient code writing. This system will allow the sensor chip to constantly query the sensors, this way it will have the information ready as soon as the master chip calls, the same applies to the sign detector, the light controller will also be able to spend its time on the timing that is needed to flash the indicator lights.
Using 5 relatively powerful chips for a small robot is probably overkill but as I am not an expert on PIC programming this is the simplest system for me.
The different PIC's will all connect to the master PIC using a 4 wire serial interface I have designed, the 4 wires being START, DATA, CLOCK and ACK (acknowledge). As the master pic carries out its work it will request various bits of information from various devices such as the state of the sensors and issue instructions to the motor controller accordingly. Again because of my inexperience of code writing 4 data lines is the minimum I can use, I know this can be done with 2 wires as with most serial communication systems I dont know how to do it.