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
  • Sorry, but too little info given.

    You don't mention anything about what motion controller you have.

    You mention DLL files, but don't mention what the DLL files were expected to do.

    Keil (we have to assume the IDE) don't need any extra DLL files for this project. The Keil tools are just there to create a project for a microcontroller and (optionally) to download that binary into the processor.

    The microprocessor obviously do not make use of any DLL files. It just runs the programs you write and download into it. And it doesn't take any DLL files for the microcontroller to be able to communicate on the UART.

    Note, however, that the microcontroller UART talks logic-level signals, while a PC serial port has level shifters to communicate with RS-232 signal levels. So if that motion controller have a serial port that can be connected directly to a PC (or a USB-connected serial port on the PC), then you need to have a RS-232 transceiver chip. For a microcontroller that has 3.3V logic levels, a MAX3232 might be used.

    So if the motion controller connected to the UART do support specific serial commands, then it is enough that you write a program that sends the correct commands. Note that in case it takes the commands as ASCII strings, then it might be sensitive to used end-of-line characters used when esnding the commands. In C, you have \r for carriage return and \n for new line. And, depending on setup, the \n in the source code might be expanded into a sequence of both characters.

Reply
  • Sorry, but too little info given.

    You don't mention anything about what motion controller you have.

    You mention DLL files, but don't mention what the DLL files were expected to do.

    Keil (we have to assume the IDE) don't need any extra DLL files for this project. The Keil tools are just there to create a project for a microcontroller and (optionally) to download that binary into the processor.

    The microprocessor obviously do not make use of any DLL files. It just runs the programs you write and download into it. And it doesn't take any DLL files for the microcontroller to be able to communicate on the UART.

    Note, however, that the microcontroller UART talks logic-level signals, while a PC serial port has level shifters to communicate with RS-232 signal levels. So if that motion controller have a serial port that can be connected directly to a PC (or a USB-connected serial port on the PC), then you need to have a RS-232 transceiver chip. For a microcontroller that has 3.3V logic levels, a MAX3232 might be used.

    So if the motion controller connected to the UART do support specific serial commands, then it is enough that you write a program that sends the correct commands. Note that in case it takes the commands as ASCII strings, then it might be sensitive to used end-of-line characters used when esnding the commands. In C, you have \r for carriage return and \n for new line. And, depending on setup, the \n in the source code might be expanded into a sequence of both characters.

Children