View previous topic :: View next topic |
Author |
Message |
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Thu Mar 26, 2015 9:45 pm Post subject: Code from version bascom 1.11.9.0 does not compile |
|
|
Hi,
I found an FFT program written in Bascom 1.11.9.0 but not compiling in latest version.
http://mdiy.pl/wp-content/uploads/2009/12/spectrum_analyzer_v2_9d.rar
The error code is
Error : 200 Line : 242 .DEF not found [BETA []] , in File : D:\Program Files\Bascom\analizator.V2_9d_16x2.bas
Error : 369 Line : 281 Duplicate label name used by const or variable [SAMPLE_L] , in File : D:\Program Files\Bascom\analizator.V2_9d_16x2.bas
which apparently is related to
Code: | Dim Beta As Iram Byte |
and a sub does have same name as a variable SAMPLE_L
Any suggestion how to get it running is very, very welcome.
Regards, Meister
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
PeterM
Joined: 09 Jun 2008 Posts: 118
|
Posted: Fri Mar 27, 2015 7:00 am Post subject: |
|
|
Meister
Just briefly looking at the code, I cannot see it used for any registers so remove
the Iram from the Dim
Next rename the routine Sample_h to say Sample_hx
There is also a Gosub Sample_h, change to Gosub Sample_hx
Also so the same for Sample_l _________________ Peter |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 970
|
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Fri Mar 27, 2015 2:34 pm Post subject: |
|
|
Thanks for the answers.
@EDC, will your FFT Bascom code be available? |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 970
|
Posted: Fri Mar 27, 2015 3:06 pm Post subject: |
|
|
This is only a part adapted to my project. Main file shows how this work. |
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Fri Mar 27, 2015 3:55 pm Post subject: |
|
|
@EDC:
The Compiler complains:
Error : 200 Line : 101 .DEF not found [BETA []] , in File : analizator.bas
(coming from Dim Beta As Iram 'iram )
Replacing Iram by Byte gives same error.
Do you have suggestion on how to get it running? Thanks... |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5905 Location: Holland
|
Posted: Fri Mar 27, 2015 8:57 pm Post subject: |
|
|
instead of the dim beta as iram byte, use the register name like R16
so code becomes :
R16 = I * K
r16=r16 and 31 _________________ Mark |
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Fri Mar 27, 2015 11:01 pm Post subject: |
|
|
Thanks, Mark.
I replaced all "Beta" by R16 but still get the error
Error : 200 Line : 101 .DEF not found [BETA []] , in File : analizator.bas
Line 101:
R16 = R16 And 31
Regards, Meister |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5905 Location: Holland
|
Posted: Fri Mar 27, 2015 11:05 pm Post subject: |
|
|
you must have missed one. otherwise post the code. _________________ Mark |
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Sat Mar 28, 2015 3:18 pm Post subject: |
|
|
Hi Mark,
strange thing is: after saving the changed include-file, no error any more.
Maybe not so strange because the included file always is loaded from disk and not from the IDE.
Thank you for your help.
I will try the code now.
Regards, Meister |
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Fri Apr 10, 2015 9:39 am Post subject: |
|
|
Hello EDC,
thank you very much for posting the FFT code.
What I want to do finally is to get the phases of the spectrum components.
The comments in the file are in Polish and Google translate does not help too much.
Could you point out which arrays are are holding the real and imaginary parts of the spectrum so I could calculate the phases?
Thank you very much.
Regards, Meister |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 970
|
Posted: Fri Apr 10, 2015 1:56 pm Post subject: |
|
|
This code works so I never must deeply thinking how this is made
Autor can explain this propabbly the best but I translate this to english myself so maybe this can be helpful.
Please write to the author for further clarification. |
|
Back to top |
|
|
Meister
Joined: 27 May 2010 Posts: 319
|
Posted: Fri Apr 10, 2015 2:46 pm Post subject: |
|
|
Thank you, EDC.
I will see now if I can find the lines corresponding to Re and Im part of the spectrum.
Best regards, Meister |
|
Back to top |
|
|
|