Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Processing data quickly in autonomous (http://www.chiefdelphi.com/forums/showthread.php?t=32067)

jgannon 04-01-2005 02:03

Processing data quickly in autonomous
 
I'm working on some code that requires processing data more frequently than every 26.2ms. In driver-controlled mode, this is not a problem, because I can use Process_Data_From_Local_IO(). However, the autonomous function waits for statusflag.NEW_SPI_DATA before every loop. Is there any reason that I can't put a call to Process_Data_From_Local_IO() outside of that if statement? I can't imagine why it wouldn't work, but I want to make sure that it's not going to do bad things if I do.

Tom Saxton 04-01-2005 02:40

Re: Processing data quickly in autonomous
 
Yeah, we did that last year, it worked great. You can also use interrupts, which we used for counting encoder ticks.

jgannon 04-01-2005 05:29

Re: Processing data quickly in autonomous
 
Yeah, interrupts are the only way to go for encoders. However, the interrupt handler is a bad place to be doing math for other sensors. Thanks for the info... being able to process data quickly in autonomous will help immensely.

Greg Ross 04-01-2005 14:44

Re: Processing data quickly in autonomous
 
Quote:

Originally Posted by jgannon
I'm working on some code that requires processing data more frequently than every 26.2ms. In driver-controlled mode, this is not a problem, because I can use Process_Data_From_Local_IO(). However, the autonomous function waits for statusflag.NEW_SPI_DATA before every loop. Is there any reason that I can't put a call to Process_Data_From_Local_IO() outside of that if statement? I can't imagine why it wouldn't work, but I want to make sure that it's not going to do bad things if I do.

Actually, the call to Process_Data_From_Local_IO() IS outside of the if statement. And there is no waiting going on. The main loop simply checks the statusflag.NEW_SPI_DATA flag to see if new data is available from the master microprocessor. (It only reads memory. I doesn't make a function call.) If there is data available, it is processed, and then regardless of whether there was NEW_SPI_DATA available, it calls Process_Data_From_Local_IO.

[edit]
Sorry. I missed that you were talking about autonomous mode. I'll get back to you on that (if someone else doesn't beat me to it.)
[/edit]

Max Lobovsky 04-01-2005 14:45

Re: Processing data quickly in autonomous
 
I tried to fix that, but I seemed to have failed. See this post: http://www.chiefdelphi.com/forums/sh...threadid=32073


All times are GMT -5. The time now is 02:47.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi