Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 03:28 19 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : double precision interpreter

Author Message
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 06:37pm 21 Dec 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 676
Posted: 06:35am 22 Dec 2014
Copy link to clipboard 
Print this post

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 States
Posts: 261
Posted: 09:21am 22 Dec 2014
Copy link to clipboard 
Print this post

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: Australia
Posts: 689
Posted: 05:16pm 22 Dec 2014
Copy link to clipboard 
Print this post

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.

Edited by chronic 2014-12-24
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 07:22pm 26 Dec 2014
Copy link to clipboard 
Print this post

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.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024