This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sending text based command to 3rd party device using UART in LPC2478

I am using PI motion controller which has integrated DSP Processor (we don't have any details about the Processor). I have programmed the motion controller to drive piezo motor using MATLAB however i would now want the motion controller to recognize command sent from the UART (UART2) port of LPC2478. I already set the baud-rate and number of bits to be sent identical to the one given in datasheet and i also used the same setting in MATLAB program.

I feel that the 3rd party device is receiving the data but maybe is not able to interpret.

We are trying to send a text based command (like, MOV 1 8)

When we were programing through MATLAB it need certain DLL files but when we are trying to program it via keil , it doesn't support a DLL file. How should we import a DLL file in keil or other than using a dll, will there be any other way to make the motion controller recognize our commands.

BLOCK DIAGRAM

KEIL ---> ARM (LPC2478) ---> UART -|-|-|- 3rd party device UART ----> DSP Processor ---> PIstage (error in communication)

Parents
  • We also tried to send command set like :-

    UART_PRINTF("MOV 1 4");
    UART_PRINTF('\n');
    UART_PRINTF('\r');

    or

    UART_PRINTF("MOV 1 4");
    UART_PRINTF('\r');
    UART_PRINTF('\n');

    UART_PRINTF has been tested to work properly.

    The motion controller only support those languages which support loading of DLLs.
    In VB++ they included windows (#include <windows.h> #include <conio.h>) and DLL files similar to C++.

    So, is there any way by which we can bypass these DLL files using KEIL IDE.

Reply
  • We also tried to send command set like :-

    UART_PRINTF("MOV 1 4");
    UART_PRINTF('\n');
    UART_PRINTF('\r');

    or

    UART_PRINTF("MOV 1 4");
    UART_PRINTF('\r');
    UART_PRINTF('\n');

    UART_PRINTF has been tested to work properly.

    The motion controller only support those languages which support loading of DLLs.
    In VB++ they included windows (#include <windows.h> #include <conio.h>) and DLL files similar to C++.

    So, is there any way by which we can bypass these DLL files using KEIL IDE.

Children
  • It doesn't matter to the Keil IDE that they have supplied you with DLL files.

    The Keil IDE do not care about any DLL files related to any motion controller. The Keil IDE isn't even involved in the running of software within your microcontroller. And no - the microcontroller will not care anything about any existence of any DLL files either.

    So it all comes down to the documentation you have for this motion controller of yours. That documentation should be able to inform you exactly the format of the commands sent to it. Unless, they actually have a motion controller with a undocumented communication protocol, and have Windows DLL files that specifically takes text commands and parses the commands and send something completely different to the motion controller. In that case, you are stuck.

  • If you don't understand the documentation you have for this motion controller, then you need to speak to the manufacturer and/or supplier for support on that - it has nothing to do with Keil!

  • Baudrate and number of bits set - then you suddenly talk about a USB sniffer. Why?

    Exactly what interface do you have between PC and motion controller. Baudrate and number of bits would normally indicate a RS-232 link. You don't set these parameters for a USB channel - USB have automatic methods to figure out transfer rates, and don't have any setting for number of bits, being designed around frames of varying number of bytes.

    Their web page mentions "USB, RS-232", but sniffing the USB interface is not guaranteed to tell you the protocol information on the RS-232 port, unless that USB is just presenting the motion controller as an extra serial port on the PC.