double precision float on ESP8266
Re: double precision float on ESP8266
Phew, okay that sound resonable!
Just ask if you have any problems building the firmware!
Just ask if you have any problems building the firmware!
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: double precision float on ESP8266
The Pyboard D SF6W has hardware double precision FP. As far as I know the other ports which implement it do it in software.
Astronomical work definitely needs DP, especially if you get into things like predicting solar eclipses...
Astronomical work definitely needs DP, especially if you get into things like predicting solar eclipses...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: double precision float on ESP8266
Thanks, good to know ! But not the same budget.. And actually i can manage with software implementation, since there is no time of computing issue.pythoncoder wrote: ↑Wed May 22, 2019 8:24 amThe Pyboard D SF6W has hardware double precision FP. As far as I know the other ports which implement it do it in software.
Astronomical work definitely needs DP, especially if you get into things like predicting solar eclipses...
Re: double precision float on ESP8266
Hi,
Sometime ago I made some thought, about this subject to build an heliostat.
The best option to me would be:
- port a fixed point precision library to microptyhon( the original one is python 3.1 so it should be quite easy)
- code the astronomic algorithm using this library.
Here is the thread for reference:
viewtopic.php?f=15&t=3405&p=19923#p19923
Finaly, I gived up because single precision was enough for me.
Sometime ago I made some thought, about this subject to build an heliostat.
The best option to me would be:
- port a fixed point precision library to microptyhon( the original one is python 3.1 so it should be quite easy)
- code the astronomic algorithm using this library.
Here is the thread for reference:
viewtopic.php?f=15&t=3405&p=19923#p19923
Finaly, I gived up because single precision was enough for me.
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: double precision float on ESP8266
I have made some tests:
I got FixedPoint.py
To avoid an error I remove 'TypeError' from line 248 (I will check later thi point)
"class FXfamilyError(FXexception, TypeError): "
I upload it to my esp32.
import FixedPoint
x=FixedPoint.FXnum=(1)
y=FixedPoint.FXnum=(3)
print(x/y)
0.333333333333333333315
default family is 64bits
I try 128bit adn get an error
I got FixedPoint.py
To avoid an error I remove 'TypeError' from line 248 (I will check later thi point)
"class FXfamilyError(FXexception, TypeError): "
I upload it to my esp32.
import FixedPoint
x=FixedPoint.FXnum=(1)
y=FixedPoint.FXnum=(3)
print(x/y)
0.333333333333333333315
default family is 64bits
I try 128bit adn get an error
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: double precision float on ESP8266
The FixedPoint library is quite large -- it's going to use up a significant amount of the RAM on your ESP8266.
This is probably why it fails at 128bit?
I generated an mpy module from FixedPoint.py and was able to do at least basic stuff in 128-bit.
Code: Select all
>>> a = FixedPoint.FXnum(1)
>>> b = FixedPoint.FXnum(3)
>>> print(a/b)
0.33333333333333333331
>>> f = FixedPoint.FXfamily(128)
>>> a = FixedPoint.FXnum(1, f)
>>> b = FixedPoint.FXnum(3, f)
>>> print(a/b)
0.333333333333333333333333333333333333332
Code: Select all
git checkout v1.10
cd mpy-cross
make -j 16
./mpy-cross -X emit=native -O3 ~/src/github.com/rwpenney/spfpm/FixedPoint.py
A better approach would be to make a frozen module out of it, so the bytecode will be stored in ROM (Flash) instead. You'll have to build your own firmware, after placing FixedPoint.py in the ports/esp8266/modules directory.
Re: double precision float on ESP8266
Thanks,
I hope it could help ThomasChr
I hope it could help ThomasChr
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
-
- Posts: 8
- Joined: Wed May 29, 2019 6:17 pm
Re: double precision float on ESP8266
hi,, if i follow the described way i get this error:
TypeError: multiple bases have instance lay-out conflict
any further hints regarding?
many thanks
TypeError: multiple bases have instance lay-out conflict
any further hints regarding?
many thanks
Re: double precision float on ESP8266
hi!apollo2mond wrote: ↑Sun Jun 02, 2019 6:45 pmhi,, if i follow the described way i get this error:
TypeError: multiple bases have instance lay-out conflict
Sorry there have been lots of things described in this post - which part were you following?
It's possible though you might have run into to what @pidou46 said "To avoid an error I remove 'TypeError' from line 248 (I will check later thi point)"
Re: double precision float on ESP8266
Hello,
i just purchased an ESP32-WROOM-32, to try the Roberthh's solution : compile custom FW with double float on ESP32.
But actually, i need help for that...
What do i need ? (sources, compiler..)
How to get it work ?
sorry but my knowledge in micro-controller is just enough to flash regular FW
Thanks a lot
Matthieu
i just purchased an ESP32-WROOM-32, to try the Roberthh's solution : compile custom FW with double float on ESP32.
But actually, i need help for that...
What do i need ? (sources, compiler..)
How to get it work ?
sorry but my knowledge in micro-controller is just enough to flash regular FW
Thanks a lot
Matthieu