![]() |
Forum Index : Microcontroller and PC projects : double precision interpreter
Author | Message | ||||
isochronic Guru ![]() Joined: 21/01/2012 Location: AustraliaPosts: 689 |
Anyone want to help trial/test a double-precision interpreter I wrote ? It runs on pic32mx170B sdip chips and might be of use.. Simple example code : PROGRAM voltz;
C; INTEGER*4 i ; REAL x, y ; FORMAT (A,F5.3,A,/); DO 10 i = 1, 100 ; CALL delay() ; x = FLOAT ( ADX4 ) ; x = ( x * 3.260 ) / 1024.0 ; WRITE (6,0) "Cell is at ", x, " volts" ; 10 CONTINUE ; END ; C; SUBROUTINE delay ( ) ; INTEGER*4 i ; C wait ; DO 10 i = 1, 8000 ; 10 CONTINUE ; RETURN ; END ; \ Cell is at 0.073 volts Cell is at 0.067 volts Cell is at 0.054 volts Cell is at 0.073 volts Cell is at 0.096 volts Cell is at 0.073 volts ... and to use double precision (bad example!) PROGRAM battery ;
INTEGER*4 sec ; DOUBLE start, stored, current, gain ; C Initial state in amp-seconds; start = 36000.0 ; stored = start ; C Three hours adding at one milliamp ; current = 0.001 ; DO 10 sec = 1, 10800 ; stored = stored + current ; 10 CONTINUE ; gain = stored - start ; FORMAT (A,F5.3,/) ; WRITE (6,0) "amp-seconds gained : ", gain ; END ; \ amp-seconds gained : 10.800 More info is in a doc 2014-12-22_043711_Electride1-0.zip contact me if interested .. |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi Chronic Your ReadMe took me straight back to my brown Daniel D. McCracken's "A Guide to Fortran Programming", Hollerith card punch machines, waiting for hours through the night to see if my deck had run (us 1st year undergraduates were the scum, so our stuff only got run when there was free time on the CDC 6600) - still happy days, and my first taste of computing ![]() An interesting contribution to the MCU environment, but what application domains do you see Electride aimed/excelling at ? Peter The only Konstant is Change |
||||
cdeagle Senior Member ![]() Joined: 22/06/2014 Location: United StatesPosts: 265 |
Chronic, Sounds very interesting. I have lots of Fortran routines I would like to try with your software. |
||||
isochronic Guru ![]() Joined: 21/01/2012 Location: AustraliaPosts: 689 |
I can see maybe a niche for one-off applications where compiled speed is not important but flexibility and precision is useful. Originally I was interested in running a small heliostat, computing the sun position from gps / time etc. (ed) And it would be good for students to be able to use double precision easily. |
||||
isochronic Guru ![]() Joined: 21/01/2012 Location: AustraliaPosts: 689 |
I guess it could also be used as a "coprocessor", eg the MM could run it to process and crunch specialized math and report back - quite a powerful combo. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |