2007 28 Nov

Still haven’t completed I2C Master/Slave communication test, but will move on!

I’m now defining how PC will communicate with PIC Master, how will the Robot computer send commands and receive data to the Master PIC. The Master PIC will them make the interface between PC and Sensors/Modules trough an I2C bus.

I have decided to send commands in the following format (PC to PIC Master - frame data):

<id, type, cmd, data0, data1, data2, data3, data4, data5, data6, data7, data8, data9>

id = device ID number (Slave or Master)
type = defines type of sensor/module {10=DCmotor, 11-Servo, …}
cmd = command
data0 to data1 = additional data

The Master PIC will receive the command from Robot computer (Via RS232) and parse it into a special object that will be sent to sensors/modules trough the I2C channel. After sending the commands in the I2C channel, the Master PIC will wait for the acknowledge of that command from the sensor/module. PIC Master will then read data from sensors/modules and save data into special object. When receiving the last byte from sensors/modules, PIC Master will them compose frame data and send it back to Robot computer. Continue reading »

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...