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)
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.
Yes, we are using the KEIL IDE.
We are using the PI C867 PILine Controller by PHYSIK INSTRUMENTE to drive a piezo nano positioning stage.
DLL file are provided to us by the company itself as a part of their software support. These libraries are used during run time of the MATLAB program. We can't be sure but we assume that they contain the translation of the PI GCS (General Command Set).
we tried to send these following commands :-
UART_PRINTF("MOV 1 4");
or
UART_PRINTF("MOV 1 4\r\n");
None of them are working. We are wondering if the manner in which we are sending end character is correct.
You mean this:
"
Nonsense!
The motion controller neither knows nor cares what is used to send commands - just so long as the correct commands arrive at its port, in the correct format.
You need to contact PHYSIK INSTRUMENTE for documentation on what, exactly, those commands & formats are.
If you want to reverse-engineer the communication, you will need some sort of serial port "sniffer" (aka "monitor" or "analyser") to see exactly what is being sent to the unit, and exactly how it responds...
Sir, I used a USB sniffer(USB Monitor Pro) and sent commands using MATLAB through a PC to Motion Controller (like i used to before i had started interfacing it with LPC2478).
This software on any bulk transfer (like copying pdf to a pen drive) has a monitor window which shows what is being sent from the device and to the device. During the process of sending command i could see number of changes happening in FLINK and BLINK but there is no information about data being sent to the device. From the device we are receiving "01 60" in hex continuously.
Could you recommend possibly a better USB Sniffer.
View all questions in Keil forum