• AVR Freaks

Sending data from picgui block to dspic and filtering it

New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2015/01/02 11:50:55
  • Location: 0
  • Status: offline
2015/10/10 12:08:04 (permalink)

Sending data from picgui block to dspic and filtering it

I used fdatool to generate a simple lowpass filter for simulink, and included it in my project...
The objective was to test the filter, as a didactical example, so i wanted to send the data through uart to the  dsPIC, filter it, and show it in matlab...
I used the picgui bloc to plot the data and to send the signal i want to filter, but something is not working...
This is the script for the picgui:
idx = find(Rn > 65535 / 2);
Rn(idx)= Rn(idx)-65536;
[Rout tout]=padr(Rn,1,t_Rn);
axis tight;
What i wanted to do is to generate a sin signal, divide it's values in two bytes, and send it to the uart... my model would read from the uart the data, convert it to the corresponding number, apply the low pass filter, and send it to uart-matlab block...
However, the data that i convert from the bytes that arrive to the uart is not the data that i send from the picgui...
Could you help me a bit with this? I'll send you the model and a image of the picgui plot.

Attached Image(s)

Jump to:
© 2020 APG vNext Commercial Version 4.5