JLS Posted April 8, 2013 Report Share Posted April 8, 2013 Hi all ZPUino soft processor not support floating point math ? Please help me im testing simple code in AVR8 soft processor and floating math working fine but with ZPUino not working ! Many thanks info and example Link to comment Share on other sites More sharing options...
alvieboy Posted April 8, 2013 Report Share Posted April 8, 2013 Yes, I think that something is wrong on the compiler regarding floating point. I'll try to solve this as soon as possible. Link to comment Share on other sites More sharing options...
JLS Posted April 9, 2013 Author Report Share Posted April 9, 2013 Many thanks info Please do working fp math with ZPUino (this is very usefull - 90% my project require floating point math) Thanks help Kamil Link to comment Share on other sites More sharing options...
alvieboy Posted April 9, 2013 Report Share Posted April 9, 2013 Why are you so dependant on fp math ? It will be very slow compared to integer-only and fixed point math. Can you share your sketch ? I might be able to turn it into integer or fixed-point. Link to comment Share on other sites More sharing options...
JLS Posted April 9, 2013 Author Report Share Posted April 9, 2013 My idea is studying chaotic attractors and fractals. FPGA and virtual processor is great for my chaotic and music experiments. Some example my old codes for arduino platform is here http://jlswbs.blogspot.com FPGA is better platform for interfacing devices this is very flexible. Kamil Link to comment Share on other sites More sharing options...
alvieboy Posted April 9, 2013 Report Share Posted April 9, 2013 ok I seem to have found the problem (it's a loong standing issue)... Let me try fixing this and run some tests. Link to comment Share on other sites More sharing options...
JLS Posted April 9, 2013 Author Report Share Posted April 9, 2013 Very thanks great info about it Kamil Link to comment Share on other sites More sharing options...
alvieboy Posted April 10, 2013 Report Share Posted April 10, 2013 Ok, here's a "libgcc.a" library fix for this. http://alvie.com/zpuino/downloads/libgcc-fix-for-64bit-and-floatingpoint.zip The zip file contains 4 libraries: libgcc.afast/libgcc.asmall/libgcc.aludicrous/libgcc.a Locate the "libgcc.a" installed in your system (should be four of them), they should be inside "hardware/tools/zpu/lib/gcc/zpu-elf/3.4.2/" for Windows and Mac. Make sure you don't overwrite AVR one instead.Replace the four libraries in your system with the ones in the .zip file. If you're using linux, replace the ones in where you installed the toolchain. If you only have one "libgcc.a", replace it with the fast version (fast/libgcc.a). Let me know if this fixes all issues. Link to comment Share on other sites More sharing options...
JLS Posted April 10, 2013 Author Report Share Posted April 10, 2013 Hi alvieboy Yesss floating point working me :-) Many thanks great work !!!! Kamil Link to comment Share on other sites More sharing options...
alvieboy Posted April 10, 2013 Report Share Posted April 10, 2013 Excellent. This will be fixed in mainstream in next version. Link to comment Share on other sites More sharing options...
JLS Posted April 10, 2013 Author Report Share Posted April 10, 2013 Simple question. Im make chua oscillator sketch with deltasigma DAC. This working but dont understand how to write two independent DAC value. ( example DAC0 = x and DAC1 = y value ) #include <math.h> float x = 0.5; float y = 0.25; float z = 0.125; float oldx = 0; float oldy = 0; float oldz = 0; float h = 0; float dt = 0.005; float alpha = 15.6; float beta = 28.58; float a = -1.14286; float b = -0.714286; int outx,outy; int pindac0 = 0; int pindac1 = 1; void setup() { pinMode(pindac0, OUTPUT); pinModePPS(pindac0, HIGH); outputPinForFunction(pindac0, 0); pinMode(pindac1, OUTPUT); pinModePPS(pindac1, HIGH); outputPinForFunction(pindac1, 0); SIGMADELTACTL = 0x03;} void loop(){ oldx = x; oldy = y; oldz = z; h = (b * x) + (0.5 * ( a - b ) * (fabs(x+1) - fabs(x-1))); x = oldx + dt * (alpha * (oldy - oldx - h)); y = oldy + dt * (oldx - oldy + oldz); z = oldz + dt * (-beta * oldy); outx = 32768 + int(13500*x); outy = 32768 + 5 * int(13500*y); SIGMADELTADATA = outx; } Please help me with example two independent DAC. Many thanks Kamil Link to comment Share on other sites More sharing options...
alvieboy Posted April 10, 2013 Report Share Posted April 10, 2013 It's a 32-bit register, with two 16-bit values for each channel. So, doing: SIGMADELTADATA = outy<<16 + outx&0xffff; should do the job. The "&0xffff" is just to ensure you do not pass more "value" than it takes. Link to comment Share on other sites More sharing options...
JLS Posted April 10, 2013 Author Report Share Posted April 10, 2013 Thanks this is working :-) Link to comment Share on other sites More sharing options...
JLS Posted April 10, 2013 Author Report Share Posted April 10, 2013 sorry next few questions :-) 1. on your site is three different version bit file. Version with SID and VGA this two version not support deltasigma DAC ? 2. ZPUino support PWM on output PINs ? Please example thanks 3. Is possible make simple example how to basic run with SID POKEY and YM2149 ? Many thanks help :-) Kamil Link to comment Share on other sites More sharing options...
Jack Gassett Posted April 10, 2013 Report Share Posted April 10, 2013 sorry next few questions :-) 1. on your site is three different version bit file. Version with SID and VGA this two version not support deltasigma DAC ? 2. ZPUino support PWM on output PINs ? Please example thanks 3. Is possible make simple example how to basic run with SID POKEY and YM2149 ?Take a look at the RetroCade Sketch for examples and libraries for the SID and YM2149. POKEY to be added later, or maybe you might be interested in adding POKEY? Here is a RetroCade branch with POKEY. Many thanks help :-) Kamil Link to comment Share on other sites More sharing options...
JLS Posted April 11, 2013 Author Report Share Posted April 11, 2013 Thanks info Today im testing RetroCade :-) Simple question do exist version bit file combined RetroCade and VGA output for Papilio One 500 ? Thanks info about it. Kamil Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.