Author Topic: Noice on ADC when using bootloader  (Read 8641 times)

Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Noice on ADC when using bootloader
« on: February 27, 2009, 01:28:04 PM »
Hi,

Have just made a project where i use the ADC to sample data.

I then have an upper and a lower signal limit to detect changes in the signal.

My basic problem is that when I development the filter i found the upper and lower limit by test and this was great ;-).
Now after I added the bootloader to the project i found that there are more noise on the ADC than before i use the bootloader. ???

I have tried some time with the same code but with and without the bootloader and it looks like the bootloader do a difference?

Any suggestion?

Steen

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Noice on ADC when using bootloader
« Reply #1 on: February 27, 2009, 02:19:54 PM »
Hi Steen

I can't explain why the boot loader should cause more noise in the ADC.

Without the boot loader you have the application linked to just after the start-up code in FLASH (about 0x420) and with boot loader the application is linked to start at 2k. When there is a valid application loaded the boot loader doesn't run and the application is (apart from the slightly different link address) identical.

Therefore I don't see any logical explanation for the difference that you are seeing. But, if you can really see a difference there must be something happening. I think that you need to study a little more. Perhaps there are other changes made between the two versions that you are comparing and it has another root-cause than the fact that it the boot loader is present (?)

Regards

Mark



Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: Noice on ADC when using bootloader
« Reply #2 on: March 02, 2009, 07:55:16 AM »
Hi Mark
I know that it sounds weird, and if It was not because that I can see it with my own eyes I will have a hard time believing it as well. ;)

When I have done my developing I am using the M52235EVB_ROM and when using the bootloader I am using the bare_min_app_rom in the CodeWarrior.
The reason for the post, was that I kind out of ides, regarding the funny behavior.

My hope was that you could say that in the bootloader a part of the processer was turned on doing the bootloader part, and this part was not turned off again.
But it looks like I need to do some more digging. :-\

Regards
Steen
     

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Noice on ADC when using bootloader
« Reply #3 on: March 02, 2009, 02:09:24 PM »
Hi Steen

I just double checked. When the boot loader is present it doesn't program any peripherals (it runs at crystal frequency, without programming the PLL). It checks the content of FLASH and finds that there is nothing to be done and simply jumps to the normal application initialisation.

the normal application initialisation sets the PLL operating speed and disables unused peripherals.

Therefore the boot loader step before the application initialisation doesn't 'seem' to be able to influence in any way.

You could however do the following test:

1) Set a break point at the very start of code.
2) Now change the SP and PC contents manually to the values found at addresses 0x800 and 0x804 (the application values).
3) Now let the code run. This will effectively jump over all boot code and immediately start the application.
If you have less noise then there is really something in the boot code which is causing it. If there is no change, it can't be due to the boot code. (At least not due to it being executed on start-up).


Regards

Mark