rs232gui data format

Create new topics, add your comment, remark, bugs...
ismaeelbit
Posts: 19
Joined: Mon Feb 28, 2011 5:00 am

rs232gui data format

Postby ismaeelbit » Tue Mar 29, 2011 11:38 am

Dear Lubin,
I regarding the rs232 data format, I have tried to use int16 button and also simulate the data in Matlab.
The results are included in the attachment together with signal block setting.

I noticed the amplute to be aroung -1600 instead of 1000 input amplitude.

what do you think is wrong?
Attachments
Data Logging results.docx
(122.5 KiB) Downloaded 251 times

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: rs232gui data format

Postby LubinKerhuel » Tue Mar 29, 2011 12:28 pm

Ismaeel,

I do not see reasons for this problem.
There might then be a problem with your electronics.
Could you check the UART signal on a scope, is the signal clean (no capacitance). Check also the timing of UART bits.
Are you using external quartz, or the internal RC oscillator (which is not precise enough)

You could also try to make a blinking led at 1Khz (1ms) and checking the timing with a scope.

You may also try to use faster UART baud so as to have a delay between data sent at each step to allows resynchronization of UART for the case your quartz is not precise enough. Currently, your UART is overloaded as 6 bytes should be sent at each time step, but UART baud rate of 19600 allows only sending 1.9 data thus, all data are not being sent, and the UART is emitting continuously.

Lubin

ismaeelbit
Posts: 19
Joined: Mon Feb 28, 2011 5:00 am

Re: rs232gui data format

Postby ismaeelbit » Sat Apr 02, 2011 11:01 am

Lubin,
thanks for the support.
I already check external oscillator freq. and is ok at 8Mhz, also the LED blinks at 1s when tested. But when I increased the baud to 115200 I got this error:
?? Error using ==> plus
Matrix dimensions must agree.

Error in ==> D:\EMBEDDED WORKS\blocks\RS232_analyzBloc.p>RS232_analyzBloc at 120


Error in ==> D:\EMBEDDED WORKS\blocks\rs232gui.p>pushStart_Callback at 305


Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> D:\EMBEDDED WORKS\blocks\rs232gui.p>rs232gui at 43



But I tried it now with explorer 16 board is ok with 115200 baud rate.

What does about error messages imply?

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: rs232gui data format

Postby LubinKerhuel » Sat Apr 02, 2011 11:48 am

ismaeelbit wrote:What does about error messages imply?

By default, the rs232gui interface try to decode a frame whose definition is detailed here (french)

If data are too much corrupted, this error may appear.
You may try to reset the buffer (push button resetBuffer), bug if there is a problem with the UART rate, the error will appears again.

You could disable the frame decoding pressing once the raw button. Note that you will then get the raw data receiving by the PC UART (or virtual UART for Bluetooth connexion for example). It may be a way to manually check for data integrity.

Lubin

ismaeelbit
Posts: 19
Joined: Mon Feb 28, 2011 5:00 am

Re: rs232gui data format

Postby ismaeelbit » Fri Apr 08, 2011 1:50 pm

Data Logging results with explorer 16.docx
(66.12 KiB) Downloaded 203 times
Hi Lubin,
sorry for my disturbance. Am yet to get over the data transmission issue. I already got explorer 16 boar to examine the rs232gui data logging exercise am working on. I got good result with Matlab signal generator but with potentiometer and other external sensor, the data still remains corrupted. I hereby atatched the results for both the signal generator and onboard potentiometer on explorer 16.

Incase u have a sample mdl for external sensor u have tried, kindly let me know so as to compare if it is my setting is the one that is wrong or what do u suggest?

ismaeelbit
Posts: 19
Joined: Mon Feb 28, 2011 5:00 am

Re: rs232gui data format

Postby ismaeelbit » Fri Apr 08, 2011 1:52 pm

Data_Login_E3.mdl
(31.36 KiB) Downloaded 215 times
here is my simulink model for your reference

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: rs232gui data format

Postby LubinKerhuel » Fri Apr 08, 2011 3:45 pm

Ismaeel,

I could not figure out what the problem is as your docx file (please prefere to upload .png or .jpg file) shows the three output you sent to the Rx-Tx matlab block. Red curve is the matlab generated square signal, and blue and green are the ADC output raw data and its filtered version.
ADC data are 10 bits integer. Thus to convert the represented value to Volt, you should multiply by 3.3 / 2^10 (provided you are using a 3.3V cards which is probably the case)

Lubin

ismaeelbit
Posts: 19
Joined: Mon Feb 28, 2011 5:00 am

Re: rs232gui data format

Postby ismaeelbit » Wed Apr 13, 2011 1:03 pm

Yes. the curves are as you have identified. I am looking into your suggestion regarding the convertion. It is 3.3v and the ADC is 10bit as you have rightly said.
thanks

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: rs232gui data format

Postby LubinKerhuel » Sun Apr 17, 2011 6:12 pm

LubinKerhuel wrote:ADC data are 10 bits integer. Thus to convert the represented value to Volt, you should multiply by 3.3 / 2^10 (provided you are using a 3.3V cards which is probably the case)

do the 3.3 / 2^10 calculation within the rs232gui interface (i.e. receiver side) and not on the value beeing sent within the microcontrollers. (otherwise, you will get low resolution results as int : 0, 1 2 or 3)


Return to “General Remark and Questions”

Who is online

Users browsing this forum: No registered users and 1 guest