<alessandro.cofanelli@...> wrote:
>
> I've downloaded and read the whole manual.
> My troubles are?
>
> Can the 4 com ports be all used at the same moment?
> Is the micro fast enought to calculate 4 different PIDs (for 4
> motors) with a max delay of 10 milliseconds?
>
> What my application have to do is:
>
> read the analog value of input 1
> Calculate the pid
> Send the correcting value by com1
>
> read the analog value of input2
> Calculate the pid
> Send the correcting value by com1
>
> read the analog value of input3
> Calculate the pid
> Send the correcting value by com2
>
> read the analog value of input4
> Calculate the pid
> Send the correcting value by com2
>
> All the 4 tasks have to be completed in a total time interval of 10
> Milliseconds.
Well, all you have to do is add up the total number of characters to
be transmitted to get the answer. At 9600 baud, it takes about 1 mS
to transmit 1 char. But that would assume that the A/D input and
calculation took zero time - they surely don't. For the bit-banged
serial port, there is no buffer. So, no overlapped IO.
You only have integer math (unless you tack on an external floating
point unit) and MAYBE you can execute 400 lines of code per second -
about 2.5 mS per line. Some lines take longer than others. But even
if you assumed 1000 lines of code per second, it would mean 1 mS per line.
You have a budget of 2.5 mS per channel so I certainly wouldn't think
it would work.
Extensive calculation and bit-banged serial IO is not a good fit for
the OOPic.
Richard
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment