>
> i see, but we did some testing like when the oopic
> received the "$" the wheel will move left or right but
> the result is it doesn't move, its like the oopic is
> receiving data but can't find the "$" or the following
> characters. what could be the problem? thanks
You are hanging in the DO..While loop to read the characters. The
objective is to call the GPS input function from the loop in main()
and, if it gets a char it processes it. If not, it simply returns.
But it needs to be called OFTEN! And it might as well loop
on .received and eat all the chars in the buffer while it is
executing.
When the function finally has a completed lat/lo, it updates the
variables accordingly.
For this to work, the other functions can't hang around either. The
incoming buffer is 4 bytes.
As Dennis said, the OOPic can't keep up with a GPS under any
condition or, as I might have said, it is darn difficult and it is
about the ONLY thing the OOPic can be doing.
Let's say the OOPic executes about 1000 instructions per second
(although there are certainly examples where it only executes about
400). Four incoming chars takes about 13 mS so the buffer is full
(if starting from empty) in somewhere around 13 (or 5!) lines of
code. That is the buffer will be completely full - starting from
empty.
As you declare more objects, the code evaluation slows down.
It may be possible for the OOPic to keep up with the GPS but not with
a program of 700 lines of code. That oI2C object doesn't help
because I2C is bit-banged and quite slow.
I think your program overwhelms the OOPic's capability.
Try a processor that can support interrupt driven IO and a much
larger buffer. I would suggest an Atmel ATmega128 or even one of the
ARM chips like the LPC2148. Considering all the things that are
going on, I might also use one of the real time operating systems
such as FreeRTOS which has ports for both of these processors.
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