OK, after several hours, I finally have the demo working. The major problem was _READSEL.
It does not work as I thought. The working file is attached. You can use the previous FPU.spin.
Have you tried the FPU IDE to upload functions yet? It works, but seems to shift the FPU out of DEBUG
mode after every command. Cycling the power to the chip institutes a RESET and it will accept another
command. I have loaded the functions from the "Distance" example but, for some reason, it makes my
program stop working. I think the functioins are trying to use the same registers that I am, so I will try
using others. I'll let you know what happens.
Jim,
Yes, I have loaded the functions and am working on converting the GC Demo. I have it working but my stack is not right. There is an extra call somewhere and its late (3:30AM) and I think I'm going blind.
Great Circle Distances
FPU MASTER CLEAR...
FPU Driver started...----uM-FPU-V3.1 demo with SPI---
FPU Software Reset done...
Response to _SYNC: 92 (OK)
Version String: uM-FPU V3.1.0
Clock ticks / ms: 29480
From:
Reading GPS ...
Location (31deg 14min, 121deg 30min)
To:
London, England (51deg 32min, 0deg 5min)
4960.96 nautical miles
3082.60 miles
4960.96 kilometers
Paris, France (48deg 49min, 2deg 20min)
5001.65 nautical miles
3107.88 miles
5001.65 kilometers
Sydney, Australia (-34deg 1min, 151deg 0min)
4254.49 nautical miles
2643.62 miles
4254.49 kilometers
Tokyo, Japan (35deg 41min, 139deg 45min)
950.35 nautical miles
590.52 miles
950.35 kilometers
Zurich, Switzerland (47deg 22min, 8deg 31min)
4864.50 nautical miles
3022.66 miles
4864.50 kilometers
New York, USA (40deg 47min, -73deg 58min)
6395.03 nautical miles
3973.69 miles
6395.03 kilometers
Los Angeles, USA (34deg 4min, -118deg 15min)
5629.53 nautical miles
3498.03 miles
5629.53 kilometers
Santiago, Chile (-33deg 29min, -70deg 45min)
10165.39 nautical miles
6316.48 miles
10165.39 kilometers
Jim, I know it is supposed to work that way but that is what is causing me problems now in this one.
If I disable everything from just before the call, the program terminates correctly.
But if i just insert
dbg.str(FPU.ReadStr)
the programs goes haywire and does not exit. Sometimes it starts printing correctly but it always goes out to lunch before completing. Now I can't remember how I got it to work before.
Here are the results but I stilll can't find the problem.
The main program calls FP_Demo, whichs runs correctly but does not return to the main program wich closes the cogs.
Maybe someone else can spot my error. My eyes are bleary. Files attached.
uM-FPU V3.1 demo with SPI protocol
FPU MASTER CLEAR...
FPU Driver started...FPU Software Reset done...
Response to _SYNC: 92 (OK)
Version String: uM-FPU V3.1.0
Clock ticks / ms: 29480
From:
Reading GPS ...
Location (31deg 14min, 121deg 30min)
To:
0:London, England (51deg 32min, 0deg 5min)
4960.97 nautical miles
3082.60 miles
4960.97 kilometers
1:Paris, France (48deg 49min, 2deg 20min)
5001.65 nautical miles
3107.88 miles
5001.65 kilometers
2:Sydney, Australia (-34deg 1min, 151deg 0min)
4254.48 nautical miles
2643.61 miles
4254.48 kilometers
3:Tokyo, Japan (35deg 41min, 139deg 45min)
950.36 nautical miles
590.53 miles
950.36 kilometers
4:Zurich, Switzerland (47deg 22min, 8deg 31min)
4864.50 nautical miles
3022.66 miles
4864.50 kilometers
5:New York, USA (40deg 47min, -73deg 58min)
6395.04 nautical miles
3973.70 miles
6395.04 kilometers
6:Los Angeles, USA (34deg 4min, -118deg 15min)
5629.54 nautical miles
3498.03 miles
5629.54 kilometers
7:Santiago, Chile (-33deg 29min, -70deg 45min)
10165.39 nautical miles
6316.48 miles
10165.39 kilometers
GC Demo Finished
Found the distance problem. It is around line 689. I did not know what they were trying to do.
It is supposed to be writing a floating point number. Here is the corrected portion:
I still have not found the stack problem but I know it is the
dbg.Str(FPU.ReadStr) (Line 656)
If I put a return before this statement, it returns correctly. If I place a return after the statement, it does not. ????? ·
Comments
It does not work as I thought. The working file is attached. You can use the previous FPU.spin.
Now I can go forward with more comfort.
Cheers,
Donald
It also works with the "ReadSTR" command in the FPU driver.
Have you tried the FPU IDE to upload functions yet? It works, but seems to shift the FPU out of DEBUG
mode after every command. Cycling the power to the chip institutes a RESET and it will accept another
command. I have loaded the functions from the "Distance" example but, for some reason, it makes my
program stop working. I think the functioins are trying to use the same registers that I am, so I will try
using others. I'll let you know what happens.
Jim
Yes, I have loaded the functions and am working on converting the GC Demo. I have it working but my stack is not right. There is an extra call somewhere and its late (3:30AM) and I think I'm going blind.
If I disable everything from just before the call, the program terminates correctly.
But if i just insert
dbg.str(FPU.ReadStr)
the programs goes haywire and does not exit. Sometimes it starts printing correctly but it always goes out to lunch before completing. Now I can't remember how I got it to work before.
·
The main program calls FP_Demo, whichs runs correctly but does not return to the main program wich closes the cogs.
Maybe someone else can spot my error. My eyes are bleary. Files attached.
Donald
It is supposed to be writing a floating point number. Here is the corrected portion:
I still have not found the stack problem but I know it is the
dbg.Str(FPU.ReadStr) (Line 656)
If I put a return before this statement, it returns correctly. If I place a return after the statement, it does not. ?????
·