serial stops between mbed and processing

359 views Asked by At

I want a solution right now...

The LPC1768 which is one of a mbed prototyping boards communicates with processing through Serial whose baud rate is 115200. However, as time passes, the serial communication stops.

As a situation, the LPC1768 sends sensor data with serial.putc() of the default serial library. On the other hand, processing receives the data with serial.read(). The processing code is the following:

if(serial.available()>1) { serial.read(); }

To explore the solution of this problem, I tired these things.

  • I checked serial.available() is 46 and used serial.clear() in processing, but mbed stopped and didn't send data. Because I thought the cause of this was an overflow of receiving buffer of processing.
  • I added serial.writable() and check the serial buffers for sending has space. If there are no space, I used the following codes and initialized the serial:

    LPC_UART2->FCR |= 0x06; 
    serial.baud(115200);
    

, because I thought the cause of this was an overflow of sending buffer of mbed. However, they didn't work.

Please note that these codes work correctly and basically. However, serial communication stops suddenly. What can I do anything else?

Best regards

0

There are 0 answers