Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 4 months ago. This question has been closed. Reason: Unclear question
hardware Interrupts and socket communication
I have the LPC1768 getting full bandwidth (400 Hz, 3 directions) data from an ADXL362 using SPI and writing it continuously to the SD card (some mangling of Tom Kreyche's original code for the adxl362 along with the SD card API). In a separate program space, I can get the 1768 to send data to my pc through a socket (using the mbed socket API and either a python script or Visual C++ written code using winsock libs on the PC). Great.
The ultimate goal here is that instead of writing data to disk, I want to send the data over a socket to utilize all of our existing signal processing systems. To do this, I combined both programs and removed the code that writes to the SD card. Now, execution hangs. Some judicious sprinkling of LED on/off codes (with BUSOUT) seems to show that the routine hangs when the adxl starts ( this generates an interrupt about 400 ms later). The actual interrupt routine does not ever get called.
Is there some inherent restriction using interrupts with the TCPSocketConnection API? I think I have encountered similar behavior with the socket API and something simple like a callback timer (Ticker API).
A rough idea of code flow is: 1) set up Ethernet and socket. 2) set up interrupt. 3) configure adxl. 4) start adxl filling its FIFO. 5) wait for interrupt. - an interrupt will be generated when adxl FIFO is ready to process. 6a) when interrupt occurs, copy data from adxl FIFO to mbed buffer. 6b) send data over socket. 7). back to 5.
This works great writing the SD card - which encompasses everything above except 1) and 6b). Adding the TCPSocketConnection requisite seems to cause the hang behavior.
To further elaborate the execution, the server side (PC) accepts the connection from the client (mbed) and is awaiting data with a blocking receive. The client acknowledges that the connection was made, then never gets to execute the socket.send code because it hangs.
Any ideas where I should go looking?
Question relating to:
![](/media/cache/platforms/LPC1768.jpg.50x50_q85.jpg)