FPU-v3.1 Newbie
Ray0665
Posts: 231
I am using the FPU-V3.1 with a propeller and a hacked up copy of the FPU-SPI-Demo object from the exchange.
In the procedure below I am simply multiplying by two each time through the loop. The output seems fine except after reaching 4194304.0, the next result is 0.0, and the next is 1.6777215e7!!!!! What is happening? Is it me???
I am at a loss, can anyone help?
Here is the code:
PRI FPU_Demo2 | i
Dbg.Str(string("
uM-FPU-V3.1 demo #2 with SPI
"))
Dbg.tx(13)
i := 2
FPU.WriteCmdByte(FPU#_SELECTA,2)
FPU.WriteCmdLong(FPU#_LWRITEA,i)
FPU.WriteCmd(FPU#_FLOAT)
Dbg.Str(string("Reg2: "))
Dbg.Str(FPU.ReadRaFloatAsStr(91))
Dbg.tx(13)
FPU.WriteCmdByte(FPU#_SELECTA,1)
FPU.WriteCmdLong(FPU#_LWRITEA,1)
FPU.WriteCmd(FPU#_FLOAT)
Dbg.Str(string("Reg1: "))
Dbg.Str(FPU.ReadRaFloatAsStr(91))
Dbg.tx(13)
Repeat n from 1 to 30
FPU.WriteCmdByte(FPU#_SELECTA,1)
FPU.WriteCmdByte(FPU#_FMUL,2)
Dbg.Str(string("Result: "))
Dbg.Str(FPU.ReadRaFloatAsStr(0))
Dbg.tx(13)
In the procedure below I am simply multiplying by two each time through the loop. The output seems fine except after reaching 4194304.0, the next result is 0.0, and the next is 1.6777215e7!!!!! What is happening? Is it me???
I am at a loss, can anyone help?
Here is the code:
PRI FPU_Demo2 | i
Dbg.Str(string("
uM-FPU-V3.1 demo #2 with SPI
"))
Dbg.tx(13)
i := 2
FPU.WriteCmdByte(FPU#_SELECTA,2)
FPU.WriteCmdLong(FPU#_LWRITEA,i)
FPU.WriteCmd(FPU#_FLOAT)
Dbg.Str(string("Reg2: "))
Dbg.Str(FPU.ReadRaFloatAsStr(91))
Dbg.tx(13)
FPU.WriteCmdByte(FPU#_SELECTA,1)
FPU.WriteCmdLong(FPU#_LWRITEA,1)
FPU.WriteCmd(FPU#_FLOAT)
Dbg.Str(string("Reg1: "))
Dbg.Str(FPU.ReadRaFloatAsStr(91))
Dbg.tx(13)
Repeat n from 1 to 30
FPU.WriteCmdByte(FPU#_SELECTA,1)
FPU.WriteCmdByte(FPU#_FMUL,2)
Dbg.Str(string("Result: "))
Dbg.Str(FPU.ReadRaFloatAsStr(0))
Dbg.tx(13)