Hi,
I have written code for communication between C8051F120 and C8051F350 using SPI. C8051F120 is running at 100 MHz and C8051F350 running at 50 MHz - which is maximum possible for both. SPI clock speed is 4.8 Mzh which is also maximum possible. I have a packet of size 14 bytes to send from C8051F120, which includes a header, stuffing bytes and finally the CRC.
the format of packet is something like this,
{0xAA,0x75,0xC1,0x05,0xFF,0xFF,0xFF,0xFF,0xFF,0xCC} at the same time C8051F350 is also sending a packet of the same size to C8051F120.
where first two bytes are header and third byte is the type of packet and fourth byte is number of data bytes going to transmit. It is followed by the actual bytes 0xFF and finally the CRC.
When this packet is recived properly C8051F350, from the first 0xFF, with each data byte(dummy byte , actually to get data from C8051F350), C8051F350 will send data to C8051F120 byte by byte.
In between this process ADC is working in C8051F350 and this data is put into packet and send. ADC is taking only a bit of time only decimation and averaging is maximum. And it is taking a litle bit of time for checking the type of packet and respond based on the type of packet.
Now i shall tell you the problem, for this much process it is taking almost 3 seconds to compleete the entire process. I tried many ways to reduce this, coz i want all to be happend in less than 800 mill seconds.
Have anybody came across such a situation and if so how did you solve it? Or is there any suggestion you have in this?
i cant tell u howmuch time exactly its taking coz theres no execution profiler in Silicon laborotories IDE with which i am wiorking. But the time i gave is approximatly correct.
Plz Help.
Regards Rijo