SEARCH
TOOLBOX
LANGUAGES
Register    Login    Forum    Search    FAQ

Board index » Electronics Projects » PIC microcontroller projects




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: 18f4550 spectrum analyser project problem
 Post Posted: Wed Jun 13, 2012 9:54 pm 
Offline

Joined: Wed Jun 13, 2012 4:04 pm
Posts: 2
Hi Simon/all,
First of all, thank you very much Simon for posting all of these great projects. It's great to have the examples explained so clearly!.

Anyway, i have built the 18f4550 Spectrum Analyser project but it does not seem to work properly when i feed audio to it. I have reproduced the circuit from the diagram on the site and both the pic and the display seem to be working correctly. The project has been built on a piece of veroboard.

However, the actual levels of the buckets seem to be random all the way across the spectrum when it is running. The picture below shows an example of the display when a single frequency is being fed in.
Attachment:
high_noise_disp.jpg
high_noise_disp.jpg [ 116.88 KiB | Viewed 748 times ]


As you can see, the buckets are just random instead of peaking at a certain frequency.

The picture below shows the oscilloscope trace at the W3 point during this test
Attachment:
tone.jpg
tone.jpg [ 90.54 KiB | Viewed 748 times ]


When the board is plugged into the PC (my audio source) and there is no audio, the display just has a few random spikes on it. I have also done the same tests with a separate tone generator as the input but i got the same results on the LCD.

In order to rule out any ADC noise causing this, i changed the code to display the level of the ADC across the screen. The picture below shows the resulting display while connected to the PC but with no audio playing. As you can see, it's smooth and flat with no major noise problems.
Attachment:
adc_test.jpg
adc_test.jpg [ 116.72 KiB | Viewed 748 times ]


When i play audio with this test, the wave can be seen moving in the center of the LCD, so i think this proves the ADC is not getting large amounts of random data.

Also, just as the description for the project specified, i have calibrated the timing with my scope. The code was set up to give the ADC conversion time as a pulse on W4 instead of the whole loop time, so i changed the code to include the whole loop and calibrated it based on that.

It almost seems like the code is turning very small changes in the ADC value into random peaks on the FFT output.

I would really appreciate any suggestions or help that Simon or anyone else has that i can use to get this device working properly as i'd really like to see it showing valid frequency levels just like in the Youtube video during the sweep test.

Also, if a copy of the compiled binary is available from someone who has got a tested and working setup, that would be awesome. Then i could at least rule a few things out!.

Thanks in advance,
Richard


Top 
 Profile  
 
 Post subject: Re: 18f4550 spectrum analyser project problem
 Post Posted: Mon Jun 18, 2012 1:24 pm 
Offline

Joined: Thu Apr 01, 2010 6:23 am
Posts: 891
Hi

If the FFT is giving a seemingly random output it's usually due to the input sample data being incorrect in some way. If you compile the original source code without your changes is the output data any different?

/Simon


Top 
 Profile  
 
 Post subject: Re: 18f4550 spectrum analyser project problem
 Post Posted: Wed Jun 20, 2012 10:55 am 
Offline

Joined: Wed Jun 13, 2012 4:04 pm
Posts: 2
Thanks for getting back to me Simon.
I get the random FFT output even when i use your code in a completely unmodified form, just compiled without any changes straight from the zip file from this site.

However, the good news is that i found the hex code for the project on this board and when i put that onto the pic it seems to work perfectly.

So i guess the problem is either with the source code or the compiler. If other people have been able to compile the source and get a working device, then the problem must be my compiler messing up the code somehow.

Is the source from the zip file definitely the right one?

Richard


Top 
 Profile  
 
 Post subject: Re: 18f4550 spectrum analyser project problem
 Post Posted: Thu Jun 21, 2012 6:08 am 
Offline

Joined: Thu Apr 01, 2010 6:23 am
Posts: 891
At a guess maybe you are using the full version of the compiler rather than the 'free' version which does not optimise the code as much? If you are then it is probably altering the timing some how. If not then perhaps your crystal isn't 20 Mhz?

The source code zip is the same as the code used to generate the hex file.


Top 
 Profile  
 
 Post subject: Re: 18f4550 spectrum analyser project problem
 Post Posted: Wed Sep 12, 2012 4:06 am 
Offline

Joined: Wed Sep 12, 2012 3:58 am
Posts: 21
Hi Simon,
I am very interested on building your real time audio spectrum. I love music and I believe I will have an great time playing with this project. Please provide a list of parts necessary to complete it. That way I will have everything that I need with no missing parts. Thank you! I will be looking forward to hear from any of you!


Top 
 Profile  
 
 Post subject: Re: 18f4550 spectrum analyser project problem
 Post Posted: Wed Sep 12, 2012 9:38 am 
Offline

Joined: Thu Apr 01, 2010 6:23 am
Posts: 891
If you grab the schematic from the project page you can build a BOM right in the application.


Top 
 Profile  
 
 Post subject: Re: 18f4550 spectrum analyser project problem
 Post Posted: Wed Sep 12, 2012 6:15 pm 
Offline

Joined: Wed Sep 12, 2012 3:58 am
Posts: 21
Thanks for the fast reply Simon, I will look into it and if anything I'll come back for help!


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 7 posts ] 

Board index » Electronics Projects » PIC microcontroller projects


Who is online

Users browsing this forum: Google [Bot] and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Translated by MaĆ«l Soucaze © 2009 phpBB.fr