Using FPU_SPI_Driver with GPS_IO_Mini
Kschulz
Posts: 11
I am having issues with running both the uM-FPU 3.1.2 and a serial input from a gps. I am using the SPI driver for the FPU and GPS_IO_Mini for the GPS input. GPS_IO_Mini uses fullduplexserial_mini which causes the FPU to stop functioning. I am running fullduplexserial on a separate cog, so how could this cause the FPU to stop working? Is there some synchronization I am missing?
GPS_IO_Mini functions properly when both GPS_IO_Mini and FPU_SPI_Driver are running, but the FPU_SPI_Driver doesn't function. However, The FPU_SPI_Driver will function properly when GPS_IO_Mini is commented out.
Has anyone ran into this before?
GPS_IO_Mini functions properly when both GPS_IO_Mini and FPU_SPI_Driver are running, but the FPU_SPI_Driver doesn't function. However, The FPU_SPI_Driver will function properly when GPS_IO_Mini is commented out.
Has anyone ran into this before?
Comments
Perhaps you are the first to run into that. For the others it helps a lot if you are I bit more specific about the problem. Please give some info about
-What is the task?
-What is the hardware? Is the understanding of that crystal clear? If so than
-What are the concrete and relevant details of the software solution?
·
By the way, you can stop FPU easily, e.g. by sending an unterminated string to it. As far as I know FullDuplexSerial (and descendants) does not send the terminating zero byte. Take care (send it).
·
For me it is interesting to know that if you have a working GPS_IO_Mini object and a functioning FPU than why do you need the other? Both of them can handle GPS data easily.
·
One more question: (please don't be angry with me but I sometime teach EE students in lab practice)·Do··the GPS and FPU·use separate IO lines with the Prop?
As you stated in your reply, I could use the FPU to receive the GPS data and pass it to the propeller. I haven't tried this mainly because it seems more difficult to code and I am still a novice at spin. As a learing experience would like to figure out why the two inputs won't function at the same time. The final program will be reading serial data from an A/D converter for acc/gyro so I will probably have the same issue.
Your question about the input line is very valid. I have the GPS on pin 8 and the FPU is on 3, 4, 5
Any help greatly appreciated...
I am working on exactly the same thing.
So far everything is working except I am having trouble with the ATAN2 function also. (for getting bearing to target).
The distance part, I just basically copied from the GCDistance.fpu file
I'm not sure why you should be having trouble with the ports EXCEPT, I did have a problem with the SERIN port connected to a second USB port on the pc. I did have to change the
_Read_Setup_Delay long 14_400
in the FPU driver when using trace or debug. 15us is too short for reading string.
Let me know if you get the bearing formula worked out.
Post Edited (shanghai_fool) : 12/1/2008 6:08:38 AM GMT
More work tomorrow.
Yes I see the problem, and I see some problems in the code, too. (And that's good. For me the real problems begin when I have a "prefect" code but the program doesn't work.)
In the Autopilot 09 v4 test.spin:
-You call the FPU.ReadRaAsString with the argument 128 for the format byte. That’s probably not a valid value. 12 digits and 8 decimals (I guess) when the maximum digits is 9. FPU might translate it as zero because only the sign bit is one. Use zero instead to be sure.
-It's maybe a minor issue but FSET0 command is a single byte one and does not need a following zero. So, instead of calling FPU.WriteCmdByte(FPU#_FSET0,0) use FPU.WriteCmd(FPU#_FSET0). Zero is a NOP but one never knows...
I am going to reassemble my Prop/GPS/FPU combination to replicate the hardware you described (and those of shanghai_fool's) to allow a better check. That will take few days.
Thanks so much for trying it out for me.· I will make those changes you sugested.··I am interested to hear about what you find out.
shanghai_fool -
How are you getting your GPS data into the propeller?· Are you going through the FPU chip?
Kschulz
Currently I am using "FullDuplexSerialPlus". I plan to bring it in directly to the FPU after I have finished verifying all the instructions. I did set up the demo GC and GPS programs to check out the operation and to verify they would work with my 57600 baud 5 Hz. GPS. Right now, since I am learning both the Propeller and uM-FPU, I am taking this one step at a time. Having the FPU Serin available for debug purposes has been great once I figured out how to use it. I use a temporary repeat instructiion after the FPU code I want to test. This effectively "stops" the propeller so I can examine the FPU registers to see if what I think I am doing is what is really happening.
I am hoping the FPU can handle the GPS directly and still have time left for handling the Kalman filter floating point so I don't have to use another cog for that application. I think I will combine the FPU.spin with the GPS stuff to speed things up. It can stuff data into core memory so that other objects can use it, I hope. If not, I can just call the FPU/GPS object for the addresses.
Keep us informed with your progress since we are doing the same things. Maybe we can help each other.
Cessnapilot is the person that wrote the FPU routines and he knows the FPU. He is a valuable resource for this project. I'm not sure why there aren't more people using the FPU to do high speed floating point. Since it also has a couple of 12 bit A/D pins as well, it could be the only external device needed for some projects.
I use "PC_Interface" driver for my terminal program at the moment as it gives about the same size screen as the MAX7456 so I can see the screen coverage for FPV (First Person view) inside the model aircraft. The data presented to the pilot is not necessarily what you send to the ground or to an SD data file.
For instance, the pilot doesn't need the Lat/Long data on display but he needs to know his altititude and how far away the plane is and which direction it is traveling. I plan on using compass/arrow type graphics to show direction/distance to home and to preprogrammed "waypoints". If the data is also being transmitted to the ground, then a second person can track the plane real-time on GoogleEarth laptop.
Now, I have to go troubleshoot my bearing routine after my second cup of coffee.
Donald
This is another basic question, but I need to eliminate a variable before I try using the FPU to get GPS data.· I am reading on the micromegacorp website that an rs-232 converter is required to interface the FPU chip with a GPS.· I have succefully ran my GPS straight into the propeller (with a small resistor) to get the data.· Is the input on the FPU chip any diffrent from an input on the Propeller?· I am thinking that the output of my GPS is already formated to work with the FPU chip withoutht the rs-232 converter; is this correct?· My gps has an output that will connect dirrectly to a PC serial port·(DB-9 connector).
Karl
Karl
Jim
·
Jim,
What is the advantage of using UTM coordinates?
·
Karl
·
Jim
I saw that you are using the GPS_mini.spin code.
I have found some glitches in that code, which I hopefully corrected.
The main problem is that you have to inhibit the possibility of retrieving the pointers to the various NMEA fields when the copy_buffer object is running. You may otherwise, sooner or later, end up with a field with only nulls.
//G