FORUM TOPIC · READ ONLY

rs232gui data format

rs232gui data format

Forum : General Remark and Questions

9 message(s) · archive en lecture seule

ismaeelbit
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?

Pièce jointe : Data Logging results.docx

LubinKerhuel

Re: rs232gui data format

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

Re: rs232gui data format

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

Re: rs232gui data format

Citation : ismaeelbit
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

Re: rs232gui data format

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?

Pièce jointe : Data Logging results with explorer 16.docx

LubinKerhuel

Re: rs232gui data format

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

Re: rs232gui data format

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

Re: rs232gui data format

Citation : LubinKerhuel
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)