send more data within one time step

Create new topics, add your comment, remark, bugs...
Post Reply
Magic
Posts: 7
Joined: Thu Jan 15, 2009 10:06 am
Location: Taiwan

send more data within one time step

Post by Magic » Tue Mar 24, 2009 9:22 am

Hello Lubin,

I want to send 3 data(6 bytes) within one time step(0.0005s) and set Baud rate = 115200(kb/s).

And the max is 5.75 Bytes/Step was read on UART Configuration block.

Obviously, the UART can't not send 3 data within one time step.

Thus,from your example, I use the Tx_Output block(not the Tx_matlab) to send my datas.
2009-03-24_161523.jpg
On the rs232gui, I press down the RAW button and clear the script.
2009-03-24_161605.jpg
2009-03-24_161605.jpg (47.97 KiB) Viewed 4288 times
But rs232gui received nothing after dsPic started.

And the R is also all zero in workspace.

Could you help me? Thx!

or is there anthor way to send more data within one time step?

Magic
Attachments
MC710_ID2.mdl
(56.5 KiB) Downloaded 375 times

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

Re: send more data within one time step

Post by LubinKerhuel » Tue Mar 24, 2009 11:09 pm

Hi Magic,

Thx for the Screen shoot.

I am not sure that model was very well doccumented. However, you may find on the page :
On the embedded simulink model, a mechanism allow to send data during a predefined time: The model embedded on the dsPIC send data only when the value variable60 is different from 0. This variable is changed through the UART using the same rs232gui graphical user interface with the send1 and send2 button. When receiving values [60 x], the embedded simulink model load the value x into the Simulink variable 'variable60'. The Simulink model decreases automatically this variable at a sampling rate of 1 second. This mechanism makes the user able to log data during a predefined time.
There was on the original model a block with sublocks that received data from the UART interface. This one is not present on your model. It is inside the TinyBld Reset block in the model : http://www.kerhuel.eu/wiki/images/8/86/ ... ta_Raw.png

Anyway, to do it much more simple, replace the Triggered Log Data block by the Tx block it contains. (you don't really care about trigger here do you ?
You will then receive your data. But you are sending 7 bytes that is much that the max allowed by the UART as you mention. You should slow down the model time step to allow logging all datas. You may also just slow down few blocks (thus creating a multirate model).

Lubin

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests