I'm trying to send 256-bit data frames from my PC (C# program) to mbed with the highest possible baud rate (921600 baud). Data frames are being sent continuously in a looping manner from my C# program to mbed, e.g. 2000000 frames of 256-bit. Using RPC library, I have written a few RPC fucntions in my mbed that I can call them from my C# program and send the frames as their argument. The (256-bit) frames are actually used to light an 256 LED array on my chip. Each bit is associated with one LED ('1' turn LED on and '0' turn LED off). Each frame should take less than 1 millisecond (including all the processing and decoding to the address pins) to light the corresponding LEDs. Therefore I have to receive the frames in mbed with the same speed I'm sending them (921600 baud). Unfortunately it is not the case. After sending two or three frames, the mbed stuck or I'm getting "write time-out error" in my C# program. I know that the new version of RPCfucntion library employs MODSERIAL. I also know that with MODSERIAL we are able to change the buffer size. So I should not really have any problem in receiving the data frames with highest speed in mbed and lighting my LED array even in a fraction of 1ms.
I have come to conclusion that the best way is to get around this problem should be sending considerable number of 256-frames via USB and store them in mbed using MODDMA not wasting CPU time. However, I have two main problems to implement this. If I send the frames as my RPCfucntion argument, I don't know how I should store them directly to DMA using MODDMA and MODSERIAL. Another problem is that when I store them, how I could get the address of the (DMA) destination to traverse and fetch the data frame by frame and process them in mbed to light the LED array. Please if you have any suggestion for how to solve this problem let me know as I'm currently perplexed and urgently need to find a solution!
I'm trying to send 256-bit data frames from my PC (C# program) to mbed with the highest possible baud rate (921600 baud). Data frames are being sent continuously in a looping manner from my C# program to mbed, e.g. 2000000 frames of 256-bit. Using RPC library, I have written a few RPC fucntions in my mbed that I can call them from my C# program and send the frames as their argument. The (256-bit) frames are actually used to light an 256 LED array on my chip. Each bit is associated with one LED ('1' turn LED on and '0' turn LED off). Each frame should take less than 1 millisecond (including all the processing and decoding to the address pins) to light the corresponding LEDs. Therefore I have to receive the frames in mbed with the same speed I'm sending them (921600 baud). Unfortunately it is not the case. After sending two or three frames, the mbed stuck or I'm getting "write time-out error" in my C# program. I know that the new version of RPCfucntion library employs MODSERIAL. I also know that with MODSERIAL we are able to change the buffer size. So I should not really have any problem in receiving the data frames with highest speed in mbed and lighting my LED array even in a fraction of 1ms.
I have come to conclusion that the best way is to get around this problem should be sending considerable number of 256-frames via USB and store them in mbed using MODDMA not wasting CPU time. However, I have two main problems to implement this. If I send the frames as my RPCfucntion argument, I don't know how I should store them directly to DMA using MODDMA and MODSERIAL. Another problem is that when I store them, how I could get the address of the (DMA) destination to traverse and fetch the data frame by frame and process them in mbed to light the LED array. Please if you have any suggestion for how to solve this problem let me know as I'm currently perplexed and urgently need to find a solution!